• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Viewing xml data in jsp

 
Abdul Aatif
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i view an xml data in jsp.
ex:
+root
-sub
-sub
-sub
-sub
 
rohit chavan
Ranch Hand
Posts: 132
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you will need to replace the special characters from the XML before you can actually show it in jsp. e.g. replacing "<" and ">" with "<" , ">" etc.
 
Abdul Aatif
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is displaying
<root>
<sub>value</sub>
<sub>value</sub>
<sub>value</sub>
</root>

i want to display as

+root
value(if i click on + )
value(if i click on + )
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you want to display it as a tree?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65129
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before writing any JSP code, figure out what HTML code will display the data as you intend. Then, and only then, write the JSP markup (remember, no Java code in a JSP!) to generate that HTML.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic