http://onion.net/2010/compression/zip

setComment (comment : string) : void

The method »setComment()« writes a .zip comment onto the file. The displaying of the comment can usually be set in the Zip program. It is often displayed when opening an archive.

Parameter

The parameter »comment« requires the text of the .zip comment to be produced.

Example

The following example demonstrates the production of a comment.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:b="http://onionworks.net/2004/renderengine/binary" xmlns:zip="http://onion.net/2010/compression/zip" xmlns:onion="http://onionworks.net/2004/data" version="1.0">
<xsl:template match="/">
<xsl:variable name="zip" select="zip:create(0, 'off')" />
<xsl:value-of select="zip:setComment('I am a Comment!!')" />
<xsl:value-of select="zip:finish()" />
<b:output mimeType="application/zip">
<b:webResponse dispositionType="attachment" filename="test.zip" />
</b:output>
</xsl:template>
</xsl:stylesheet>

The method »setComment()« must be called directly after producing the .zip binary stream.

See also