cusebassman
Programmer
Sorry if this has been covered, but I cannot find info on it to save my life. I am, generically, dealing with the following schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="
<xs:complexType name="base1">
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="name" type="xs:string"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="base">
<xs:complexContent>
<xs:extension base="base1">
<xs:all>
<xs:element name="first"/>
<xs:element name="second"/>
<xs:element name="third"/>
</xs:all>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="specificType1">
<xs:complexType>
<xs:complexContent>
<xs:extension base="base">
<xs:all>
<xs:element ref="item1" minOccurs="0" maxOccurs="1"/>
<xs:element ref="item2" minOccurs="0" maxOccurs="1"/>
<xs:element ref="item3" minOccurs="0" maxOccurs="1"/>
<xs:element ref="item4" minOccurs="0" maxOccurs="1"/>
</xs:all>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:schema>
This yields an error saying that:
"SystemID: ____ /Untitled2.xsd
Location: 28:22
Description: cos-all-limited.1.2: An all model group must appear in a particle with {min occurs} = {max occurs} = 1, and that particle must be part of a pair which constitutes the {content type} of a complex type definition.
URL:
I am knew to schemas, so this may very well be extremely wrong. What I need to be able to do is use the "all" tag since the xml I am validating with this schema has to NOT care about order of information, but there are going to be multiple "specificType#" items that all need to use that "base" as an extension.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="
<xs:complexType name="base1">
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:attribute name="name" type="xs:string"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="base">
<xs:complexContent>
<xs:extension base="base1">
<xs:all>
<xs:element name="first"/>
<xs:element name="second"/>
<xs:element name="third"/>
</xs:all>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="specificType1">
<xs:complexType>
<xs:complexContent>
<xs:extension base="base">
<xs:all>
<xs:element ref="item1" minOccurs="0" maxOccurs="1"/>
<xs:element ref="item2" minOccurs="0" maxOccurs="1"/>
<xs:element ref="item3" minOccurs="0" maxOccurs="1"/>
<xs:element ref="item4" minOccurs="0" maxOccurs="1"/>
</xs:all>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:schema>
This yields an error saying that:
"SystemID: ____ /Untitled2.xsd
Location: 28:22
Description: cos-all-limited.1.2: An all model group must appear in a particle with {min occurs} = {max occurs} = 1, and that particle must be part of a pair which constitutes the {content type} of a complex type definition.
URL:
I am knew to schemas, so this may very well be extremely wrong. What I need to be able to do is use the "all" tag since the xml I am validating with this schema has to NOT care about order of information, but there are going to be multiple "specificType#" items that all need to use that "base" as an extension.