Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes How to extract an xml file after matching content from a zip file using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to extract an xml file after matching content from a zip file using java" Watch "How to extract an xml file after matching content from a zip file using java" New topic
Author

How to extract an xml file after matching content from a zip file using java

Raaja Gotluru
Ranch Hand

Joined: Mar 02, 2010
Posts: 112
Hi,

I am having a zip file with lot of xml files. I will be having some data in an excel sheet which I have to check with the xml files content and which ever xml file content matches with that data I have to extract that file only and store that in a folder. That is each record in that excel file matches with one xml file in the zip file.

Guide me to achieve this.

Thanking you.

--raaja.g
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
You will have to extract and test each XML document from the zip file. There is no way around it.

However, if your matching criteria are simple enough, you could use SAX or StaX parsing to check each document, much faster than building a DOM and using XPath for instance.

I suggest the first step is learning how to extract character streams from the zip file.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to extract an xml file after matching content from a zip file using java