Zip

Purpose:
Allow XSL transforms to handle zip archives.
Namespace:
urn:WebWorks-XSLT-Extension-Zip
Prefix:
wwzip
Methods:
ZipDirectory(string archivePath, string directoryPath):

Zip a directory and recursively include sub-directories.

Returns:
void
Example:

Creates zip archive C:\some\archive.zip with the directory and and subdirectories of C:\projects\myproject.

<xsl:variable name="VarZipDirectory" select="wwzip:ZipDirectory('C:\some\archive.zip', 'C:\projects\myproject'" />
ZipDirectoryWithoutCompression(string archivePath, string directoryPath):

Zip a directory and recursively include sub-directories without compressing any files.

Returns:
void
Example:

Creates zip archive C:\some\archive.zip with the directory and and subdirectories of C:\projects\myproject.

<xsl:variable name="VarZipDirectory" select="wwzip:ZipDirectoryWithoutCompression('C:\some\archive.zip', 'C:\projects\myproject'" />
Zip(string archivePath, node-set nodes):

Create a zip archive containing a list of files.

Returns:
void
Example:

Creates a zip archive C:\some\archive.zip with the contents defined in the node set.

<xsl:variable name="VarZipListAsXML">
 <wwzip:File source="C:\some\directory\alpha.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\beta.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\gamma.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\last\gamma.txt" zip-directory="directory\last" />
</xsl:variable>
<xsl:variable name="VarZipList" select="wwzip:Zip('C:\some\archive.zip', msxsl:node-set($VarZipListAsXML)/*" />
ZipWithoutCompression(string archivePath, node-set nodes):

Create a zip archive containing a list of files without compressing any files.

Returns:
void
Example:

Creates a zip archive C:\some\archive.zip with the contents defined in the node set.

<xsl:variable name="VarZipListAsXML">
 <wwzip:File source="C:\some\directory\alpha.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\beta.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\gamma.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\last\gamma.txt" zip-directory="directory\last" />
</xsl:variable>
<xsl:variable name="VarZipList" select="wwzip:ZipWithoutCompression('C:\some\archive.zip', msxsl:node-set($VarZipListAsXML)/*" />
ZipAdd(string archivePath, node-set nodes):

Add a list of files to a zip archive.

Returns:
void
Example:

Append to zip archive C:\some\archive.zip with the contents defined in the node set.

<xsl:variable name="VarZipListAsXML">
 <wwzip:File source="C:\some\directory\alpha.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\beta.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\gamma.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\last\gamma.txt" zip-directory="directory\last" />
</xsl:variable>
<xsl:variable name="VarZipList" select="wwzip:ZipAdd('C:\some\archive.zip', msxsl:node-set($VarZipListAsXML)/*" />
ZipAddWithoutCompression(string archivePath, node-set nodes):

Add a list of files to a zip archive without compressing any files.

Returns:
void
Example:

Append to zip archive C:\some\archive.zip with the contents defined in the node set.

<xsl:variable name="VarZipListAsXML">
 <wwzip:File source="C:\some\directory\alpha.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\beta.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\gamma.txt" zip-directory="directory" />
 <wwzip:File source="C:\some\directory\last\gamma.txt" zip-directory="directory\last" />
</xsl:variable>
<xsl:variable name="VarZipList" select="wwzip:ZipAddWithoutCompression('C:\some\archive.zip', msxsl:node-set($VarZipListAsXML)/*" />
ZipExtract(string archivePath, string extractDirectory):

Extract contents of a zip archive to a specified directory location.

Returns:
void
Example:

Extracts the contents of zip archive C:\some\archive.zip to C:\projects\myproject.

<xsl:variable name="VarZipExtract" select="wwzip:ZipExtract('C:\some\archive.zip', 'C:\projects\myproject'" />

DevCenter/Documentation/ExtensionObjects/ePublisher/Zip (last edited 2010-08-23 19:04:38 by BenAllums)