Skip to content

Instantly share code, notes, and snippets.

@asicfr
Created November 13, 2012 10:16
Show Gist options
  • Save asicfr/4065029 to your computer and use it in GitHub Desktop.
Save asicfr/4065029 to your computer and use it in GitHub Desktop.
ID et IDREF xsd
<xsd:schema attributeFormDefault="unqualified"
elementFormDefault="qualified" version="1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="delivery" type="deliveryType" />
<xsd:complexType name="deliveryType">
<xsd:sequence>
<xsd:element name="customer" type="CustomerType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="order" type="OrderType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CustomerType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" />
</xsd:complexType>
<xsd:complexType name="OrderType">
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="customerRef" type="xsd:IDREF"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment