Hello everyone,
I am using the following schema to check the following XML file. And I find when there is more than one Information elements inside People elements, the schema check will fail. Why and how to fix it (I want to allow People element to be able to nest more than one Information items)?
XML Schema file:
<xs:element name="People">
<xs:complexType>
<xs:sequence>
<xs:element name="Information">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
</xs:sequence>
<xs:attribute name="Id" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
XML file (schema check will fail):
<People>
<Information Id="1">
<Name>John</Name>
</Information>
<Information Id="2">
<Name>Mike</Name>
</Information>
</People>
XML file (schema check will success):
<People>
<Information Id="1">
<Name>John</Name>
</Information>
</People>
thanks in advance, George