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>
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>