ZIP Facility

Taps and pipes

This module is still a work in progress. An implementation exists for Saxon, but the specification has not been written yet, and there is almost no documentation. An introduction to EXPath, presented at Balisage in August 2009 contains examples, see the proceedings and the materials page. Any help, comment or suggestion greatly appreciated on the mailing list.

Prototype for Saxon

The current implementation for Saxon is provided as a XAR package: expath-zip-saxon-0.1.xar. You can use this package with the Packaging System, or just open it as a ZIP file, get the JAR file within it, and set your Saxon processor up (especially the classpath). Here is an complete example (provided you correctly installed the package in your repository, you can just save it in a file and execute it with saxon -xsl:zip-list.xsl -it=main file=.../some/

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="" 
   <xsl:import href=""/>
   <xsl:output indent="yes"/>
      $file is the ZIP file to use.  If $entry is set, extract that
      entry from $file, as an XML document.  If not, list the content
      of $file.
   <xsl:param name="file"  as="xs:string"/>
   <xsl:param name="entry" as="xs:string?"/>
   <xsl:template name="main" match="/">
         <xsl:when test="$entry">
            <!-- an XML entry in the ZIP file -->
            <xsl:sequence select="zip:xml-entry($file, $entry)"/>
            <!-- the structure of the ZIP file -->
            <xsl:sequence select="zip:entries($file)"/>