File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes How to display XML node values in a Jsp Page Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "How to display XML node values in a Jsp Page" Watch "How to display XML node values in a Jsp Page" New topic
Author

How to display XML node values in a Jsp Page

silamala ramesh babu
Greenhorn

Joined: Dec 08, 2011
Posts: 14

Hi,

I have a Xml file like this

<?xml version="1.0" encoding="UTF-8" ?>
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <soap:Body>
- <ns3:processRouterResponse xmlns:ns2="http://rpo.customer.es.chase.com/" xmlns:ns3="http://webservice.maf.customer.es.chase.com/" xmlns:ns4="http://dto.customer.es.chase.com/">
- <dto>
- <dtoCustomerAccountDetailsList>
- <customerAccountDetailsDto>
<errorMessageText>REQUEST COMPLETED SUCCESSFULLY</errorMessageText>
<accountNumber>00000000000000065540144</accountNumber>
<bankId>0000000079</bankId>
<eci>0000001231</eci>
<productCode>120</productCode>
<relationshipCode>201</relationshipCode>
<subProductCode>010</subProductCode>
</customerAccountDetailsDto>
- <customerAccountDetailsDto>
<errorMessageText>REQUEST COMPLETED SUCCESSFULLY</errorMessageText>
<accountNumber>00000000000000096954666</accountNumber>
<bankId>0000000079</bankId>
<eci>0000001231</eci>
<productCode>120</productCode>
<relationshipCode>201</relationshipCode>
<subProductCode>120</subProductCode>
</customerAccountDetailsDto>
</dtoCustomerAccountDetailsList>
</dto>
</ns3:processRouterResponse>
</soap:Body>
</soap:Envelope>


I need display the values in Jsp like

AccountNumber bankId ProductCode
00000000000000065540144 0000000079 120
00000000000000096954666 0000000079 120


rsilamala
Claudiu Chelemen
Ranch Hand

Joined: Mar 25, 2011
Posts: 62

Hi there,

You may use jstl's <x:parse> tag, and then select the desired content using xpath expressions.
There are a lot of examples on the web, found one here, for example.

Cheers,
Claudiu
 
 
subject: How to display XML node values in a Jsp Page
 
Threads others viewed
Getting SESSION_OUT ERROR while consuming asp.net web services using APACHE AXIS(JAVA)
How to pass complex type parameter in web service while creating it through SAAJ
How do I catch a user define exception on the client (SOAP/JAX-RPC/WSDL)
Why (and how) is Tomcat logging http requests from our apache web server
H
developer file tools