Help and Support

Article ID: 263587 - Last Review: September 30, 2003 - Revision: 2.3

FIX: XML DOM Node of Type Boolean Persists Incorrectly

This article was previously published under Q263587

On This Page

Expand all | Collapse all

SYMPTOMS

If an XML Document Object Model (DOM) node is of type Boolean and the type is set to True by using the DOM NodeTypedValue property, the value for the node is incorrectly persisted as -1 on a computer using version 2.0 of the MSXML parser, when it should actually be persisted as 1.

RESOLUTION

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

STATUS

This problem was corrected in 2.5 (5.0.2920.0) or later.


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)

MORE INFORMATION

Steps to Reproduce Behavior

To reproduce this problem, insert the following code into a new text document, and save the document as repro.htm:
<html>
   <xml id="xml1">
   <doc xmlns:dt='urn:schemas-microsoft-com:datatypes'>
     <x dt:dt="boolean">1</x>
   </doc>
   </xml>

   <script>
       var root = xml1.XMLDocument.documentElement;
       alert(root.xml);
       root.childNodes(0).nodeTypedValue = true;
       alert(root.childNodes(0).text);  
   </script>
   </html>

				
On a computer with version 2.0 of the MSXML parser installed, note that the second message box produces a value of -1 rather than 1, as expected.

APPLIES TO
  • Microsoft XML Parser 2.0
  • Microsoft XML Parser 3.0
  • Microsoft XML Core Services 4.0
Keywords: 
kbbug kbfix kbmsxml250fix KB263587

Article Translations