> I am working a little on the ordering problem (I really need it :) and have
> a few questions.
> 
> First, I am trying to look around using the debugger in IntelliJ with a
> little test proggie,  and I keep getting the following :
> 
> Exception in thread "main" java.lang.ClassCastException:
> org.dom4j.tree.DefaultElement
>     at 
> org.jaxen.dom.DocumentNavigator.getChildAxisIterator(DocumentNavigator.java:
> 107)
>     at 
> org.jaxen.expr.iter.IterableChildAxis.iterator(IterableChildAxis.java:21)
>     at org.jaxen.expr.DefaultStep.axisIterator(DefaultStep.java:78)
>     at 
> org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:127)
>     at org.jaxen.expr.DefaultUnionExpr.evaluate(DefaultUnionExpr.java:37)
>     at org.jaxen.expr.DefaultXPath.asList(DefaultXPath.java:46)
>     at org.jaxen.JaXPath.jaSelectNodes(JaXPath.java:48)
>     at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:38)
>     at XPathOrderTest.main(XPathOrderTest.java:25)
> 
> I have a munged classpath?  Am I missing something?

That's a little weird.  No clue, sorry. :(

> is it a fair assumption that in anything derived from
> org.jaxen.expr.DefaultBinaryExpr that in evaluate(), you would evaluate the
> lhs and the rhs with the same context, and that context is immutable? -> the
> context used for the lhs is the same as the rhs?

Yah, that's what the spec says.  The entire expression is evaluated
against 'The Context'.  Just because its binary, and we know it
has a left and a right, doesn't mean 'The Context' changes.

> Here's an approach then for DefaultUnionExpr :
> 
> Do the LHS with original context.
> 
> Take the set that comes out, and make a new set, original - lhs. Send that
> to rhs.  That effectively gives you the short circuit of the or, so you
> don't retest in rhs stuff you found in lhs.
> 
> Then you get the rhs set back.
> 
> To assemble the ordered set, run through the original set, picking out of
> lhs and rhs (dump into a set maybe...) assembling into a list...
> 
> This is kinda sucky as its O( size of context) but its a start to let me
> begin to understand how this works, and it gives you the short circuit,
> which I don't think you have now.
> 
> Any comments?  Should I get started?

Sounds like a valid plan.

        -bob


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

Reply via email to