?
Solved

Need help with SAX parser.. to parse an xml..

Posted on 2004-08-18
2
Medium Priority
?
281 Views
Last Modified: 2013-11-23
I have a xml like the following, using SAX parser, can u please show me how to extract
BillDateDetails

My final output i need as like comma separated dates..
But importantly i need to find how I can get those BillDate.. the number of BillDate is dynamic
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelop" xmlns:cis="http://...">
      <env:Header>
      </env:Header>
      <b:getBillDatesResponse xmlns:b="http://......">
            <b:BTN></b:BTN>
            <b:CAN></b:CAN>
            <b:BillDateDetails>
                  <b:BillDate>MM/dd/yyyy</b:BillDate>
                  <b:BillDate>MM/dd/yyyy</b:BillDate>
                  <b:BillDate>MM/dd/yyyy</b:BillDate>
            </b:BillDateDetails>            
      </b:getBillDatesResponse>
</env:Envelope>


thanks for ur help..
I really appreciate that..
0
Comment
Question by:phantom2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 16

Accepted Solution

by:
imladris earned 2000 total points
ID: 11835881
If you derive from startElement:

      public void startElement(String uri,String name,String qname,Attributes atts)

you can use that to check for the "b:BillDate" elements by checking the name argument. Whenever you find one you can process it appropriately.
0
 
LVL 16

Expert Comment

by:imladris
ID: 11852020
Did that help?

Do you need more details? If so, what?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Six Sigma Control Plans
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

801 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