conditional enumeration in XSD

K

kanpeter

How can i write in XSD such that it can validate the following XML:

If company element has text value = A, attributes of Price can take
USD and AUD only
If company element has text value = B, attributes of Price can take
USD and RMB only

<Company>A</Company>
<Prices>
<Price Currency="USD">12</Price>
<Price Currency="AUD">12</Price>
</Prices>

<Company>B</Company>
<Prices>
<Price Currency="USD">12</Price>
<Price Currency="RMB">12</Price>
</Prices>
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top