Validation of attributes using XML Schema

  • Thread starter =?ISO-8859-1?Q?Patr=EDcia_Martins?=
  • Start date
?

=?ISO-8859-1?Q?Patr=EDcia_Martins?=

Hi,

I would like to know if it's possible to validate attributes in a
situation like this:

<TUPLE>
<LIST type="type1">Bla</LIST>
<LIST type="type2">Ble</LIST>
<ATOM type="type3">Bli</ATOM>
</TUPLE>

I need that the nested elements under <TUPLE> have different values
for the attribute type, even considering distinct elements. So, I
can't have a document like this:

<TUPLE>
<LIST type="type1">Bla</LIST>
<LIST type="type1">Ble</LIST> <---- repeated type nested under
<TUPLE>
<ATOM type="type3">Bli</ATOM>
</TUPLE>

Please, help me !

Thanks in advance,
Patrícia Martins
 
H

Henry S. Thompson

I need that the nested elements under <TUPLE> have different values
for the attribute type, even considering distinct elements. So, I
can't have a document like this:

<TUPLE>
<LIST type="type1">Bla</LIST>
<LIST type="type1">Ble</LIST> <---- repeated type nested under
<TUPLE>
<ATOM type="type3">Bli</ATOM>
</TUPLE>

The key and unique identity constraint features of W3C XML Schema
should do what you want. See the W3C XML Schema Primer [1] for a
tutorial introduction.

ht

[1] http://www.w3.org/TR/2004/PER-xmlschema-0-20040318/#specifyingUniqueness
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 

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,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top