[jdom-interest] XPath bindings?

Bradley S. Huffman hip at a.cs.okstate.edu
Thu Oct 11 21:31:15 PDT 2001


Am I must be missing something? With Jaxen cann't you do

   XPath xpath = new XPath( String xpathExpr);
   List list = xpath.selectNodes( Element element);

Brad

> Howdy folks--
> 
> Now that Jaxen is pretty darn compliant with regards JDOM (including
> the namespace:: axis), I was wondering if we might want to spec out an
> XPath binding.  I know the FAQ says maybe 1.1 would include XPath support,
> and the JSR is for 1.0 only, but, XPath is seeming very useful to many
> folks, and The Other Models seem to support it.
> 
> Thus, I propose adding, to Document and Element the following:
> 
> 	public List selectNodes(String xpathExpr);
> 	public Object selectSingleNode(String xpathExpr);
> 
> Jaxen supports other convenience methods, such as booleanValueOf(...),
> but I'm not proposing adding those.  Following the 80/20 rule, the
> two simple select..() methods seem sufficient.  Folks needing more
> power than that can venture into direct Jaxen usage. 
> 
> If accepted, I'll gladly generate a diff against CVS to add this
> functionality.
> 
> 	-bob
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list