MORE INFORMATION
XSD: Undeclared XSD Type: '{http://www.w3.org/2001/XMLSchema}anySimpleType'
The October 2001 RTM version of MSXML 4.0 does not implement
anySimpleType. If you use the following schema
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="root" type="myType"/>
<xsd:simpleType name="myType">
<xsd:restriction base="xsd:anySimpleType"/>
</xsd:simpleType>
</xsd:schema>
you receive the following compilation error message:
Undeclared XSD type : '{http://www.w3.org/2001/XMLSchema}anySimpleType'.
back to the top
XSD: Particle Derivation by Restriction of 'Choice' {1,1} to {0,1} Does Not Generate Error
When you compile the following schema with the October 2001 RTM version of MSXML 4.0, you do not receive an error message:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="restrictionType">
<xs:sequence>
<xs:element name="f"/>
<xs:choice>
<xs:choice minOccurs="1">
<xs:element name="a"/>
<xs:element name="b"/>
</xs:choice>
<xs:sequence minOccurs="0">
<xs:element name="a1"/>
<xs:element name="b1"/>
</xs:sequence>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="complexRestrictionType">
<xs:complexContent>
<xs:restriction base="restrictionType">
<xs:sequence>
<xs:element name="f"/>
<xs:choice minOccurs="0">
<xs:element name="a"/>
<xs:element name="b"/>
</xs:choice>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:schema>
You expect to receive the following error message:
Invalid particle derivation by restriction.
back to the top
XSD: Processcontents for Default Complextype Is Not Strict
When you use the October 2001 RTM version of MSXML 4.0 to validate the following XML data against the following XSD schema, you do not receive an error message, even though the XML is not valid:
<a:root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="ns-a t.xsd"
xmlns:a="ns-a"
xmlns:b="ns-b"
>
<b:abc/>
</a:root>
XSD schema file:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="ns-a"
xmlns:a="ns-a"
elementFormDefault="unqualified"
>
<xs:complexType name="testType">
<xs:choice minOccurs="1">
<xs:element name="a" type="xs:string"/>
<xs:element ref="a:aft"/>
</xs:choice>
</xs:complexType>
<xs:element name="aft" type="a:ns-a-aft" abstract="true"/>
<xs:complexType name="ns-a-aft">
<xs:sequence minOccurs="1">
<xs:element name="x" type="xs:string" maxOccurs="10"/>
<xs:element name="y" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:element name="root" />
</xs:schema>
The
root element is defined as <xs:element name="root" /> (that is, as an ur-type), and the default
processContents property of an
<any> element is strict according to the XSD (XML Schema) specification. However, although the
root element in the XML data contains a
b:abc element that makes the content of the
root element not valid according to the XSD specification, the MSXML parser does not report an error on this element.
back to the top
XSD: Validation Not Successful When Imported and Importing XSDs Are Both Added to Schema Collection
The following XML data references both Test1.xsd and Test2.xsd:
<a:root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="ns-a test1.xsd ns-b test2.xsd"
xmlns:a="ns-a" xmlns:b="ns-b">
<b:abc>
<x/>
<x/>
</b:abc>
</a:root>
Test1.xsd is as follows:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="ns-a"
xmlns="ns-a"
xmlns:a="ns-a"
elementFormDefault="unqualified">
<xs:complexType name="testType">
<xs:choice minOccurs="1">
<xs:element name="a" type="xs:string"/>
<xs:element ref="aft"/>
</xs:choice>
</xs:complexType>
<xs:element name="aft" type="ns-a-aft" abstract="true"/>
<xs:complexType name="ns-a-aft">
<xs:sequence minOccurs="1">
<xs:element name="x" type="xs:string" maxOccurs="10"/>
<xs:element name="y" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:element name="root" type="a:testType"/>
</xs:schema>
Test2.xsd imports Test1.xsd, as follows:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="ns-b"
xmlns="ns-b"
xmlns:a="ns-a"
elementFormDefault="unqualified" >
<xs:import namespace="ns-a" schemaLocation="test1.xsd"/>
<xs:element name="abc" type="myType" substitutionGroup="a:aft"/>
<xs:complexType name="myType">
<xs:complexContent>
<xs:restriction base="a:ns-a-aft">
<xs:sequence minOccurs="1">
<xs:element name="x" type="xs:string" maxOccurs="2"/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:schema>
When you load the XML file in the MSXML parser, both schemas are added to the schema cache. With the October 2001 RTM version of the MSXML 4.0 parser, the validation is not successful, and you receive the following error message:
Element content is invalid according to the DTD/Schema.
Expecting: a, {ns-a}aft.
back to the top
XSD: Self-Referencing of Model Group Is Not Permitted in Redefine Element
The following Test.xsd XSD schema file both refines "group" (as defined in Test1.xsd) and references itself:
<?xml version="1.0" encoding="UTF-8"?>
<!--
test with redefinition with self-reference.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="testnamespace" xmlns="testnamespace"
elementFormDefault="qualified">
<xsd:redefine schemaLocation="test1.xsd">
<xsd:simpleType name="simpleType">
<xsd:restriction base="simpleType">
<xsd:enumeration value="yes" />
<xsd:enumeration value="no" />
</xsd:restriction>
</xsd:simpleType>
<xsd:group name="group">
<xsd:sequence>
<xsd:group ref="group" />
<xsd:element name="in" />
<xsd:element name="out" />
</xsd:sequence>
</xsd:group>
<xsd:complexType name="complexType">
<xsd:complexContent>
<xsd:extension base="complexType">
<xsd:sequence>
<xsd:element name="tail" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:attributeGroup name="attGroup">
<xsd:attributeGroup ref="attGroup" />
<xsd:attribute name="add" use="optional" type="xsd:decimal" />
</xsd:attributeGroup>
</xsd:redefine>
</xsd:schema>
The following is the code listing for Test1.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<!--
The definition in this file will be redefined.
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="testnamespace" xmlns="testnamespace"
elementFormDefault="qualified">
<xsd:simpleType name="simpleType">
<xsd:restriction base="xsd:string" />
</xsd:simpleType>
<xsd:element name="root" type="complexType" />
<xsd:attribute name="gAtt" type="simpleType" />
<xsd:group name="group">
<xsd:sequence>
<xsd:element ref="root" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:group>
<xsd:complexType name="complexType">
<xsd:group ref="group" />
<xsd:attributeGroup ref="attGroup" />
</xsd:complexType>
<xsd:attributeGroup name="attGroup">
<xsd:attribute ref="gAtt" use="optional" />
</xsd:attributeGroup>
</xsd:schema>
With the October 2001 RTM version of MSXML 4.0, Test.xsd generates the following error message:
Circular <group> reference is not allowed, '{testnamespace}group'.
back to the top
XSD: "xsd:any" Element with processContents=strict Does Not Permit a Valid Content Item with xsi:type
According to the XSD specification, the following XML data
<test
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation='test.xsd' >
<a/>
<b xsi:type="xsd:string">abc</b>
<c xsi:type="xsd:int">123</c>
</test>
is valid against following Test.xsd XSD schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="testType">
<xsd:sequence>
<xsd:element name="a" />
<xsd:any namespace="##any" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="test" type="testType"/>
</xsd:schema>
With the October 2001 RTM version of MSXML 4.0, the XML data generates the following validation error message:
Type '{http://www.w3.org/2001/XMLSchema}string' is not found in Schema
back to the top
XSD: id Attribute Is Not Permitted on redefine Element
With the October 2001 RTM version of MSXML 4.0, the following line in an XSD schema file
<xsd:redefine id="a1" schemaLocation="schH1_b.xsd">
generates the following error message:
The attribute "id" is not supported on the declaration xsd:redefine.
back to the top