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

Flat XML Schema

An XML Namespace

Namespace for flat XML documents.

All examples in this specification assume this namespace has been declared with the tag "fx"; ie: xmlns:fx="https://github.com/katmore/flat/wiki/xmlns".

version 0.2

  • xml version: 1.0
  • character encoding must be UTF-8
  • Top level node:
  • Other suggested namespace declarations:
  • Optional attributes:
    • fx:flat-xml-version: flat-xmlns version used for node
    • fx:meta: indicate meta-data regarding document, such as an object type that was mapped.
    • fx:created: ISO 8601 formatted time of document creation.
    • fx:crc32: crc32 polynomial of a hypothetical object represented by the document; expressed as a base16 number.
    • fx:md5: md5 hash of a hypothetical object represented by the document; expressed as a base16 number.
  • Base64 Encoded Attribute value:
    • the encoded attribute value should be prefixed with "data:application/octet-stream;base64,".
    • example usage, considering the value "hello"
    • <mynode myattr="data:application/octet-stream;base64,aGVsbG8=" />
  • data: nodes with the name "data" can use xsi methodology to describe values.
    • <data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">My String</data>

Example Flat XML document

<?xml version="1.0" encoding="UTF-8"?>
<flat xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fx="https://github.com/katmore/flat/wiki/xmlns" xmlns="https://github.com/katmore/flat/wiki/xmlns-object" xmlns:extxs="https://github.com/katmore/flat/wiki/xmlns-extxs" fx:created="1970-01-01T00:00:00-00:00" fx:crc32="34D2" fx:md5="5d41402abc4b2a76b9719d911017c592" fx:meta="flat\data\hello" fx:flat-xml-ver="0.1">
   <data xsi:type="xs:string">hello</data>
</flat>
Clone this wiki locally