FIX: XML Datatype Validation Occurs at Parse Time Even When Not Validating (263592)



The information in this article applies to:

  • Microsoft XML 2.0

This article was previously published under Q263592

SYMPTOMS

The Microsoft MSXML 2.0 parser forces datatype validation even when data is not being validated. For example, in an XSL stylesheet that outputs a datatyped node, if the value of the node is specified using the <xsl:value-of> tag, and the datatype of the node is number, then the parser generates an error.

RESOLUTION

The MSXML parser, version 2.5 (5.0.2920.0), corrects this problem.

STATUS

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

This problem has been fixed in Version 2.5 of the MSXML parser. To download the latest version of the parser, visit http://msdn.microsoft.com/xml/default.asp.

MORE INFORMATION

Steps to Reproduce Behavior

To reproduce this problem, do the following:
  1. Insert the following code into a new text file, and save the file as test.xml:
    <?xml-stylesheet type="text/xsl" href="test.xsl" ?>
    <items>
       <item value="1000"/>
    </items>
    					
  2. Next, insert the following code into another new text file, and save the file in the same location as the previous file, as test.xsl:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
       <xsl:template match="/">
          <output xmlns:dt="urn:schemas-microsoft-com:datatypes">
             <xsl:for-each select="items/item">
                <value dt:dt="number"><xsl:value-of select="@value"/></value>
             </xsl:for-each>
          </output>
       </xsl:template>
    </xsl:stylesheet>
    					
  3. Browse to the test.xml file using a Microsoft Internet Explorer Web browser on a computer with version 2.0 of the MSXML parser installed. Note that a parse error is generated because the datatype of the value tag is specified to be a number, and the contents of the node is another tag. The value-of tag should generate a numeric value in the output; instead, the parser generates an error.

Modification Type:MajorLast Reviewed:10/15/2002
Keywords:kbBug kbDSupport kbMSXMLnosweep KB263592