Solved

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

Posted on 2004-08-18
2
277 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
This is about my first experience with programming Arduino.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

831 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