On Mon, 10 Dec 2001, Yuri de Wit wrote:

> Thats me again with the same problem I outlined earlier.
> 
> If I have an Jaxen XPATH that looks like the following:
> 
> '$result > 10'
> 
> And I have a VariableContext set in the engine that returns, for instance, a
> String("4") or a Double(4.0), Jaxen is going to throw a ClassCastException
> because it is relying on the Java Comparator of Primitive Objects (Integer,
> String, Double, etc). From the XPATH expression, 10 is an Integer(10) and
> Integer.compare(String("10")) is going to throw the exception.
> 
> My question is: Is this a Jaxen bug since it is not properly handling the
> object comparations properly? Or are there specific requirements on what
> types can be returned by VariableContext implementations?
> 
> In addition, if the VariableContext returns 'null' it is Jaxen is going to
> throw NullPointerException. Shouldnt Jaxen check for nulls in this case?

Hmmm...

Looking at DefaultRelationalExpr.java, it looks to me that it funnels the
LHS and RHS through the NumberFunction(), which should do type coercion
for strings, etc.

Could you point me to file/line-number where we're Doing The Wrong Thing?

        -bob


_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to