File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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: 108
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: 12759
    
    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
 
Similar Threads
Screen scrapping(extract data from webpage) in java
Unzip
transform .odt to .txt in java
XML to database
Export to excel question