Suppose I have the following XSD file :
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="PACIDemoSignedDoc" type="PACIDemoSignedDocType" />
<xs:complexType name="PACIDemoSignedDocType">
<xs:all>
<xs:element name="OwnerEnglishName" type="OwnerEnglishNameType" />
</xs:all>
</xs:complexType>
<xs:complexType name="OwnerEnglishNameType">
<xs:simpleContent>
<xs:restriction base="NameType">
<xs:enumeration value="John"/>
<xs:enumeration value="Jack"/>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="NameType">
<xs:simpleContent>
<xs:extension base="xs:string"/>
</xs:simpleContent>
</xs:complexType>
</xs:schema>
My question is, where should I add the attributes minOccurs and maxOccurs for the element "OwnerEnglishName" ? I want to keep xs:all as I want to avoid having to order my XML file in sequence but it prohibits me from adding the Occurs directly in the <xs:element name="OwnerEnglishName" type="OwnerEnglishNameType" />
line...
I'm also guessing I can't add the Occur attributes inside OwnerEnglishNameType, anyone have any idea ?