You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Luca Biolcati <lb...@odx.it> on 2003/03/26 10:54:18 UTC
[JXpath] boolean value
Hello,
I don't understand how JXPath evaluates boolean values. It seems it converts them in integer values, instead of treating them as boolean. I used a Map as context:
==============================
Map myMap = new HashMap();
myMap.put("BVALUE", Boolean.FALSE);
JXPathContext ctx = JXPathContext.newContext(myMap);
String exp = "not(BVALUE)";
System.out.println("["+exp+"]: "+ctx.getValue(exp));
==============================
end the output is:
[not(BVALUE)]: false
if I use an expression like BVALUE=0 it works fine. But for what I know about xpath syntax, expressions like BVALUE=false or not(BVALUE) should produce the same result, am I wrong?
Re: [JXpath] boolean value
Posted by Dmitri Plotnikov <dm...@apache.org>.
I know, it is a little bizarre, but I think JXPath does what the spec is
telling it to do.