Name
pxp:unzip, cx:unzip — Extract documents from a ZIP file.
Synopsis
<p:declare-step
type
="
pxp:unzip
"
xmlns:pxp
="
http://exproc.org/proposed/steps
"
>
<p:output
port
="
result
"
/>
<p:option
name
="
href
"
required
="
true
"
/>
<!--
anyURI -->
<p:option
name
="
file
"
/>
<!--
string -->
<p:option
name
="
content-type
"
/>
<!--
string -->
<p:option
name
="
charset
"
/>
<!--
string -->
</p:declare-step>
Description
The file identified by the file
option in the ZIP archive
identified by the href
option is extracted. If no file
option is specified, a manifest of the ZIP archive contents produced instead.
If the content-type
is not specified, or if an XML content type is specified, the file is parsed
as XML and returned. It is a dynamic error if the
file is not well-formed XML.
If the content-type
specified is not an XML
content type and no charset
is specified, the file is
base64 encoded and returned in a single c:data
element.
If the content-type
is a text content type (begins
with “text/
”), and a charset
is specified, the file is returned as a single c:data
element
containing the text content of the file.
The cx:unzip
step
is defined
at http://exproc.org/.
The names cx:unzip
and pxp:unzip
are
synonymous. The latter is preferred.