Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing XML-trees backwards with JDOM?

 
Robert Jaeger
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I use JSP/JDOM to create HTML pages (source in stored in XML-files)
I am parsing trough XML-trees like that (simplified code):

Can I parse a XML-tree backwars, beginning with the last element?
Something like that:
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure how the JDOM API looks like, but it would be pretty simple to implement a reverse iterator for the standard DOM using NodeList#item(int) and NodeList#getLength()
 
Robert Jaeger
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That�s a good idea.
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic