I am trying to understand example from w3 school about sequence element. I thought that element inside the sequence can show only once but example from w3 school lead me to believe otherwise. This is example...
<xs:element name="pets">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="dog" type="xs:string"/>
<xs:element name="cat" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
So explanation on w3 schools says that "This example shows a declaration for an element called "pets" that can have zero or more of the following elements, dog and cat, in the sequence element". I tried to test that by doing this....
sorry second example i pasted by mistake....this is what i meant that wil not validate based on schema from the top...
<pets>
<dog>something</dog>
<dog>something else</dog>
<cat>else</cat>
</pets>
But validator gives me errors http://www.corefiling.com/opensource/schemaValidate.html. I would like to understand both examples. Sequence where it is allowable to have multiple of same elements and also where each element in sequence must be present and must show once only.
any examples and suggestions would be appreciated.