aspose file tools
The moose likes Servlets and the fly likes editing xml and zip the file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "editing xml and zip the file" Watch "editing xml and zip the file" New topic
Author

editing xml and zip the file

Veeresh kal
Greenhorn

Joined: Oct 12, 2009
Posts: 1
I have a zip file xxxx.zip which have one xml xxx.xml file and another zip aaaa.zip file as an attachment. I need to extract the xxxx.zip and I need to replace one of the string in xml and again I need to zip the xxx.xml and aaaa.zip back to xxxx.zip. Can any one suggest how I can go about.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35237
    
    7
Welcome to JavaRanch.

See here for some examples of how to work with ZIP files in Java code: http://www.exampledepot.com/egs/java.util.zip/pkg.html

How complex is the XML change? If it's just text replacement, you may be able to do it with string operations, but if it involves structural changes you should use one of the available XML APIs (DOM or SAX).

Since the question has nothing to do with servlets -which this forum is all about- I'll move it to a more appropriate forum.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: editing xml and zip the file
 
Similar Threads
Error processing resource while parsing XML with '&' symbol
Can we pass a dynamic list of ref-beans to a bean in spring application context file?
How to write zip files into another zip file..?
xxxx.jar seen as xxxx.zip on desktop and won't run
Unzip