> I'm a newbie to jaxen, so bear me if i'm asking some obvious questions.
> 
> James Strachan wrote:
> 
> > I get a bit confused about it from time to time as well. The easiest way I
> > find is to create an XPath expression, simplify it then do a toString() and
> > look at the expression tree.
> >
> 
> Can i create XPath expression from xpath string? If yes, how can i do it?

Ayup.

Assuming you're using dom4j:

        import org.jaxen.dom4j.XPath;


        XPath xpath = new XPath( "/melty/cheese/is/great" );

> If i can get hold of an XPath object and get the root expression, then how can i
> walk the expression?

There's a difference between evaluating the expression, which means
applying your xpath to a document, and 'walking the expression', which
means walking the object-tree of internal implementation objects that get
built when the string "/melty/cheese/is/great" gets parsed by the engine.
Consider it a rought 'compilation' structure for the expression itself.

Which do you really want to do?

        -bob


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

Reply via email to