Solved

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

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
egit plugin on eclipse 8 62
tomcat startup error 5 59
servlet web applications   metadata-complete="true" or false 3 37
jboss wildfly 10.1 10 76
A short article about problems I had with the new location API and permissions in Marshmallow
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 step-by-step guide to install VisualVM launcher in eclipse.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

813 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

18 Experts available now in Live!

Get 1:1 Help Now