Solved

SAX Parse Zip File

Posted on 2012-04-12
1
463 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 400 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Part One of the two-part Q&A series with MalwareTech.
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 …
Six Sigma Control Plans

617 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