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?

I know this little program works - I tried it using the jaxen-full.jar (or
whatever the package target produces) and it worked fine separately.

Now I am doing the exploring *in* the jaxen project, and I think I have
things misconfigured.  I am far from clueful about IntelliJ so...


Second, consider that things are *really* foggy for me, I am just going by
feel, so here's some rambling :

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?


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?


-- 
Geir Magnusson Jr.                       [EMAIL PROTECTED]
System and Software Consulting
You're going to end up getting pissed at your software
anyway, so you might as well not pay for it. Try Open Source.



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

Reply via email to