XML parsing with JSP, but not really JSP.

Posted on 2006-04-03
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
    LVL 29

    Expert Comment

    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
    <%@ taglib prefix="c" uri="" %>
    <%@ taglib prefix="x" uri="" %>
    <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

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

    Accepted Solution

    you can find an example here...

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

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    Problem to setup 18 66
    Convert ArrayList of custom objects to JSON 4 44
    Fix45 challenge 15 66
    wordmultiple challenge 12 62
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    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.

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now