Tell me please, how can I create xsd schema, which successfully validate the following xml:
Valid XML 1
Try this, it works:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="start">
<xs:complexType>
<xs:sequence>
<xs:element name="list" type="list"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="list">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="typeA" type="generic" />
<xs:element name="typeB" type="generic" />
<xs:element name="typeC" type="generic" />
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="generic">
<xs:sequence>
<xs:element name="value" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>