में
mm:Depot
और
mm:Customer/mm:County
में मान समान है और
Location
प्रकार में आइटमों तक सीमित है।
यह <assert>
टैग का उपयोग कर एक्सएमएल स्कीमा 1.1 में किया जा सकता है लेकिन मुझे एक्सएमएल स्कीमा 1.0 के खिलाफ मान्य होना चाहिए। क्या यह काम 1.0 में करने के लिए कुछ साफ चाल है?
<xsd:element name="DeliveryOrder" type="OrderDetails" />
<xsd:complexType name="OrderDetails">
<xsd:sequence>
<xsd:element name="Depot" type="mm:Location" />
<xsd:element name="Customer" type="mm:Customer" maxOccurs="1" minOccurs="1" />
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="Location">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="OverHere" />
<xsd:enumeration value="OverThere" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="Customer">
<xsd:sequence>
<xsd:element name="firstname" type="string" />
<xsd:element name="surname" type="string" />
<xsd:element name="County" type="mm:Location" />
</xsd:sequence>
</xsd:complexType>
क्या मैं हासिल करना चाहते हैं कुछ इस तरह है ...
<?xml version="1.0" encoding="UTF-8"?>
<mm:DeliveryOrder xmlns:mm="http://myNamespace/DeliveryOrderSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://myNamespace/DeliveryOrderSchema DeliveryOrder.xsd ">
<mm:Depot>OverThere</mm:Depot>
<mm:Customer>
<mm:firstname>Jane</mm:firstname>
<mm:surname>Doe</mm:surname>
<mm:County>OverThere</mm:County>
</mm:Customer>
</mm:DeliveryOrder>
नोट मूल्य OverThere
दो बार प्रकट होता है।