xml-schema:Uniqueness attributes of differend elements

T

thijs.kupers

Hi

I want to define a schema for my xml. I want to transform the xml in
java-code by xslt, so it is important (for naming conflicts) that the
values of the name-attributes in the xml been unique.

I have a xml file like this:

<someroot>
<A_Item name="foo">
<B_Item name="123"/>
<B_Item name="456"/>
</A_Item>
<B_Item name="foo"/>
</someroot>

The '<B_Item name="foo"/>' must give an error by the validator check.
How can I do that with xml-schema?

Regards,
Thijs
 
M

Martin Honnen

I have a xml file like this:

<someroot>
<A_Item name="foo">
<B_Item name="123"/>
<B_Item name="456"/>
</A_Item>
<B_Item name="foo"/>
</someroot>

The '<B_Item name="foo"/>' must give an error by the validator check.
How can I do that with xml-schema?

<xs:attribute name="name" type="xs:ID" />
 

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,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top