trisnombolong / json-xml-rpc

Automatically exported from code.google.com/p/json-xml-rpc
0 stars 0 forks source link

Boolean values in XML-RPC responses always evaluate to true #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Send an XML-RPC request which results in a response containing a
<boolean> value
2. Inspect corresponding value in the object passed to the onSuccess function
3. value is always true

What is the expected output? What do you see instead?
<boolean>0</boolean> -> false
<boolean>1</boolean> -> true

What version of the product are you using? On what operating system?
Mac OS X 10.4.10, Firefox 2.0.0.7, json-xml-rpc javascript client 0.8

Please provide any additional information below.
Bug is due to the fact that Boolean("0") evaluates to true in JavaScript as
per spec. Line 844 in json-xml-rpc.js should read

return Boolean(parseInt(typeEL.firstChild.nodeValue));

instead of 

return Boolean(typeEL.firstChild.nodeValue);

Original issue reported on code.google.com by bierb...@in.tum.de on 28 Sep 2007 at 10:25

GoogleCodeExporter commented 8 years ago
Resolved in 0.8.0.1

Original comment by WestonRuter on 28 Sep 2007 at 4:00