File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Smiple(?) SAX-parser print all nodes

 
Sebastian Green
Ranch Hand
Posts: 136
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i found this example on the net, its supose to print every element and the element value. But I can get it to work.



Could someone help so print out the whole xml-file. Thanks!
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you do

you're only getting a list of the direct children of 'el', not all descendants of 'el'.

You need to do some kind of a recursive method like this to traverse the whole DOM tree. Another option would be to do something like this.
 
Sebastian Green
Ranch Hand
Posts: 136
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Lasse, I will test that later and get back to this topic.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic