I believe XSD 1.1 has asserts that allows conditional logic.
I have a schema like this:
<xs:element minOccurs="0" maxOccurs="1" name="Type" type="xs:integer" />
<xs:element minOccurs="0" maxOccurs="1" name="Comment" type="xs:string" />
I want the Comment
section to be mandatory only if the Type
is 0. If Type
is anything else, I want the Comment
element to be optional.
How do I achieve this using asserts?