Microsoft KB Archive/318886

= INFO: List of Issues Fixed in Microsoft XML 4.0 Service Pack 1 (Part 1 of 4) =

Article ID: 318886

Article Last Modified on 4/16/2002

-

APPLIES TO


 * Microsoft XML Core Services 4.0
 * Microsoft XML Core Services 4.0 Service Pack 1

-



This article was previously published under Q318886



SUMMARY
This article is part 1 of 4 in the series of articles that document the bugs that are fixed in MSXML 4.0 Service Pack 1 (SP1).

To download MSXML 4.0 SP1, see the following Microsoft Developer Network (MSDN) Web site:

http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/766/msdncompositedoc.xml

The following bugs related to XML Schema (XSD) have been fixed in MSXML 4.0 SP1:
 * XSD: Undeclared XSD Type: '{http://www.w3.org/2001/XMLSchema}anySimpleType'


 * XSD: Particle Derivation by Restriction of 'Choice' {1,1} to {0,1} Does Not Generate Error


 * XSD: Processcontents for Default Complextype Is Not Strict


 * XSD: Validation Not Successful When Imported and Importing XSDs Are Both Added to Schema Collection


 * XSD: Self-Referencing of Model Group Is Not Permitted in Redefine Element


 * XSD: &quot;xsd:any&quot; Element with processContents=strict Does Not Permit a Valid Content Item with xsi:type


 * XSD: id Attribute Is Not Permitted on redefine Element



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       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:element name=&quot;b&quot;/> </xs:choice> <xs:sequence minOccurs=&quot;0&quot;> <xs:element name=&quot;a1&quot;/> <xs:element name=&quot;b1&quot;/> </xs:sequence> </xs:choice> </xs:sequence> </xs:complexType>

<xs:complexType name=&quot;complexRestrictionType&quot;> <xs:complexContent> <xs:restriction base=&quot;restrictionType&quot;> <xs:sequence> <xs:element name=&quot;f&quot;/> <xs:choice minOccurs=&quot;0&quot;> <xs:element name=&quot;a&quot;/> <xs:element name=&quot;b&quot;/> </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=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;ns-a t.xsd&quot; xmlns:a=&quot;ns-a&quot; xmlns:b=&quot;ns-b&quot; >   <b:abc/>

</a:root> XSD schema file: <xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; targetNamespace=&quot;ns-a&quot; xmlns:a=&quot;ns-a&quot; elementFormDefault=&quot;unqualified&quot; >

<xs:complexType name=&quot;testType&quot;> <xs:choice minOccurs=&quot;1&quot;> <xs:element name=&quot;a&quot; type=&quot;xs:string&quot;/> <xs:element ref=&quot;a:aft&quot;/> </xs:choice> </xs:complexType>

<xs:element name=&quot;aft&quot; type=&quot;a:ns-a-aft&quot; abstract=&quot;true&quot;/>

<xs:complexType name=&quot;ns-a-aft&quot;> <xs:sequence minOccurs=&quot;1&quot;> <xs:element name=&quot;x&quot; type=&quot;xs:string&quot; maxOccurs=&quot;10&quot;/> <xs:element name=&quot;y&quot; minOccurs=&quot;0&quot;/> </xs:sequence> </xs:complexType> <xs:element name=&quot;root&quot; />

</xs:schema>

The root element is defined as <xs:element name=&quot;root&quot; /> (that is, as an ur-type), and the default processContents property of an   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=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;ns-a test1.xsd ns-b test2.xsd&quot; xmlns:a=&quot;ns-a&quot; xmlns:b=&quot;ns-b&quot;> <b:abc> <x/> <x/> </b:abc>

</a:root> Test1.xsd is as follows: <xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; targetNamespace=&quot;ns-a&quot; xmlns=&quot;ns-a&quot; xmlns:a=&quot;ns-a&quot; elementFormDefault=&quot;unqualified&quot;>

<xs:complexType name=&quot;testType&quot;> <xs:choice minOccurs=&quot;1&quot;> <xs:element name=&quot;a&quot; type=&quot;xs:string&quot;/> <xs:element ref=&quot;aft&quot;/> </xs:choice> </xs:complexType>

<xs:element name=&quot;aft&quot; type=&quot;ns-a-aft&quot; abstract=&quot;true&quot;/>

