Appendix B - sdata.xsd
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="sdata"
targetNamespace="http://schemas.sage.com/sdata/2008/1"
elementFormDefault="qualified"
xmlns="http://schemas.sage.com/sdata/2008/1"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="1.1.0">
<xs:import namespace="http://www.w3.org/2001/XMLSchema" />
<!-- Element Definitions -->
<xs:element name="payload" type="any--type"/>
<xs:element name="diagnosis" type="diagnosis--type"/>
<xs:element name="diagnoses" type="diagnoses--type"/>
<xs:element name="tracking" type="tracking--type"/>
<xs:element name="schema" type="schema--type"/>
<!-- Attribute Definitions -->
<xs:attribute name="key" type="xs:string">
<xs:annotation>
<xs:documentation>The application's internal key for the resource</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="url" type="xs:anyURI">
<xs:annotation>
<xs:documentation>The resource or collection URL</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="uuid" type="uuid--type">
<xs:annotation>
<xs:documentation>The UUID of the resource</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="lookup" type="xs:anyURI">
<xs:annotation>
<xs:documentation>The URL to get a list of resource candidates for a relationship</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="descriptor" type="xs:string">
<xs:annotation>
<xs:documentation>A short human readable text for the resource</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="isDeleted" type="xs:boolean">
<xs:annotation>
<xs:documentation>Flag to mark deleted entries when updating a list</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="deleteMissing" type="xs:boolean">
<xs:annotation>
<xs:documentation>Flag to indicate if a list update payload contains the full list (true) or only a delta (false)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="index" type="xs:integer">
<xs:annotation>
<xs:documentation>Reserved for future use</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:complexType name="any--type">
<xs:sequence>
<xs:any/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="diagnosis--type">
<xs:all>
<xs:element name="severity" type="xs:string"/>
<xs:element name="sdataCode" type="xs:string"/>
<xs:element name="applicationCode" type="xs:string"/>
<xs:element name="message" type="xs:string"/>
<xs:element name="stackTrace" type="xs:string"/>
<xs:element name="payloadPath" type="xs:string"/>
</xs:all>
</xs:complexType>
<xs:complexType name="diagnoses--type">
<xs:sequence>
<xs:element name="diagnosis" type="diagnosis--type" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="tracking--type">
<xs:all>
<xs:element name="phase" type="xs:string"/>
<xs:element name="phaseDetail" type="xs:string"/>
<xs:element name="progress" type="xs:decimal"/>
<xs:element name="elapsedSeconds" type="xs:integer"/>
<xs:element name="remainingSeconds" type="xs:integer"/>
<xs:element name="pollingMillis" type="xs:integer"/>
</xs:all>
</xs:complexType>
<xs:complexType name="schema--type">
<xs:sequence>
<!-- minOccurs should not be set to 0
but for some strange reason Visual Studio seems to ignore the embedded schema
and gives a validation error if this attribute is not set to 0 -->
<xs:element ref="xs:schema" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="uuid--type">
<xs:restriction base="xs:string">
<xs:pattern value ="[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>