This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 131

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: 2272
    
  28

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

Joined: Jan 10, 2002
Posts: 60766
    
  65

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Viewing xml data in jsp
 
Similar Threads
hide xml data
Configuring JMS destinations and Data sources
Passing multiple XML objects using curl
XML & JSP Technology
Traverse DOS/UNIX diretories - print members