[jdom-interest] getting elements by tag name?

Jason Hunter jhunter at collab.net
Wed Aug 30 04:08:02 PDT 2000

> There's a getElementsByTag that takes a String as a parameter 
> (the tag
> name) and returns a NodeList with all nodes independently of its
> position in the hierarchy. I find this command very useful.
> Is there anything like that in JDOM??

The XPath support provides an easy mechanism to retrieve things like
this as well as much more.  There's no method call to do it.

XPath is not finished, but you can experiment with what's in
jdom-contrib.  If you wanted something more "final" you could write your
own utility class to retrieve this information in about 10 minutes. 
Putting it in core would require justification on why it's needed and
reasoning for why there should be a method that is seemingly better done
with XPath.


More information about the jdom-interest mailing list