ZIP Module

EXPath Candidate Module 26 May 2009

This version:
Latest version:
Florent Georges, fgeorges.org

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.

Table of Contents

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...


A References

1 Introduction

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].

1.1 Namespace conventions

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.

1.2 Error management

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.

1.3 What is a ZIP file?

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:


2 Bla bla...


3 TODO: ...

Take a look at [MarkLogic ZIP module] (not sure to keep that ref in later versions, though.)

4 TODO: Old text...


http:send-request($request as
   element(http:request)?, $href as xs:string?,
$content as item()?, $serial as item()?) as

A References

EPUB set of specifications. International Digital Publishing Forum.
Open XML
Office Open XML. Microsoft Corporation.
OpenDocument format (ODF). The Organization for the Advancement of Structured Information Standards (OASIS).
MarkLogic ZIP module
Module: ZIP Package. In MarkLogic Server 4.0 documentation. MarkLogic Corporation.