- From: Uwe Zeise <uwezeise@yahoo.de>
- Date: Thu, 24 May 2001 13:11:32 +0200
- To: <www-xml-schema-comments@w3.org>
- Message-ID: <001401c0e442$4afc5840$51b450d9@compaq>
Hi folks,
How can I achieve via "unique" that the element "id" is unique within the whole document ?
<root>
<postition>
<id>100</id>
</postition>
<postion>
<id>101</id>
</postion>
<anotherpostion>
<dummy>
<id>102</id>
</dummy>
</anotherposition>
</root>
XML-Schema:
<element name="root">
<complexType>
<sequence>
<element name="postion" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="id" type="positiveInteger"/>
</sequence>
</complexType>
</element>
<element name="anotherposition" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="dummy">
<complexType>
<sequence>
<element name="id" type="positiveInteger"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
<unique name="idMustBeUnique">
<selector xpath=".//id"/> <------------- Is that one correct ?
<field xpath="."/>
</unique>
</element>
Thanks in advance for an answer,
Regards, Uwe.
Received on Thursday, 24 May 2001 07:11:53 UTC