| <?xml version="1.0" encoding="UTF-8"?> |
| <?xml version="1.0" encoding="UTF-8"?> |
| <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2013/XSL/json" xmlns:j="http://www.w3.org/2013/XSL/json"> |
| <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2013/XSL/json" xmlns:j="http://www.w3.org/2013/XSL/json"> |
| |
| |
| <!-- |
| <!-- |
| * This is a schema for the XML representation of JSON used as the target for the |
| * This is a schema for the XML representation of JSON used as the target for the |
| * XSLT 3.0 function fn:json-to-xml() |
| * XSLT 3.0 function fn:json-to-xml() |
| * |
| * |
| * The schema is made available under the terms of the W3C software notice and license |
| * The schema is made available under the terms of the W3C software notice and license |
| * at http://www.w3.org/Consortium/Legal/copyright-software-19980720 |
| * at http://www.w3.org/Consortium/Legal/copyright-software-19980720 |
| * |
| * |
| --> |
| --> |
| |
| |
| <xs:element name="map" type="j:mapType"> |
| <xs:element name="map" type="j:mapType"> |
| <xs:unique name="unique-key"> |
| <xs:unique name="unique-key"> |
| <xs:selector xpath="*"/> |
| <xs:selector xpath="*"/> |
| <xs:field xpath="@key"/> |
| <xs:field xpath="@key"/> |
| </xs:unique> |
| </xs:unique> |
| </xs:element> |
| </xs:element> |
| |
| |
| <xs:element name="array" type="j:arrayType"/> |
| <xs:element name="array" type="j:arrayType"/> |
| |
| |
| <xs:element name="string" type="j:stringType"/> |
| <xs:element name="string" type="j:stringType"/> |
| |
| |
| <xs:element name="number" type="j:numberType"/> |
| <xs:element name="number" type="j:numberType"/> |
| |
| |
| <xs:element name="boolean" type="xs:boolean"/> |
| <xs:element name="boolean" type="xs:boolean"/> |
| |
| |
| <xs:element name="null" type="j:nullType"/> |
| <xs:element name="null" type="j:nullType"/> |
| |
| |
| <xs:complexType name="nullType"> |
| <xs:complexType name="nullType"> |
| <xs:sequence/> |
| <xs:sequence/> |
| </xs:complexType> |
| </xs:complexType> |
| |
| |
| <xs:complexType name="stringType"> |
| <xs:complexType name="stringType"> |
| <xs:simpleContent> |
| <xs:simpleContent> |
| <xs:extension base="xs:string"> |
| <xs:extension base="xs:string"> |
| <xs:attribute name="escaped" type="xs:boolean" use="optional" default="false"/> |
| <xs:attribute name="escaped" type="xs:boolean" use="optional" default="false"/> |
| </xs:extension> |
| </xs:extension> |
| </xs:simpleContent> |
| </xs:simpleContent> |
| </xs:complexType> |
| </xs:complexType> |
| |
| |
| <xs:simpleType name="numberType"> |
| <xs:simpleType name="numberType"> |
| <xs:restriction base="xs:double"> |
| <xs:restriction base="xs:double"> |
| <!-- exclude positive and negative infinity, and NaN --> |
| <!-- exclude positive and negative infinity, and NaN --> |
| <xs:minExclusive value="-INF"/> |
| <xs:minExclusive value="-INF"/> |
| <xs:maxExclusive value="INF"/> |
| <xs:maxExclusive value="INF"/> |
| </xs:restriction> |
| </xs:restriction> |
| </xs:simpleType> |
| </xs:simpleType> |
| |
| |
| <xs:complexType name="arrayType"> |
| <xs:complexType name="arrayType"> |
| <xs:choice minOccurs="0" maxOccurs="unbounded"> |
| <xs:choice minOccurs="0" maxOccurs="unbounded"> |
| <xs:element ref="j:map"/> |
| <xs:element ref="j:map"/> |
| <xs:element ref="j:array"/> |
| <xs:element ref="j:array"/> |
| <xs:element ref="j:string"/> |
| <xs:element ref="j:string"/> |
| <xs:element ref="j:number"/> |
| <xs:element ref="j:number"/> |
| <xs:element ref="j:boolean"/> |
| <xs:element ref="j:boolean"/> |
| <xs:element ref="j:null"/> |
| <xs:element ref="j:null"/> |
| |
| <xs:element ref="j:other"/>
|
| </xs:choice> |
| </xs:choice> |
| </xs:complexType> |
| </xs:complexType> |
| |
| |
| <xs:complexType name="mapType"> |
| <xs:complexType name="mapType"> |
| <xs:choice minOccurs="0" maxOccurs="unbounded"> |
| <xs:choice minOccurs="0" maxOccurs="unbounded"> |
| <xs:element name="map"> |
| <xs:element name="map"> |
| <xs:complexType> |
| <xs:complexType> |
| <xs:complexContent> |
| <xs:complexContent> |
| <xs:extension base="j:mapType"> |
| <xs:extension base="j:mapType"> |
| <xs:attribute name="key" type="xs:string"/> |
| <xs:attribute name="key" type="xs:string"/> |
| </xs:extension> |
| </xs:extension> |
| </xs:complexContent> |
| </xs:complexContent> |
| </xs:complexType> |
| </xs:complexType> |
| <xs:unique name="unique-key-2"> |
| <xs:unique name="unique-key-2"> |
| <xs:selector xpath="*"/> |
| <xs:selector xpath="*"/> |
| <xs:field xpath="@key"/> |
| <xs:field xpath="@key"/> |
| </xs:unique> |
| </xs:unique> |
| </xs:element> |
| </xs:element> |
| <xs:element name="array"> |
| <xs:element name="array"> |
| <xs:complexType> |
| <xs:complexType> |
| <xs:complexContent> |
| <xs:complexContent> |
| <xs:extension base="j:arrayType"> |
| <xs:extension base="j:arrayType"> |
| <xs:attributeGroup ref="j:key-group"/> |
| <xs:attributeGroup ref="j:key-group"/> |
| </xs:extension> |
| </xs:extension> |
| </xs:complexContent> |
| </xs:complexContent> |
| </xs:complexType> |
| </xs:complexType> |
| </xs:element> |
| </xs:element> |
| <xs:element name="string"> |
| <xs:element name="string"> |
| <xs:complexType> |
| <xs:complexType> |
| <xs:simpleContent> |
| <xs:simpleContent> |
| <xs:extension base="j:stringType"> |
| <xs:extension base="j:stringType"> |
| <xs:attributeGroup ref="j:key-group"/> |
| <xs:attributeGroup ref="j:key-group"/> |
| </xs:extension> |
| </xs:extension> |
| </xs:simpleContent> |
| </xs:simpleContent> |
| </xs:complexType> |
| </xs:complexType> |
| </xs:element> |
| </xs:element> |
| <xs:element name="number"> |
| <xs:element name="number"> |
| <xs:complexType> |
| <xs:complexType> |
| <xs:simpleContent> |
| <xs:simpleContent> |
| <xs:extension base="j:numberType"> |
| <xs:extension base="j:numberType"> |
| <xs:attributeGroup ref="j:key-group"/> |
| <xs:attributeGroup ref="j:key-group"/> |
| </xs:extension> |
| </xs:extension> |
| </xs:simpleContent> |
| </xs:simpleContent> |
| </xs:complexType> |
| </xs:complexType> |
| </xs:element> |
| </xs:element> |
| <xs:element name="boolean"> |
| <xs:element name="boolean"> |
| <xs:complexType> |
| <xs:complexType> |
| <xs:simpleContent> |
| <xs:simpleContent> |
| <xs:extension base="xs:boolean"> |
| <xs:extension base="xs:boolean"> |
| <xs:attributeGroup ref="j:key-group"/> |
| <xs:attributeGroup ref="j:key-group"/> |
| </xs:extension> |
| </xs:extension> |
| </xs:simpleContent> |
| </xs:simpleContent> |
| </xs:complexType> |
| </xs:complexType> |
| </xs:element> |
| </xs:element> |
| <xs:element name="null"> |
| <xs:element name="null"> |
| <xs:complexType> |
| <xs:complexType> |
| <xs:attributeGroup ref="j:key-group"/> |
| <xs:attributeGroup ref="j:key-group"/> |
| </xs:complexType> |
| </xs:complexType> |
| </xs:element> |
| </xs:element> |
| |
| <xs:element name="other">
|
| |
| <xs:complexType>
|
| |
| <xs:complexContent>
|
| |
| <xs:extension base="j:otherType">
|
| |
| <xs:attributeGroup ref="j:key-group"/>
|
| |
| </xs:extension>
|
| |
| </xs:complexContent>
|
| |
| </xs:complexType>
|
| |
| </xs:element>
|
| </xs:choice> |
| </xs:choice> |
| </xs:complexType> |
| </xs:complexType> |
| |
| |
| <xs:attributeGroup name="key-group"> |
| <xs:attributeGroup name="key-group"> |
| <xs:attribute name="key" type="xs:string"/> |
| <xs:attribute name="key" type="xs:string"/> |
| <xs:attribute name="escaped-key" type="xs:boolean" use="optional" default="false"/> |
| <xs:attribute name="escaped-key" type="xs:boolean" use="optional" default="false"/> |
| </xs:attributeGroup> |
| </xs:attributeGroup> |
| |
|
|
| |
|
|
| |
| <xs:element name="other" type="j:otherType"/>
|
| |
|
|
| |
| <xs:complexType name="otherType">
|
| |
| <xs:choice>
|
| |
| <!-- useful types such as binary and integer -->
|
| |
| <xs:element name="base64Binary">
|
| |
| <xs:simpleType>
|
| |
| <xs:restriction base="xs:base64Binary"/>
|
| |
| </xs:simpleType>
|
| |
| </xs:element>
|
| |
| <xs:element name="dateTime">
|
| |
| <xs:simpleType>
|
| |
| <xs:restriction base="xs:dateTime"/>
|
| |
| </xs:simpleType>
|
| |
| </xs:element>
|
| |
| <xs:element name="time">
|
| |
| <xs:simpleType>
|
| |
| <xs:restriction base="xs:time"/>
|
| |
| </xs:simpleType>
|
| |
| </xs:element>
|
| |
| <xs:element name="date">
|
| |
| <xs:simpleType>
|
| |
| <xs:restriction base="xs:date"/>
|
| |
| </xs:simpleType>
|
| |
| </xs:element>
|
| |
| <xs:element name="decimal">
|
| |
| <xs:simpleType>
|
| |
| <xs:restriction base="xs:decimal"/>
|
| |
| </xs:simpleType>
|
| |
| </xs:element>
|
| |
| <xs:element name="integer">
|
| |
| <xs:simpleType>
|
| |
| <xs:restriction base="xs:integer"/>
|
| |
| </xs:simpleType>
|
| |
| </xs:element>
|
| |
| <xs:element name="unsignedInteger">
|
| |
| <xs:simpleType>
|
| |
| <xs:restriction base="xs:nonNegativeInteger"/>
|
| |
| </xs:simpleType>
|
| |
| </xs:element>
|
| |
| <!-- TBD use these selected types or add more types by appending or nesting in another sub-element e.g., <lessCommon> -->
|
| |
| </xs:choice>
|
| |
| </xs:complexType>
|
| |
| |
| </xs:schema> |
| </xs:schema> |