Skip to content
Doug Bird edited this page May 31, 2018 · 30 revisions

Flat XML Schema Extension

An XML Namespace

Namespace for describing object metadata. For the purposes of the specification, object metadata is defined as such properties as: data types, array indexes, encoding type, etc.

See https://github.com/katmore/flat/wiki/xmlns for flat xml specification details.

All examples in this specification assume this namespace has been declared with the tag extxs; ie: xmlns:extxs="https://github.com/katmore/flat/wiki/xmlns-extxs, that namespace http://www.w3.org/2001/XMLSchema-instance has been tagged as xsi, and that namespace http://www.w3.org/2001/XMLSchema has been tagged as xs.

version 0.2

xsi:type attribute

This specification includes a subset of xsi:type attribute values (those with the xs prefix) and an extended set of type description values (those with the extxs prefix).

  • xs:DateTime
  • xs:hexBinary
  • xs:base64Binary
  • xs:anyURI
  • xs:string
  • xs:integer
  • xs:decimal
  • xs:boolean
  • extxs:Array
  • extxs:Object
  • extxs:NumericStringInt
  • extxs:NumericStringFloat
  • extxs:NumericString
  • extxs:Resource
  • extxs:UnknownType
  • extxs:EmptyString
  • extxs:Binary

extxs:index attribute

The extxs:index attribute describes a numerical integer value indicating a node's relationship to its parent; useful for when a node represents an array element.

  • example usage, considering a parent node mylist with two children:
    <mylist>
       <item extxs:index="0">Item 1</item>
       <item extxs:index="1">Item 2</item>
    </mylist>

extxs:key attribute

The extxs:key attribute describes a node's relationship to its parent; useful for when a node represents a hashmap key/value association.

  • example usage, considering a parent node mything with a child having key my_first_thing and another having key my_second_thing with corresponding values of Thing 1 and Thing 2:
    <mything>
       <part extxs:key="my_first_thing">Thing 1</part>
       <part extxs:key="my_second_thing">Thing 2</part>
    </mything>

xsi:nil attribute

The xsi:nil attribute having the value true describes that a node has no corresponding data value.

  • example of node with a null value:
    <mynode xsi:nil="true" />
    

extxs:encoding attribute

The encoding of a node's data value can be described with the extxs:encoding attribute.

  • example of a node with base64 data encoding, (the node data has the value hello):
    <mynode extxs:encoding="base64">aGVsbG8=</mynode>

extxs:dump node

A extxs:dump node describes a parent node's data value while also indicating that the value cannot be reliably unserialized. A dump value's encoding can be described with the extxs:encoding attribute.

  • example dump using "base64" encoding:
    <extxs:dump extxs:encoding="base64">aGVsbG8=</dump>
  • example dump using "none" encoding:
    <extxs:dump extxs:encoding="none">hello</dump>