[jdom-interest] XPath on Element, Document, etc?

Alex Rosen arosen at novell.com
Thu May 1 14:04:03 PDT 2003


I think we should stay close to either Jaxen's method names
(selectNodes() and selectSingleNode()) or Xalan's (selectNodeList() and
selectSingleNode()) since these are already widely used.

I think having both select-one and select-list functionality is
important, because evaluating an XPath that resolves to a single object
is so common. 

Alex

>>> "Bradley S. Huffman" <hip at a.cs.okstate.edu> 4/30/2003 11:16:33 PM
>>>
Jason Hunter writes:

> One outstanding TODO item is to decide if we should put any XPath
calls
> on Element, Document, and the other org.jdom objects or if it's
better
> to leave the functionality isolated in org.jdom.xpath.XPath.
> 
> I'm interested in people's thoughts, esp Laurent and Brad who've
done
> some experimentation in this area.

Something like "List evaluateXPath(String xpath)" sounds good if the
javadocs
point out the limitations (see Laurent and Elliotte's discussion on
the
XOM mailing list about these limitations).

One observation, currently all methods returning a list, return a list
of JDOM objects.  Since XPath evaluations can return non-JDOM objects,
this
would make it a odd-ball with the rest of the API. But then again, IMHO
this
is another problem that's easily handled with good documentation.

Where you also thinking of a convenience method for transforms off of 
Element and Document?

Brad
_______________________________________________
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