Relax-NG: grouping node

Be carreful:

<optional>
<element name="node1"><text/></element>
<element name="node2"><text/></element>
</optional>

is not the same as

<optional>
<element name="node1"><text/></element>
</optional>
<optional>
<element name="node2"><text/></element>
</optional>

First code portion means that <node1> and <node2> elements must either be both present or none (ie. we cannot have one without having the other) while second code portion means that <node1> is optional and <node2> is optional too independently one from another, ie. we can have one but not the other.

Post a Comment

Your email is never published nor shared. You're allow to say what you want...