This document is also available in these non-normative formats: XML.
This proposal defines a set of XPath 2.0 extension functions to handle ZIP files. It defines one function to read ZIP files structure, functions to read actual entry's content, as well as functions to create brand-new ZIP files or to create ZIP files based on existing template files. It has been designed to be compatible with XQuery 1.0 and XSLT 2.0, as well as any other XPath 2.0 usage.
1 Introduction
1.1 Namespace conventions
1.2 Error management
1.3 What is a ZIP file?
2 Bla bla...
3 TODO: ...
4 TODO: Old text...
This specification defines a set of functions to read and write ZIP files structure and actual content. It has been designed as a general ZIP tool set for XPath, while it is expected to be particularly useful with document package formats based on XML and ZIP, as for instance [EPUB], [Open XML], and [OpenDocument].
The module defined by this document does define one function in the namespace
http://www.expath.org/mod/zip
. In this document, the zip
prefix, when used, is bound to this namespace URI.
Error conditions are identified by a code (a QName
.) When such an error
condition is reached in the evaluation of an expression, an dynamic error is thrown,
with the corresponding error code (as if the standard XPath function
error
had been called.) TODO: Codes have not been defined yet.
A ZIP file is a file, identified by a URI, that contains a set of entries, organized as a tree. An entry is either a directory (containing other entries) or a file entry (carrying actual content.) The entries are organized as a tree, where files are leaf nodes, and directories contains other entries. This hierarchy is the structure of the ZIP file. All entries have a unique name among its siblings, and a particular entry can be identified using a path starting at the ZIP file level, down to this entry, passing by each directory in between.
For instance, the following shows the structure of a ZIP file containing one file
entry with the name README
and one directory with the name
dir
. This directory contains two files, named
content.txt
and content.html
. The path for the later
entry is dir/content.html
:
README dir/ content.txt content.html
Take a look at [MarkLogic ZIP module] (not sure to keep that ref in later versions, though.)