How to extract an xml file after matching content from a zip file using java
Joined: Mar 02, 2010
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.
Author and all-around good cowpoke
Joined: Mar 22, 2000
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.