Name

p:uncompress — The standard p:uncompress step.

Synopsis

The p:uncompress step expects on its source port a compressed document. It outputs an uncompressed version of this on its result port.

Input portPrimarySequenceContent types
source✔  any 
Output portPrimarySequenceContent types
result✔  any 
Option nameTypeDefault value
content-typexs:string'application/octet-stream'
formatxs:QName?()
parametersmap(xs:QName,item()*)?()
Declaration
 1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
   |   <p:input port="source"
   |            primary="true"
   |            content-types="any"
 5 |            sequence="false"/>
   |   <p:output port="result"
   |             primary="true"
   |             content-types="any"
   |             sequence="false"/>
10 |   <p:option name="format" as="xs:QName?"/>
   |   <p:option name="parameters" as="map(xs:QName,item()*)?"/>
   |   <p:option name="content-type"
   |             as="xs:string"
   |             select="'application/octet-stream'"/>
15 |</p:declare-step>
Errors
CodeDescription
err:XC0079It is a dynamic error (err:XC0079) if the map parameters contains an entry whose key is defined by the implementation and whose value is not valid for that key.
err:XC0201It is a dynamic error (err:XC0201) if the p:uncompress step cannot perform the requested content-type cast.
err:XC0202It is a dynamic error (err:XC0202) if the compression format cannot be understood, determined and/or processed.
err:XD0079It is a dynamic error (err:XD0079) if a supplied content-type is not a valid media type of the form “type/subtype+ext” or “type/subtype”.
Implementation defined features

Description

The p:uncompress step is defined in the XProc 3.0: Standard Step Library. It is also described on XProcRef.org.

Uncompression is supported by the third party Apache Commons Compress™ library.

Supported formats

The following formats are supported using the Apache Commons Compress™ library version 1.27.1.

Compression algorithmFormatContent typeCommon file extensions
Brotlibrotliapplication/brotli.br
BZip2bzip2application/bzip2.bz2
Compresscompressapplication/compress.Z
deflatedeflateapplication/deflate.deflate
GZipgzipapplication/gzip.gz, .gzip
LZMAlzmaapplication/lzma.lzma
XZxzapplication/xz.xz

Notes

  1. The deflate algorithm is ZLib compression.

  2. Support for the Brotli algorithm requires the org.brotli:dec:0.1.2 package on the classpath.

  3. Support for the LZMA and XZ algorithms require the org.tukaani:xz:1.10 package on the classpath.