Solved

SAX Parse Zip File

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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
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.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

756 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