Microsoft KB Archive/818081

= INFO: List of Issues Fixed in MSXML 4.0 SP2 (Part 1 of 4) =

Article ID: 818081

Article Last Modified on 5/30/2003

-

APPLIES TO


 * Microsoft XML Core Services 4.0 Service Pack 1

-



SUMMARY
This article is part 1 of 4 in the series of articles that documents the bugs that are fixed in Microsoft XML (MSXML) 4.0 Service Pack 2 (SP2).

The following bugs have been fixed in MSXML 4.0 SP2:
 * &quot;Schema Is Non-Deterministic&quot; Error Message Should Specify the XPath Location of the Failing Schema Definition
 * ServerXMLHTTP Validation Failures When You Use Extended Characters in User Names
 * XSD Validation Does Not Enforce Restriction Defined on a Base SimpleType
 * DOM: SetAttribute Should Raise Error When Attribute Value Contains Invalid XML Characters
 * IXMLDOMNode.attributes Does Not Return All Default Attributes
 * Circular Strong References Between Anonymous Types and Their Parent ComplexType Type May Cause Memory Leak



Fix: &quot;Schema Is Non-Deterministic&quot; Error Message Should Specify the XPath Location of the Failing Schema Definition
The following generic XML validation error message:

Schema is non-deterministic

has been enhanced in MSXML 4.0 SP2 to report the XPath location of the non-deterministic type definition in an XML schema. For additional information about non-deterministic XML schemas, click the following article number to view the article in the Microsoft Knowledge Base:

316297 PRB: &quot;Schema Is Non-Deterministic&quot; Error Message When You Add XSD to XMLSchemaCache Object

back to the top

Fix: ServerXMLHTTP Validation Failures When You Use Extended Characters in User Names
In MSXML 4.0 RTM and Service Pack 1 (SP1), the following authentication error is reported when you use ServerXmlHttp to execute HTTP requests by supplying a valid user name that contains extended characters:

Error message: HTTP 401.1 - Unauthorized: Logon Failed

This problem has been fixed in MSXML 4.0 SP2. For additional information about this problem in MSXML 4.0, click the following article number to view the article in the Microsoft Knowledge Base:

316594 ServerXMLHTTP Validation Failures When You Use Extended Characters in User Names

back to the top

Fix: XSD Validation Does Not Enforce Restriction Defined on a Base SimpleType
In MSXML 4.0 RTM and SP1, the XML schema validator does not enforce restrictions that are defined on base simpleTypes.

Validating the data in the following sample XML document Restriction.xml against the sample schema Restriction.xsd does not raise any errors in MSMXL 4.0 RTM and SP1 even though the value of the AlphaTestValue element contains a character (the ‘-‘ character) that is restricted by the AlphaType base simpleType:

Restriction.xsd:
 



    

    



Restriction.xml:
<?xml version=&quot;1.0&quot;?> <AlphaTestValue>ABCDE-</AlphaTestValue> In MSXML 4.0 SP2, a fix has been implemented to enforce restrictions defined on base simpleTypes when validating XML data. This is a breaking change that has been implemented to enhance compliancy with the World Wide Web Consortium (W3C) XML Schema specification. XML data that violates restrictions defined on base simpleTypes fail validation in MSXML 4.0 SP2.

back to the top

Fix: DOM: SetAttribute Should Raise Error When Attribute Value Contains Invalid XML Characters
The IXMLDOMElement.setAttribute method has been fixed to generate an error when a specified attribute value contains invalid XML characters.

The following are the valid XML characters and character ranges (hexadecimal values) as defined by the W3C XML language specifications 1.0.: #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] This is a breaking change that has been implemented to enhance compliancy with the W3C XML specification. You receive a runtime error message after you upgrade to MSXML 4.0 SP2 if you have code that uses the setAttribute DOM API method to assign values that contain invalid XML characters to XML attributes. To resolve this, you must change your code so that you do not use invalid XML characters in attribute values.

back to the top

Fix: IXMLDOMNode.attributes Does Not Return All Default Attributes
In MSXML 4.0 RTM and SP1, using the following loop: For Each <IXMLDOMAttributeObj> In <IXMLDOMNodeObj.attributes>…Next to enumerate the returned IXMLDOMNamedNodeMap collection object, does not return all the default attributes that are defined for an XML element. Only the first default attribute is returned, and the following error is raised when the code in the enumeration loop tries to access the second default attribute:

Unspecified Error

This problem can be reproduced in MSXML 4.0 RTM and SP1 by executing the following Visual Basic code to parse the attributes of the   element in the sample Employee.xml document that follows: Dim doc As MSXML2.DOMDocument40 Set doc = New MSXML2.DOMDocument40

doc.Load &quot;c:\Employees.xml&quot; Dim EmployeeAtt As IXMLDOMAttribute For Each EmployeeAtt In doc.selectSingleNode(&quot;/employees/employee&quot;).Attributes Debug.Print EmployeeAtt.xml Next

Employes.xml:
<!DOCTYPE employees [ <!ELEMENT employees (employee+)> <!ELEMENT employee EMPTY> <!ATTLIST employee name CDATA #REQUIRED dept CDATA 'IT' location CDATA 'FL' > ]> <employee name='John'/> This problem has been fixed in MSXML 4.0 SP2. You can use the following loop: For Each <IXMLDOMAttributeObj> In <IXMLDOMNodeObj.attributes>…Next to enumerate the returned IXMLDOMNamedNodeMap, and to access all the default attributes that are defined for an element.

back to the top

Fix: Circular Strong References Between Anonymous Types and Their Parent ComplexType Type May Cause Memory Leak
The following XSD schema outlines the basis of the problem: <xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;> <xs:complexType name=&quot;myComplexType1&quot;> <xs:choice> <xs:element name=&quot;myComplexType2&quot;> <xs:complexType> <xs:complexContent> <xs:extension base=&quot;myComplexType1&quot; /> </xs:complexContent> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:schema> In this schema, the complexContent element &quot;myComplexType2,&quot; extends its parent &quot;myComplexType1.&quot; This produces a circular strong reference between local element declarations and their local types. Schemas like this cause a memory leak in MSXML 4.0 RTM and SP1 that has been fixed in MSXML 4.0 SP2.

back to the top

<div class="references_section">