force uniqueness with xml schema

R

Robert Ludewig

<LinkList>
<Link ID="A01" />
<Link ID="A02" />
<Link ID="A03" />
<Link ID="A01" />
</LinkList>

How can I specify in a xmlschema that in the linklist are no occurences with
same ID ?
(Last Link is illegal)
 
C

Cat

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

<LinkList>
<Link ID="A01" />
<Link ID="A02" />
<Link ID="A03" />
<Link ID="A01" />
</LinkList>

How can I specify in a xmlschema that in the linklist are no occurences with
same ID ?
(Last Link is illegal)
You can use the xs:ID simple type which won't validate for the above example

============= EXAMPLE ===============================

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="LinkList">
<xs:complexType>
<xs:sequence>
<xs:element name="Link" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="ID" type="xs:ID"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>
- --
Cat

http://www.ratrobot.com/writing/ms/ Wanted Java Developer please email your
resume. Microsoft Word format only. You can't escape Microsoft's empire.
But will breaking it up be enough?
Tue Jun 29 20:59:59 UTC 2004
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA4dhPKHRjYtwQ1QARAs+7AKDB084W80AdW/7pAX+Cczj44+Bb5wCdEG5d
PUVb4vv0uMD8YjyW6MCiU5Y=
=3IQr
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top