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

XML library that can 'prettify' XML?

 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm looking for a Java/XML lib that can take an XML string and turn it into a nicely indented XML string, e.g.





I'll be doing a Google search naturally, but thought I might as well post here since I work here and all that
 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

The java w3c libraries can do that job, I have used them for outputting simple snippets of HTML.
There was a good tutorial on it, one of the first results on google.

Sean
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Xerces library has some pretty-fying serializers in the org.apache.xml.serialize package.

http://xerces.apache.org/xerces-j/apiDocs/index.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic