xmlzipioxmlzipio adds support for reading and writing files inside ziparchives to libxml2.
It is based on the minizip and miniunzip examples provided with zlib.
The interface for xmlzipio and it's implementation. xmlzipio.c/.h are published under the terms of the MIT License.
Files taken from minizip and miniunzip to deal with the zip archives. zip.c/.h and unzip.c/.h are published under the terms of zlib/libpng license.
Example Makefile shows how to integrate xmlzipio into your project using libtool and automake.
And a small doku.
Download the files and add them to your project. (If you use automake you can just use the Makefile.am to create a libxmlzipio.la)
Include xmlzipio.h. Than call xmlZipRegisterInputCallback() and xmlZipRegisterOutputCallback(). Now you can call for example xmlParseFile(XMLFileName) to parse an xml file. The filename must be of the form zip:zipname!filename (i.e. zip:web.zip!/xml/index.xml). Note that filename must be an absolute path, that means it must begin with "/".
This syntax is inspired by that discribed at http://jakarta.apache.org/commons/sandbox/vfs/filesystems.html#Zip%20and%20Jar. The idea is, that you can use zip with any uri supported by libxml. By now, only local paths and file uris are supported (see Limitations).
Currently only local paths and file uris are supported
The next step would be to use xmlIO again to access the archive. This would give us the posibility to read files from the web or use nested zip archives
Change the CopressionLevel for the zip archive.
| c: | the new compression level (0..9). 0 for deflated. |
| Returns: | the old compression level. |
Register the Callbacks to add read zip archives.
Register the Callbacks to add write zip archives.
incorporated changes in the naming scheme (Thu Oct 30)
initial release (Wed Oct 29)
Last modified: Thu Oct 30 17:39:39 CET 2003