Microsoft KB Archive/318889

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

Article ID: 318889

Article Last Modified on 4/19/2002

-

APPLIES TO


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

-



This article was previously published under Q318889



SUMMARY
This article is part 3 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:
 * MSXML DOM: Attribute Values Must Be Normalized Before Validation


 * MSXML DOM Validation: Incorrect Error Message on Second Call to the DOM Validate Method When XSD Schema Defines an ID Attribute


 * An NMTOKEN Value with Multiple Colon Characters Is Treated as an XML Name


 * Microsoft Internet Explorer XMLHTTP BUG - Access to Local Files



MSXML DOM: Attribute Values Must Be Normalized Before Validation
The XSD normalizedString data type represents strings that have been normalized with respect to white spaces. For example, line feed (#xA) characters, carriage return (#xD) characters, and tab (#x9) characters in a string are converted to space (#x20) characters. The data value of an XML attribute whose data type is normalizedString must be normalized before the XML instance document is validated. The October 2001 RTM version of the MSXML 4.0 DOM does not normalize such attribute values before it validates an XML instance document. Because of this, you receive the following validation error message when MSXML 4.0 parses a normalizedString attribute value that contains carriage return characters, line feed characters, or tab characters:

The attribute: ' ' has an invalid value according to its data type.

To reproduce this behavior, use the October 2001 RTM release of MSXML 4.0 to validate the following XML document, Testnormalization.xml   against the following sample XSD schema, Testnormalization.xsd:        back to the top

MSXML DOM Validation: Incorrect Error Message on Second Call to DOM Validate Method When XSD Schema Defines an ID Attribute
When you execute the validate method of the October 2001 RTM release of the MSXML 4.0 DOMDocument object more than one time, you may receive the following validation error message the second time you execute the method, even when the value of an ID attribute (that is, an attribute whose data type in the XSD schema has been defined as ID) is not duplicated:

The ID '' is duplicated

The initial validation does not raise an error message. The error message that you receive when the validate method is executed the second time reports an incorrect duplication of an ID attribute value that occurs only one time in the source XML document.

NOTE: If an ID attribute value is duplicated, this error message is valid.

Steps to Reproduce the Behavior   With the October 2001 RTM release of MSXML 4.0, use the following code to create a sample XML document and a sample XSD schema: Projects.xsd 

<xs:element name=&quot;Data&quot; type=&quot;Projects&quot;/>

<xs:complexType name=&quot;Projects&quot;> <xs:sequence> <xs:element name=&quot;project&quot; type=&quot;projectData&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;/> </xs:sequence> </xs:complexType>

<xs:complexType name=&quot;projectData&quot;> <xs:sequence> <xs:element name=&quot;title&quot; type=&quot;xs:string&quot;/> </xs:sequence> <xs:attribute name=&quot;projectID&quot; type=&quot;xs:ID&quot;/> </xs:complexType>

</xs:schema> Projects.xml <?xml version=&quot;1.0&quot;?> </li> <li> Use the following Microsoft Visual Basic 6.0 code to validate the Projects.xml file:NOTE: You must add a reference to Microsoft XML, v4.0 to your Visual Basic project. Dim xmlschema As MSXML2.XMLSchemaCache40 Set xmlschema = New MSXML2.XMLSchemaCache40

xmlschema.Add &quot;&quot;, &quot;c:\projects.xsd&quot;

Dim xmldom As MSXML2.DOMDocument40 Set xmldom = New MSXML2.DOMDocument40 Set xmldom.schemas = xmlschema

xmldom.async = False xmldom.validateOnParse = False xmldom.Load &quot;c:\projects.xml&quot;

Dim parseError As MSXML2.IXMLDOMParseError Set parseError = xmldom.Validate

If parseError.errorCode <> 0 Then MsgBox &quot;Error Code : &quot; & parseError.errorCode _ & vbCrLf & vbCrLf & &quot;Description : &quot; & parseError.reason _ & vbCrLf & &quot;Source Text : &quot; & parseError.srcText,, &quot;XSD Validation Result&quot; Else MsgBox &quot;No Error&quot;,, &quot;XSD Validation Result&quot; End If

'Call validate again. This raises an incorrect error (even when the XML is valid) 'when the schema defines an XSD ID attribute.

Set perror = xmldom.Validate If perror <> 0 Then MsgBox &quot;Error Code : &quot; & perror.errorCode _ & vbCrLf & vbCrLf & &quot;Description : &quot; & perror.reason _ & vbCrLf & &quot;Source Text : &quot; & perror.srcText,, &quot;XSD Validation Result&quot; Else MsgBox &quot;No Error&quot;,, &quot;XSD Validation Result&quot; End If                   </li></ol>

back to the top

An NMTOKEN Value with Multiple Colon Characters Is Treated as an XML Name
Multiple occurrences of the colon character in an NMTOKEN data value should be permitted. However, the October 2001 RTM release of MSXML 4.0 treats NMTOKEN values that have multiple instances of the colon character as XML names. Because of this, you receive the following error message when the parser parses NMTOKEN values that contain two or more colon characters:

Multiple colons are not allowed in a name

To reproduce this behavior, use the following code to create a sample XML document and a sample Document Type Definition (DTD), and then use an MSXML 4.0 (October 2001 RTM version) DOMDocument object to load and validate Person.xml:

Person.dtd <!ELEMENT persons (person+)> <!ELEMENT person EMPTY> <!ATTLIST person id ID #REQUIRED first_name CDATA #REQUIRED last_name CDATA #REQUIRED dept CDATA #REQUIRED DateOfJoining NMTOKEN #REQUIRED > Person.xml <?xml version=&quot;1.0&quot;?> <!DOCTYPE persons SYSTEM &quot;PERSON.DTD&quot;> <person id=&quot;_1&quot; first_name=&quot;Jim&quot; last_name=&quot;Stanton&quot; dept=&quot;Information Systems&quot; DateOfJoining=&quot;9-20-199923:50:55&quot;/> back to the top

Microsoft Internet Explorer XMLHTTP BUG - Access to Local Files
The following Microsoft Knowledge Base article describes this security problem:

317244 MS02-008: XMLHTTP Control in MSXML 4.0 Can Permit Access to Local Files

The MSXML 4.0 SP1 release includes the fix that this article describes. You do not have to separately download and install the fix for the MSXML 4.0 RTM release after you install MSXML 4.0 SP1.

back to the top

<div class="references_section">