XSD file for validating XML data
2 answers
This is not very fast if you have many a or b nodes , but it is confirmed by what you described.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="test">
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element name="a"/>
<xs:element name="b"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
+1
source to share
If you are pasting the XML sample, we can help you better. However, Microsoft has an XSD code generator that generates an XSD based on the XML file that you pass as an argument.
0
source to share