aspose file tools*
The moose likes JSP and the fly likes Viewing xml data in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Viewing xml data in jsp" Watch "Viewing xml data in jsp" New topic
Author

Viewing xml data in jsp

Abdul Aatif
Greenhorn

Joined: Feb 08, 2012
Posts: 23
How do i view an xml data in jsp.
ex:
+root
-sub
-sub
-sub
-sub
rohit chavan
Ranch Hand

Joined: Oct 08, 2010
Posts: 132

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

Joined: Feb 08, 2012
Posts: 23
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
Bartender

Joined: Jan 17, 2008
Posts: 2434
    
  28

So you want to display it as a tree?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: Viewing xml data in jsp