There are few xpath javacc/jjtree grammars floating around that you can use to generate your own parser. I used one a few years back to build an xpath -> object-relational sql translater. If you dont find one, and your interested, email mail me and I'll send you a grammar.
<br><br>-Kevin<br><br><br><div><span class="gmail_quote">On 10/10/06, <b class="gmail_sendername">Frans Englich</b> &lt;<a href="mailto:frans.englich@telia.com">frans.englich@telia.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Real-To:&nbsp;&nbsp;Frans Englich &lt;<a href="mailto:frans.englich@telia.com">frans.englich@telia.com</a>&gt;<br><br>On Tuesday 10 October 2006 11:45, Jonathan Robie wrote:<br>&gt; David Carlisle wrote:<br>&gt; &gt;&gt; Rather, I want the XPath parser to return an array or a
<br>&gt; &gt;&gt; list or tree or anything where I can traverse step by step.<br>&gt; &gt;<br>&gt; &gt; There are xpath and xquery java parsers available from the working group<br>&gt; &gt; pages (maintained by Scott Boag, mainly)
<br>&gt; &gt; <a href="http://www.w3.org/2005/qt-applets/xqueryApplet.html">http://www.w3.org/2005/qt-applets/xqueryApplet.html</a><br>&gt; &gt; This builds an in memory tree of the expression with methods to dump it<br>&gt; &gt; as indented text or as XML.
<br>&gt; &gt; I use it as the parser for xq2xml<br>&gt; &gt; <a href="http://monet.nag.co.uk/xq2xml/index.html">http://monet.nag.co.uk/xq2xml/index.html</a><br>&gt;<br>&gt; These parsers are kept up to date with the latest drafts of XPath 
2.0<br>&gt; and XQuery 1.0, and the text description in the specifications is<br>&gt; generated from the same grammar as the parser, all the examples in the<br>&gt; specifications (including the use cases) are tested with them, and they
<br>&gt; have had wide review. So there are real advantages to using them. Unless<br>&gt; you need an XPath 1.0 parser.<br><br>Even, the testing task force uses Scott's parser to check tests for parser<br>errors, so its indirectly tested through the XQuery Test Suite.
<br><br><br>Cheers,<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frans<br>_______________________________________________<br><a href="mailto:talk@x-query.com">talk@x-query.com</a><br><a href="http://x-query.com/mailman/listinfo/talk">http://x-query.com/mailman/listinfo/talk
</a><br><br></blockquote></div><br>