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 port | Primary | Sequence | Content types |
|---|---|---|---|
| source | ✔ | any |
| Output port | Primary | Sequence | Content types |
|---|---|---|---|
| result | ✔ | any |
| Option name | Type | Default value |
|---|---|---|
| content-type | xs:string | 'application/octet-stream' |
| format | xs:QName? | () |
| parameters | map(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
| Code | Description |
|---|---|
err:XC0079 | It 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:XC0201 | It is a dynamic error (err:XC0201) if the
p:uncompress step cannot perform the requested content-type cast. |
err:XC0202 | It is a dynamic error (err:XC0202) if the compression
format cannot be understood, determined and/or processed. |
err:XD0079 | It 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
- It is implementation-defined what other formats are supported.
- It is implementation-defined how the step determines the compression format.
- The semantics of the keys and the allowed values for these keys are implementation-defined.
Description
The p:uncompress step is a
standard XProc 3.0 step.
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 algorithm | Format | Content type | Common file extensions |
|---|---|---|---|
| Brotli | brotli | application/brotli | .br |
| BZip2 | bzip2 | application/bzip2 | .bz2 |
| Compress | compress | application/compress | .Z |
| deflate | deflate | application/deflate | .deflate |
| GZip | gzip | application/gzip | .gz, .gzip |
| LZMA | lzma | application/lzma | .lzma |
| XZ | xz | application/xz | .xz |
Notes
The
deflatealgorithm is ZLib compression.Support for the Brotli algorithm requires the
org.brotli:dec:0.1.2package on the classpath.Support for the LZMA and XZ algorithms require the
org.tukaani:xz:1.10package on the classpath.