my dog learned polymorphism*
The moose likes JSP and the fly likes I want to display xml in the browser with jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "I want to display xml in the browser with jsp" Watch "I want to display xml in the browser with jsp" New topic
Author

I want to display xml in the browser with jsp

Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 145

Hi All

i want to display the xml in the same format which i am getting in the jsp..

Can anyone suggest ....


Thanks in advance....



Regards,
Chetan.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Please KeepItDown. I have changed your thread title into lowercase.


[My Blog]
All roads lead to JavaRanch
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12759
    
    5
If you mean that you want the screen to show the <tags> then you will have to prevent the browser from trying to interpret them as markup, right?

That will require substituting character entities for each < and > character and probably some others.

Bill
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Or are you trying to transform XML into human-readable HTML?
Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 145

Yes William ,

you predicted it correctly.

I want to display the tags and that too like properly aligned ...just like when we open xml file in the browser...


If you guys having some way ...Please suggest and thanks to both of you William and Christophe



Regards,
Chetan.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Then all you should need to do is run it through any XML pretty-printer, and HTML-escape it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I want to display xml in the browser with jsp
 
Similar Threads
web interface for the XML format of the Excel file
Servlet Response for AJAX
parse xml response in Jersey (RESTful webservice)
maintain the format of xml message on browser
how do i write xml in to file by using jsp