|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
XML schema question about conditions
Hi XML wizards,
Is it possible to make elements in an XML schema mandatory depending on the attribute value in a previous element? For example if an attribute in the root element has value '+' then element <add> is mandatory but element <sub> must not occur in the XML file. However if the attribute has value '-' element <sub> is mandatory but <add> must not occur in the XML file. Best regards, HKaste |
|
#2
|
||||
|
||||
|
At the moment you can't do this with XML schema alone. You can check that there's only <add> or <sub>, but you can't "prohibit" one or the other. With XML schema 1.1 this will change though.
-Miska- P.S. For more FAQ's on XML schema check this link out: http://www.schemavalid.com/faq/xml-schema.html |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XML schema question about conditions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|