data element does not correctly intepret false as value
Posted: Mon Dec 31, 2007 7:08 pm
The data element does not accept "false" as a text value in an XML file.
Here are two identical XML files:
and
In each case I attempt to read the value of leaf by doing
This works when leaf contains "true" as show in the first example but fails when leaf contains "false" as in the second case. The failure is because "nodeList.item(0).firstChild has no properties."
I strongly suspect that this is an implementation problem related to how data are typed by the underlying engine when data arrive. It reminds me strongly of PHP-style typing of incoming data with a value of "false."
I can work around this by modifying the value of leaf in my code, but I would like to verify that this is indeed a known bug that requires a work-aound.[/code]
Here are two identical XML files:
Code: Select all
<root>
<leaf>true</leaf>
</root>
Code: Select all
<root>
<leaf>false</leaf>
</root>
Code: Select all
nodeList=info.documentElement.getElementsByTagName("leaf")
leafValue=nodeList.item(0).firstChild.toString()
I strongly suspect that this is an implementation problem related to how data are typed by the underlying engine when data arrive. It reminds me strongly of PHP-style typing of incoming data with a value of "false."
I can work around this by modifying the value of leaf in my code, but I would like to verify that this is indeed a known bug that requires a work-aound.[/code]