Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I want to display xml in the browser with jsp

 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please KeepItDown. I have changed your thread title into lowercase.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or are you trying to transform XML into human-readable HTML?
 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then all you should need to do is run it through any XML pretty-printer, and HTML-escape it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic