XML parsing with JSP, but not really JSP.

Posted on 2006-04-03
Medium Priority
Last Modified: 2013-11-24
Hello Experts.
I have a peculiar question.  I have a group of Siebel people who have to parse an XML message.  Siebel uses its own proprietary language for coding, but underneath its JSP.  The problem is that no one is familiar with JSP.  So with the limited knowledge of JSP and Siebel not able to parse using a utility like DOM, can someone provide some sample code that would parse this XML…PLEASE!  Thank you in advance.  If I could assign 1000 points to this I would.

<Transaction TargetApplicationName="String" DateTimeStamp="2001-12-17T09:30:47.0Z" TransactionIndicator="String">
                <Contact searchspec="String" Transaction="Create">
                  <AgentTypeDescription>Part Time</AgentTypeDescription>
                        <City>some city </City>
                        <State>some state</State>
                        <AgencyName>AAAA Ins Company</AgencyName>
                        <CodeDescription>Test Div 01</CodeDescription>
                        <CodeDescription>Test District 01</CodeDescription>
                        <CodeDescription>Test Office</CodeDescription>

Question by:jhughes4
  • 2
LVL 29

Expert Comment

ID: 16368466
Sure. The only question is whether you want to parse this using some java code like DOM or SAX or whether you want to ouput this xml into a jsp.

As this is JSP I will guess the latter and say that you should use the JSTL libs  http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
<c:import var='xml' url='message.xml'/><!-- import your message file-->
<x:parse xml="${xml}" var="doc" />

                <!-- now use standard xpath to traverse the document -->
            <td><x:out select="$doc/Transaction/Object2/Contact/AgentNumber"/><!-- outputs "111111"--></td>
            <td><x:out select="$doc//FirstName"/><!-- outputs "Bob"--></td>
If you need some java code to parse it then I can provide a utility class for that too.

Author Comment

ID: 16373659
I don't think that the JSTL is available to Siebel.  Is there another way?  Can you also provide the java code?  thanks

Accepted Solution

avinthm earned 2000 total points
ID: 16378169
you can find an example here...

for more details on dom ...visit the below site...

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question