Microsoft KB Archive/318887

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

Article ID: 318887

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 Q318887



SUMMARY
This article is part 2 of 4 in the series of articles that documents 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 have been fixed in MSXML 4.0 SP1:
 * xsd:decimal and mininclusive = 0.00


 * The Final Attribute of the XSD simpleType Element Should Support &quot;extension&quot; to Stop Use in Complex Types


 * Default Data Type for an XSD Element with a Fixed Value


 * Validation of Attributes with Fixed Values


 * xsd:any and processContents=&quot;skip&quot;


 * No Validation Error Is Raised When XSD Uniqueness Is Violated


 * xsd:element Blocks Further XSD redefine Elements



xsd:decimal and mininclusive = 0.00
In the October 2001 RTM version of MSXML 4.0, when you specify a 0 with decimal places (such as 0.0 or 0.00) as the value for a minInclusive facet, and the facet is defined for an XSD element of the decimal XSD primitive data type, you receive the following schema validation error message, even though this action is valid:

It is an error for the value specified for minInclusive to be greater than the value specified for maxInclusive for the same datatype.

To reproduce this behavior with MSXML 4.0, use the following code to create a sample XSD document named Decmininclusive.xsd, and then add Decmininclusive.xsd to an MSXML 4.0 XMLSchemaCache object: 

     

 back to the top

The Final Attribute of the XSD simpleType Element Should Support &quot;extension&quot; to Stop Use in Complex Types
The final attribute of the XSD simpleType element should support a value of &quot;extension&quot; to prevent a simpleType definition from being derived by extension to yield a complexType element. However, the October 2001 RTM release of MSXML 4.0 does not implement support for the &quot;extension&quot; value in its implementation of the final attribute of an XSD simpleType element. If you try to set the value of the final attribute of an XSD simpleType element to &quot;extension&quot;, you receive the following schema validation error message:

The value of the 'final' attribute may not be 'extension'

To reproduce this behavior with the October 2001 RTM release of MSXML 4.0, use the following code to create a sample XSD document named Simpletypeextensionrepro.xsd, and then add Simpletypeextensionrepro.xsd to an MSXML 4.0 XMLSchemaCache object: 

  

 <xs:simpleContent> <xs:extension base=&quot;myType&quot;> <xs:anyAttribute /> </xs:extension> </xs:simpleContent> </xs:complexType>

<xs:element name=&quot;myElement&quot; type=&quot;ct&quot; /> </xs:schema> back to the top

Default Data Type for an XSD Element with a Fixed Value
The XSD string primitive data type should be used as the default data type when no data type is specified for an element with a fixed value. However, when you add the following sample XSD schema, Defaulttyperepro.xsd, to an XMLSchemaCache object in the October 2001 RTM release of MSXML 4.0 <xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; > <xsd:element name=&quot;doc&quot; fixed=&quot;abc&quot; /> </xsd:schema> you receive the following error message:

'default' or 'fixed' value error

back to the top

Validation of Attributes with Fixed Values
You should receive a validation error message when an attribute in an XML instance document is assigned a value that is different from the fixed value that is defined for the attribute in the XSD schema. However, when you use the October 2001 RTM release of MSXML 4.0 to validate the following XML data, Fixedvalueattribute.xml <doc xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;addB109.xsd&quot; att=&quot;abc&quot; /> by using the following XSD schema, Fixedvalueattribute.xsd <xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; > <xsd:attribute name=&quot;att&quot; fixed=&quot;123&quot; /> <xsd:element name=&quot;doc&quot;> <xsd:complexType> <xsd:attribute ref=&quot;att&quot; /> </xsd:complexType> </xsd:element> </xsd:schema> the parser does not generate a validation error message to report that the value that is assigned to the att attribute in the XML instance document and the fixed value that is defined for the attribute in the XSD schema do not match.

back to the top

xsd:any and processContents=&quot;skip&quot;
An XML processor should not try to validate any elements from the specified namespaces when a value of &quot;skip&quot; is assigned to the processContents attribute of the XSD any element, but the October 2001 RTM release of MSXML 4.0 does not follow this specification. Because of this, you may receive validation error messages when you assign a value of &quot;skip&quot; to the processContents attribute of the XSD any element.

Steps to Reproduce the Behavior <ol> <li> Create and save the following sample XSD and XML instance documents in the root folder of your hard disk: A.xsd <schema xmlns=&quot;http://www.w3.org/2001/XMLSchema&quot; targetNamespace=&quot;a&quot; xmlns:a=&quot;a&quot; elementFormDefault=&quot;qualified&quot;>

<element name=&quot;SkipContainer&quot; type=&quot;a:SkipContainerType&quot;/>

<complexType name=&quot;SkipContainerType&quot;> <any namespace=&quot;##other&quot; processContents=&quot;skip&quot;/> </complexType> B.xsd <schema xmlns='http://www.w3.org/2001/XMLSchema' version='1.0' targetNamespace='b'       xmlns:b='b'        elementFormDefault='qualified'>

<element name=&quot;test&quot; type=&quot;b:testType&quot;/>

