cpnz:archive

Packs resources into an archive file.

Declaration

<p:declare-step type="cpnz:archive">
  <p:input port="source"/>
  <p:output port="result"/>
  <p:option name="destination" required="true"/>
  <p:option name="format" required="true"/>
</p:declare-step>

Usage

Target file is specified using destination option.

Archive format is specified as a mime-type using format option.

<?xml version="1.0"?>
<cpnz:archive xmlns:cpnz="http://www.componize.org/pipeline/1.0">
  <p:with-option name="destination" select="'relative/path/file.zip'"/>
  <p:with-option name="format" select="'application/zip'"/>
</cpnz:archive>

The list of resources to pack is passed as an XML document in the primary input port.

Any relative path is resolved from the base URI of the XML element itself.

<?xml version="1.0"?>
<cpnz:archive xmlns:cpnz="http://www.componize.org/pipeline/1.0">
  <cpnz:file href="relative/path"/>
  <cpnz:file href="/absolute/path"/>
</cpnz:archive>

Result port contains c:result elements.

<?xml version="1.0"?>
<c:result xml:base="/absolute/path/of/the/source/file">path/in/archive</c:result>