Hello,

I solved the problem.  Here's the code snippet I was using ...

>       BaseXPath xPath = // ... provided as a parameter ...
>       LocationPath path = (LocationPath)xPath.getRootExpr();
>       Iterator nodes = path.getSteps().iterator();
>
>       while( nodes.hasNext() )
>       {
>               DefaultNameStep step = ((DefaultNameStep)nodes.next());
>               System.out.println( step.getText() );
>       }

To get at the name and value of the predicates:

while( nodes.hasNext() )
{
        DefaultNameStep step = (DefaultNameStep)nodes.next();
        Iterator predicates = step.getPredicates().iterator();

        while( predicates.hasNext() )
        {
                Predicate predicate = (Predicate)predicates.next();

                System.out.println( "Name : " +
((DefaultNameStep)((LocationPath)((BinaryExpr)predicate.getExpr()).getLHS())
.getSteps().iterator().next()).getLocalName() );
                System.out.println( "Value: " +
((BinaryExpr)predicate.getExpr()).getRHS().getText() );
        }
}

Sincerely,
Dave Jarvis


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to