Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SAX Parse Zip File

Posted on 2012-04-12
1
Medium Priority
?
465 Views
Last Modified: 2012-04-18
Hi experts,

I am working on a project that needs to use SAX to parse an xml zip file ("myZip.zip"). The file is so big that I have to use SAX instead of DOM.

Does anybody have a basic piece of Java code to share with me so that I can start? This is my first time to work on such a SAX-parse-xmlzip project so any help is greatly appreciated.

Thanks so much.
0
Comment
Question by:davidw88
[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
1 Comment
 
LVL 36

Accepted Solution

by:
mccarl earned 1600 total points
ID: 37841147
Something along the lines of...

XMLReader xmlReader = XMLReaderFactory.createXMLReader();
xmlReader.setContentHandler(new MyHandler());
xmlReader.parse(new InputSource(new ZipInputStream(new FileInputStream("myZip.zip"))));

Open in new window


And then the main task is to implement a ContentHandler class (MyHandler in the above) to do the actual parsing work.



As you can see it's pretty simple, so I guess that you may have other questions. If you can be more explicit about what you are having troubles with, I can help you better.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Six Sigma Control Plans

722 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