<xs:complexType name=&quot;ns-a-aft&quot;> <xs:sequence minOccurs=&quot;1&quot;> <xs:element name=&quot;x&quot; type=&quot;xs:string&quot; maxOccurs=&quot;10&quot;/> <xs:element name=&quot;y&quot; minOccurs=&quot;0&quot;/> </xs:sequence> </xs:complexType> <xs:element name=&quot;root&quot; type=&quot;a:testType&quot;/>

</xs:schema>

Test2.xsd imports Test1.xsd, as follows: <xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; targetNamespace=&quot;ns-b&quot; xmlns=&quot;ns-b&quot; xmlns:a=&quot;ns-a&quot; elementFormDefault=&quot;unqualified&quot; >

<xs:import namespace=&quot;ns-a&quot; schemaLocation=&quot;test1.xsd&quot;/>

<xs:element name=&quot;abc&quot; type=&quot;myType&quot; substitutionGroup=&quot;a:aft&quot;/>

<xs:complexType name=&quot;myType&quot;> <xs:complexContent> <xs:restriction base=&quot;a:ns-a-aft&quot;> <xs:sequence minOccurs=&quot;1&quot;> <xs:element name=&quot;x&quot; type=&quot;xs:string&quot; maxOccurs=&quot;2&quot;/> </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 &quot;group&quot; (as defined in Test1.xsd) and references itself: <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>

 <xsd:redefine schemaLocation=&quot;test1.xsd&quot;> <xsd:simpleType name=&quot;simpleType&quot;> <xsd:restriction base=&quot;simpleType&quot;> <xsd:enumeration value=&quot;yes&quot; /> <xsd:enumeration value=&quot;no&quot; /> </xsd:restriction> </xsd:simpleType>

<xsd:group name=&quot;group&quot;> <xsd:sequence> <xsd:group ref=&quot;group&quot; /> <xsd:element name=&quot;in&quot; /> <xsd:element name=&quot;out&quot; /> </xsd:sequence> </xsd:group> <xsd:complexType name=&quot;complexType&quot;> <xsd:complexContent> <xsd:extension base=&quot;complexType&quot;> <xsd:sequence> <xsd:element name=&quot;tail&quot; /> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:attributeGroup name=&quot;attGroup&quot;> <xsd:attributeGroup ref=&quot;attGroup&quot; /> <xsd:attribute name=&quot;add&quot; use=&quot;optional&quot; type=&quot;xsd:decimal&quot; /> </xsd:attributeGroup> </xsd:redefine> </xsd:schema> The following is the code listing for Test1.xsd: <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>

 <xsd:simpleType name=&quot;simpleType&quot;> <xsd:restriction base=&quot;xsd:string&quot; /> </xsd:simpleType> <xsd:element name=&quot;root&quot; type=&quot;complexType&quot; /> <xsd:attribute name=&quot;gAtt&quot; type=&quot;simpleType&quot; /> <xsd:group name=&quot;group&quot;> <xsd:sequence> <xsd:element ref=&quot;root&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /> </xsd:sequence> </xsd:group> <xsd:complexType name=&quot;complexType&quot;> <xsd:group ref=&quot;group&quot; /> <xsd:attributeGroup ref=&quot;attGroup&quot; /> </xsd:complexType> <xsd:attributeGroup name=&quot;attGroup&quot;> <xsd:attribute ref=&quot;gAtt&quot; use=&quot;optional&quot; /> </xsd:attributeGroup> </xsd:schema>

With the October 2001 RTM version of MSXML 4.0, Test.xsd generates the following error message:

Circular reference is not allowed, '{testnamespace}group'.

back to the top

XSD: &quot;xsd:any&quot; 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=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation='test.xsd' > <a/> <b xsi:type=&quot;xsd:string&quot;>abc</b> <c xsi:type=&quot;xsd:int&quot;>123</c> is valid against following Test.xsd XSD schema: <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>  <xsd:complexType name=&quot;testType&quot;> <xsd:sequence> <xsd:element name=&quot;a&quot; /> <xsd:any namespace=&quot;##any&quot; processContents=&quot;strict&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;/> </xsd:sequence> </xsd:complexType> <xsd:element name=&quot;test&quot; type=&quot;testType&quot;/> </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=&quot;a1&quot; schemaLocation=&quot;schH1_b.xsd&quot;> generates the following error message:

The attribute &quot;id&quot; is not supported on the declaration xsd:redefine.

back to the top

<div class="references_section">