[jdom-interest] XPath Parsing

bob at werken.com bob at werken.com
Thu Jul 6 15:41:13 PDT 2000


Howdy--

I've been somewhat working with Mike Hinchey with regards to XPath
parsing, with regards to JDOM.

Looking for input from Jason/Brett and whomever else might be
interested.

So far, I've been using the ANTLR parser-generator (www.antlr.org)
to create the parser for XPath expressions.  This means, though,
that the antlr.jar runtime would be required in order to use the
XPath parser.

Additionally, the parser is *not* JDOM specific.  It'll be SAX-like,
firing off events to an XPathHandler of some sort.  The XPathHandler
will contain the JDOM-specific logic for walking from a root Element
to return the nodeset.  This would possibly allow someone to also
write a DOM_XPathHandler or other XPath handler to walk a different
document-tree.  (Heck, maybe even a SAX_XPathHandler some day).

Bearing in mind that it isn't JDOM-specific, so far the XPathParser is
*not* in the org.jdom hierarchy.  For convenience, it's currently living
in com.werken.xpath.*.

Mike raised some concerns about the reliance upon the external 
parser-generator ANTLR, and the packaging of the parser itself.

(btw, I'm not a big fan of org.jdom.contrib.* packaging, as it
doesn't help coders find the location where the module actively
lives or is being developed).

Anyhow, comments and criticism are welcome and requested.

	thanks,

	-bob mcwhirter




More information about the jdom-interest mailing list