Xml Schema question
-
When defining an XML Schema, is it possible to specify that an attribute is required when another is set to a certain value? For example, if the type attribute of my server element is set to DMZ, then the username and password attributes of the deploy element must be set as well. Is this possible, or do I just have to enforce it in the code library that consumes the xml file? Thanks.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan Portland, Oregon, USA
www.defaultn.com -
When defining an XML Schema, is it possible to specify that an attribute is required when another is set to a certain value? For example, if the type attribute of my server element is set to DMZ, then the username and password attributes of the deploy element must be set as well. Is this possible, or do I just have to enforce it in the code library that consumes the xml file? Thanks.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan Portland, Oregon, USA
www.defaultn.comSorry, that is not possible.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
-
Sorry, that is not possible.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
Crap. That's what I was thinking, but I was hoping someone would tell me that I was wrong. :cool: It'd be nice, though. :) Something like:
<xs:attribute name="UserName" use="Conditional" test="some/xpath/@value=dmz"/>
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan Portland, Oregon, USA
www.defaultn.com