File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Parsing XML-trees backwards with JDOM? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Parsing XML-trees backwards with JDOM?" Watch "Parsing XML-trees backwards with JDOM?" New topic
Author

Parsing XML-trees backwards with JDOM?

Robert Jaeger
Ranch Hand

Joined: Apr 29, 2002
Posts: 62
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

Joined: Jan 23, 2002
Posts: 11962
    
    5
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()


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Robert Jaeger
Ranch Hand

Joined: Apr 29, 2002
Posts: 62
That�s a good idea.
Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parsing XML-trees backwards with JDOM?
 
Similar Threads
XML Validation
JDOM alternative JAR file required
Patterns used for XML Data parsing
send a xml file to servlet and servlet send back the xml file
Generating an xlink attribute in JDOM?