Solved

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

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
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 …

760 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