Microsoft KB Archive/262228

= FIX: XML Pattern Match Fails When Using ID Attribute =

Article ID: 262228

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft XML Parser 2.0

-



This article was previously published under Q262228



SYMPTOMS
The MSXML 2.0 parser does not parse match patterns against ID attributes properly. The match pattern may not return any matches even when matches exist.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This problem has been fixed in the MSXML 2.5 parser.

For more information, please see the following Microsoft Web site:

http://msdn.microsoft.com/xml/default.asp



Steps to Reproduce Behavior
  Paste the following code into a new text document, and save it as idmatch.xml:     item1   item2     Paste the following code into a new text document and save the document in the same location as the previous document, as idschema.xml: <?xml version=&quot;1.0&quot; ?> <Schema xmlns=&quot;urn:schemas-microsoft-com:xml-data&quot; xmlns:dt=&quot;urn:schemas-microsoft-com:datatypes&quot;> <AttributeType name=&quot;id&quot; dt:type=&quot;id&quot;/> <ElementType name=&quot;ITEM&quot;> <attribute type=&quot;id&quot;/> </ElementType> </Schema> </li>  Insert the following code into a new text document and save the document in the same location as the previous two documents, as idmatch.xsl: <xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/TR/WD-xsl&quot;> <xsl:template> <xsl:apply-templates/> </xsl:template> <xsl:template match=&quot;id('foot1')&quot;> FOOT1 FOUND<BR /><xsl:apply-templates/> </xsl:template> <xsl:template match=&quot;id('foot2')&quot;> FOOT2 FOUND<BR /><xsl:apply-templates/> </xsl:template> </xsl:stylesheet> </li> Browse to the idmatch.xml file by using an Internet Explorer Web browser from a computer with version 2.0 of the MSXML parser installed, and note that the output is blank.</li> Browse to the file again from a computer with version 2.5 of the MSXML parser installed, and note that the output contains two rows indicating that each match pattern was correctly identified.</li></ol>

Keywords: kbbug kbfix kbmsxml250fix kbmsxmlnosweep KB262228

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.