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 XML library that can 'prettify' XML? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML library that can Watch "XML library that can New topic
Author

XML library that can 'prettify' XML?

Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Sean Clark
Rancher

Joined: Jul 15, 2009
Posts: 377

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

I love this place!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
The Xerces library has some pretty-fying serializers in the org.apache.xml.serialize package.

http://xerces.apache.org/xerces-j/apiDocs/index.html


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML library that can 'prettify' XML?
 
Similar Threads
Castor: Mapping Element not included in Java Class
How do you compare a string using this...
Adding html tags to script
backslash n is being escaped against my will
Nested Map