<complexType name=&quot;testType&quot;> <attribute name=&quot;b1&quot; type=&quot;string&quot; use=&quot;required&quot;/> </complexType> Test.xml <?xml version='1.0'?> <a:SkipContainer xmlns:a=&quot;a&quot; xmlns:b=&quot;b&quot;> <b:test/> </a:SkipContainer> </li> <li> Use the following Microsoft Visual Basic 6.0 code to validate the Test.xml file:NOTE: You must add a reference to Microsoft XML, v4.0 to your Visual Basic project. Dim sc As msxml2.XMLSchemaCache40 Set sc = New msxml2.XMLSchemaCache40 sc.Add &quot;a&quot;, &quot;c:\a.xsd&quot; sc.Add &quot;b&quot;, &quot;c:\b.xsd&quot;

Dim doc As msxml2.DOMDocument40 Set doc = New msxml2.DOMDocument40 doc.async = False Set doc.schemas = sc doc.Load &quot;c:\test.xml&quot; If doc.parseError.errorCode <> 0 Then Debug.Print doc.parseError.reason Else Debug.Print doc.xml End If The Visual Basic code generates the following validation error message, which indicates that the parser validated the <b:test> element in Test.xml:

Required attribute 'b1' is missing

The parser should not validate this element, because the processContents attribute of the XSD any element in A.xsd has been assigned the value &quot;skip&quot;. </li></ol>

back to the top

No Validation Error Is Raised When XSD Uniqueness Is Violated
The value of an XSD unique element or attribute cannot be duplicated in an XML instance document. However, when you use the October 2001 RTM release of MSXML 4.0 to validate the following XML document, Uniquerepro.xml <?xml version=&quot;1.0&quot;?> <Catalog> <product productID=&quot;a1&quot;/> <product productID=&quot;a1&quot;/> </Catalog> by using the following XSD schema, Uniquerepro.xsd <xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; >

<xsd:element name=&quot;Catalog&quot; type=&quot;catalogType&quot;/>

<xsd:complexType name=&quot;catalogType&quot;> <xsd:choice> <xsd:element name=&quot;products&quot;> <xsd:complexType> <xsd:choice maxOccurs=&quot;100&quot;> <xsd:element name=&quot;product&quot; maxOccurs=&quot;unbounded&quot;> <xsd:complexType> <xsd:attribute name=&quot;productID&quot; type=&quot;xsd:string&quot; use=&quot;required&quot;/> </xsd:complexType> </xsd:element>

</xsd:choice> </xsd:complexType>

<xsd:unique name=&quot;unique_part&quot;> <xsd:selector xpath=&quot;./product&quot; /> <xsd:field xpath=&quot;@productID&quot;/> </xsd:unique>

</xsd:element> </xsd:choice> </xsd:complexType>

</xsd:schema> the parser does not generate a validation error to reflect the duplication of values for the productID attribute that has been defined as unique in the XSD schema.

back to the top

xsd:element Blocks Further XSD redefine Elements
An XSD schema can contain multiple redefine elements, and all XSD redefine elements in a schema should occur before any global top-level XSD elements. However, the October 2001 RTM release of the MSXML 4.0 XSD compiler generates the following schema validation error message when an XSD schema contains two or more XSD redefine elements, even if all of the redefine elements occur before any top-level XSD element declarations:

A 'redefine' element cannot appear at this location

This problem occurs only when one or more xsd:redefine elements follow an xsd:redefine element with a child xsd:element that redefines an element that is declared in another schema. The schema compiler does not verify whether the parent of the xsd:element (which is nested in the redefine element) is the schema element.

To reproduce this behavior in the October 2001 RTM release of MSXML 4.0, create the following schemas in the same physical folder, and then add Redefines.xsd to an MSXML 4.0 XMLSchemaCache object:

Personname.xsd <xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;>

<xs:complexType name=&quot;personName&quot;> <xs:sequence> <xs:element name=&quot;title&quot; minOccurs=&quot;0&quot;/> <xs:element name=&quot;forename&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;/> </xs:sequence> </xs:complexType>

</xs:schema> Address.xsd <xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;>

<xs:complexType name=&quot;Address&quot;> <xs:sequence> <xs:element name=&quot;State&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/> <xs:element name=&quot;City&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/> </xs:sequence> </xs:complexType>

</xs:schema> Redefines.xsd <xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;>

<xs:redefine schemaLocation=&quot;personName.xsd&quot;> <xs:complexType name=&quot;personName&quot;> <xs:complexContent> <xs:extension base=&quot;personName&quot;> <xs:sequence> <xs:element name=&quot;generation&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:redefine>

<xs:redefine schemaLocation=&quot;address.xsd&quot;> <xs:complexType name=&quot;Address&quot;> <xs:complexContent> <xs:extension base=&quot;Address&quot;> <xs:sequence> <xs:element name=&quot;Zip&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:redefine>

<xs:element name=&quot;author&quot; type=&quot;personName&quot;/>

</xs:schema> back to the top

<div class="references_section">