Is there any way to restrict the use of an XML element's sub elements, depending on the attribute value of the parent element in XML Schema? How does the schema have to look like?
<option name="mike" value="excset">
<excludingsets>
<excludingset>
<option name="hd"/>
</excludingset>
</excludingsets>
</option>
<option name="mike" value="args">
<arguments>
<argument name="kjk" validatortype="regex">
<regex value="dkas"/>
</argument>
</arguments>
</option>
As you can see in this example, the element <excludingset>
should only be valid if the attribute value of <option>
is value="excset"
, and the element <arguments>
if it has value="args"
.
Thanks in advance.