Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


choosing elements based on attribute values

From: dave <ceek63@-----.--->
To: xml-dev@-----.---.---
Date: 11/15/2007 4:11:00 AM
I use W3C schema 1.0. I need to make an element or set
of elements mandatory or optional based on the
attribute value as below:

<parent>
 <child age="10" sex="male">
    <property>
     <p1/>   
     <p2/>
     <p3/>
    <property>
    <property>
     <p1/>  //mandatory only if age=10, sex=male
     <p2/>
     <p3/>
    <property>
 </child>
 <child age="12" sex="female">
    <property>
     <p1/>   //mandatory only if age=10, sex=male
     <p2/>
     <p3/>
    <property>
 </child>
<parent>


How do I check the attribute values(age and sex) and
make element 'p1' mandatory or optional based on the
attr value?

I use w3c schema 1.0.

I downloaded the latest xmlspy. And it doesn't seem to
support XSD 1.1.

cheers!
dave




      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent