[jdom-interest] traversing the JDOM tree

Ray Tayek rtayek at attbi.com
Tue Apr 15 16:44:39 PDT 2003


At 01:00 PM 4/15/03 -0700, Jason Hunter wrote:
> > If i want to recursively find and Element or check existence of an
> > element, like getElementByName() or findElement().
>
>Two options with the current code:
>
>1) Write a recursive function

buy or steal the code from http://www.ibiblio.org/xml/books/xmljava/ (it 
works fine)

>2) Use XPath in org.jdom.xpath

i just wrote some code to find the xpath to each attribute in a doc using 
jdom starting with the code above. it took a bit of coding and a few 
collections and maps to get the subscripts right. was there an easier way 
or did i reinvent a wheel?

thanks

p.s. nice servlet books, working on 3'rd edition i hope?

---
ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work
vice chair orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/




More information about the jdom-interest mailing list