Solved

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

Posted on 2004-08-18
2
279 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 500 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

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.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This video teaches viewers about errors in exception handling.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

690 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