Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > conditional enumeration in XSD

Reply
Thread Tools

conditional enumeration in XSD

 
 
kanpeter
Guest
Posts: n/a
 
      10-26-2010
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>
 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      10-26-2010
I don't believe XML Schemas can express that constraint. Implement it in
application code.

--
Joe Kesselman,
http://www.love-song-productions.com...lam/index.html

{} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
/\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re-using a simple type definition; with enumeration constraint andwithout enumeration constraint puvit82 XML 4 02-01-2008 03:46 PM
xsd enumeration and pattern news.emn.fr XML 0 05-31-2006 06:10 PM
XSD enumeration based on elements JamesSmithMz XML 0 11-30-2005 04:44 PM
? ELSE Conditional Comment / Using Conditional Comments Inside Other Tags To Comment Out Attributes Alec S. HTML 10 04-16-2005 02:21 AM
[xsd] Can the content of a mixed type be an enumeration? Fender Mussel XML 0 09-14-2004 01:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57