I need to verify the presence a list of children of an XML element, but I also need to allow one of the child elements to be any other element.
For example, if the XML is like this :
<fruits>
<item1>banana</item1>
<item2>apple </item2>
<anything>yolo</anything>
</fruits>
And with an XSD like this :
<xsd:complexType name="fruits">
<xsd:all>
<xsd:element name="item1" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="item2" type="xsd:string" minOccurs="1" maxOccurs="1" />
</xsd:all>
</xsd:complexType>
I would like this xml file to be ok at the verification. But with my xsd file, i get an error like this :
The element 'fruits' has invalid child element 'anything'.
Do you have any advice ?