Skip to content

Instantly share code, notes, and snippets.

@gigaherz
Last active December 19, 2021 23:37
Show Gist options
  • Save gigaherz/9514583a257105f669e3f9c2fbc2e7c4 to your computer and use it in GitHub Desktop.
Save gigaherz/9514583a257105f669e3f9c2fbc2e7c4 to your computer and use it in GitHub Desktop.
Schema definition for XNBT: A format for Xml-encoded NBT
<?xml version="1.0" encoding="UTF-8"?>
<n:compound xmlns:n="https://dogforce-games.com/xnbt/2021/XNbtSchema">
<n:byte key="byte">1</n:byte>
<n:short key="short">2</n:short>
<n:int key="int">3</n:int>
<n:long key="long">4</n:long>
<n:float key="float">5.0</n:float>
<n:double key="double">6.0</n:double>
<n:string key="string">seven</n:string>
<n:list key="list">
<n:int>1</n:int>
<n:int>2</n:int>
<n:int>3</n:int>
</n:list>
<n:array of="byte" key="array">1,2,3,4,5</n:array>
</n:compound>
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" targetNamespace="https://dogforce-games.com/xnbt/2021/XNbtSchema" xmlns:n="https://dogforce-games.com/xnbt/2021/XNbtSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="array_types">
<xs:restriction base="xs:string">
<xs:enumeration value="byte" />
<xs:enumeration value="int" />
<xs:enumeration value="long" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="end" />
<xs:complexType name="list">
<xs:choice>
<xs:element ref="n:end" maxOccurs="unbounded" minOccurs="0" />
<xs:element ref="n:byte" maxOccurs="unbounded" minOccurs="0" />
<xs:element ref="n:short" maxOccurs="unbounded" minOccurs="0" />
<xs:element ref="n:int" maxOccurs="unbounded" minOccurs="0" />
<xs:element ref="n:long" maxOccurs="unbounded" minOccurs="0" />
<xs:element ref="n:float" maxOccurs="unbounded" minOccurs="0" />
<xs:element ref="n:double" maxOccurs="unbounded" minOccurs="0" />
<xs:element ref="n:string" maxOccurs="unbounded" minOccurs="0" />
<xs:element ref="n:list" maxOccurs="unbounded" minOccurs="0" />
<xs:element ref="n:array" maxOccurs="unbounded" minOccurs="0" />
<xs:element ref="n:compound" maxOccurs="unbounded" minOccurs="0" />
</xs:choice>
</xs:complexType>
<xs:complexType name="array">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="n:array_types" name="of" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="compound">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="end" type="n:key_end" />
<xs:element name="byte" type="n:key_byte" />
<xs:element name="short" type="n:key_short" />
<xs:element name="int" type="n:key_int" />
<xs:element name="long" type="n:key_long" />
<xs:element name="float" type="n:key_float" />
<xs:element name="double" type="n:key_double" />
<xs:element name="string" type="n:key_string" />
<xs:element name="list" type="n:key_list" />
<xs:element name="compound" type="n:key_compound">
<xs:unique name="UniqueChildKey">
<xs:selector xpath="*"/>
<xs:field xpath="@key"/>
</xs:unique>
</xs:element>
<xs:element name="array" type="n:key_array" />
</xs:choice>
</xs:complexType>
<xs:simpleType name="key">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="key_end">
<xs:simpleContent>
<xs:extension base="n:end">
<xs:attribute type="n:key" name="key" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="key_byte">
<xs:simpleContent>
<xs:extension base="xs:byte">
<xs:attribute type="n:key" name="key" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="key_short">
<xs:simpleContent>
<xs:extension base="xs:short">
<xs:attribute type="n:key" name="key" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="key_int">
<xs:simpleContent>
<xs:extension base="xs:int">
<xs:attribute type="n:key" name="key" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="key_long">
<xs:simpleContent>
<xs:extension base="xs:long">
<xs:attribute type="n:key" name="key" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="key_float">
<xs:simpleContent>
<xs:extension base="xs:float">
<xs:attribute type="n:key" name="key" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="key_double">
<xs:simpleContent>
<xs:extension base="xs:double">
<xs:attribute type="n:key" name="key" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="key_string">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="n:key" name="key" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="key_list">
<xs:complexContent>
<xs:extension base="n:list">
<xs:attribute type="n:key" name="key" use="required" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="key_compound">
<xs:complexContent>
<xs:extension base="n:compound">
<xs:attribute type="n:key" name="key" use="required" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="key_array">
<xs:complexContent>
<xs:extension base="n:array">
<xs:attribute type="n:key" name="key" use="required" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="end" type="n:end" />
<xs:element name="byte" type="xs:byte" />
<xs:element name="short" type="xs:short" />
<xs:element name="int" type="xs:int" />
<xs:element name="long" type="xs:long" />
<xs:element name="float" type="xs:float" />
<xs:element name="double" type="xs:double" />
<xs:element name="string" type="xs:string" />
<xs:element name="list" type="n:list" />
<xs:element name="compound" type="n:compound">
<xs:unique name="UniqueKey">
<xs:selector xpath="*"/>
<xs:field xpath="@key"/>
</xs:unique>
</xs:element>
<xs:element name="array" type="n:array" />
</xs:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment