Solved

SAX Parse Zip File

Posted on 2012-04-12
1
459 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
1 Comment
 
LVL 35

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Advice in Xamarin 21 96
sp_configure 'external scripts enabled', 1; 7 78
Infrastructure development vs software development 3 60
Eclipse Java import and method not resolved 4 47
A short article about a problem I had getting the GPS LocationListener working.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

809 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