Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 263592 - Last Review: October 15, 2002 - Revision: 1.3
FIX: XML Datatype Validation Occurs at Parse Time Even When Not Validating
This article was previously published under Q263592
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.
The MSXML parser, version 2.5 (5.0.2920.0), corrects this problem.
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.
(http://msdn.microsoft.com/xml/default.asp)
Steps to Reproduce Behavior
To reproduce this problem, do the following:
- 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>
- 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="http://support.microsoft.com">
<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>
- 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.
| kbbug kbfix kbmsxmlnosweep KB263592 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate