Found this interesting post: How to make type depend on attribute value using Conditional Type Assignment
However, can conditional type assignment depend on a node value rather than an attribute?
<listOfA>
<a>
<type>1</type>
<name></name>
<surname></surname>
</a>
<a>
<type>2</type>
<name></name>
<id></id>
</a>
</listOfA>
I'd like to make an XSD, so that if the value of node "type" is 1, the name and surname elements must be present, and when it's 2, name and id must be there...
Note: I know using an attribute would be better here, but I need to write an XSD for an legacy XML format I cannot change...