aspose file tools*
The moose likes JSP and the fly likes Tag library that can display 'pretty' XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Tag library that can display Watch "Tag library that can display New topic
Author

Tag library that can display 'pretty' XML

Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi all,

I'm currently displaying XML messages for a client by getting them to open the XML in a new window/tab as teh text/xml type (which means that most browsers automatically format the XML to be indented etc). What I'd like to do is to use a tag lib to be able to display nicely indented XML in a <div> or <span> section (or similar).

FYI - I'm also asking a similar Q in our XML section asking about a server side library that can prettify the XML before it gets to the web browser.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Martijn Verburg wrote:

FYI - I'm also asking a similar Q in our XML section asking about a server side library that can prettify the XML before it gets to the web browser.


I am not sure if it would help but you can use XSLT to transform XML into HTML. This transformation happens at server side only.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Thanks, that is what I've done for now, but I've also discovered a Javascript library that might do the trick, which is a little nicer as this is purely a 'view' problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tag library that can display 'pretty' XML