We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


XML parsing with JSP, but not really JSP.

jhughes4 asked
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>

Watch Question

Top Expert 2006

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.


I don't think that the JSTL is available to Siebel.  Is there another way?  Can you also provide the java code?  thanks
you can find an example here...

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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.