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? -----Original Message----- From: Christian Nentwich [mailto:[EMAIL PROTECTED]] Sent: Monday, December 10, 2001 15:51 To: [EMAIL PROTECTED] Subject: [Jaxen] bug in Jaxen 1.0 beta 7 Dear all, first of all, thanks for Jaxen and Saxpath. Good XPath implementations are rare, and my benchmarks indicate that Jaxen is up to 10 times faster than Xalan, so Jaxen qualifies as 'good' :) However, there seems to be a problem with your predicate evaluation. Here's a sample XML document for recreating the problem. <?xml version='1.0'?> <foo> <bar> <baz/> <baz/> <baz/> </bar> <bar> <baz/> <baz/> <baz/> </bar> </foo> If you execute "/foo/bar/baz[1]" on this document, Jaxen returns a list of size 1, presumably containing the very first "baz". The correct behavior should be to return a list containing the first baz in the first bar and the first baz in the second bar, i.e. a list of size 2. I suspect that Jaxen filters its nodes at the very end after retrieving all nodes into a list, instead of filtering the nodes collected at every step? Christian _______________________________________________ Jaxen-interest mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jaxen-interest _______________________________________________ Jaxen-interest mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jaxen-interest