File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dom4j does not read closing tag.

 
K Aditi
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one please tell me how to read closing tag using dom4j?
e.g. </batch>
I tried to read it using element.getQualifiedName(), but dom4j skips everything after slash(/).

Thanks,
 
Paul Clapham
Sheriff
Pie
Posts: 20206
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not how DOMs work. They don't deal with tags, they deal with elements. So when you have something like

you have a "batch" element which has two "entry" elements as its children. Each of those "entry" elements has a text node as its only child.

If you're trying to deal with tags then a SAX parser might be a slightly better choice. But you shouldn't be trying to deal with tags anyway, because XML itself is described in terms of elements.
 
K Aditi
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. Will try to implement the code using SAX parser.
Thanks,
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic