Name

p:archive-manifest — The standard p:archive-manifest step.

Synopsis

The p:archive-manifest creates an XML manifest file describing the contents of the archive appearing on its source port.

Input portPrimarySequenceContent types
source✔  any 
Output portPrimarySequenceContent types
result✔  application/xml 
Option nameTypeDefault value
formatxs:QName?()
override-content-typesarray(array(xs:string))?()
parametersmap(xs:QName, item()*)?()
relative-toxs:anyURI?()
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="application/xml"
   |             sequence="false"/>
10 |   <p:option name="format" as="xs:QName?"/>
   |   <p:option name="parameters" as="map(xs:QName, item()*)?"/>
   |   <p:option name="relative-to" as="xs:anyURI?"/>
   |   <p:option name="override-content-types" as="array(array(xs:string))?"/>
   |</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:XC0081It is a dynamic error (err:XC0081) if the format of the archive does not match the format as specified in the format option.
err:XC0085It is a dynamic error (err:XC0085) if the format of the archive cannot be understood, determined and/or processed.
err:XC0120It is a dynamic error (err:XC0120) if the relative-to option is not present and the document on the source port does not have a base URI.
err:XC0146It is a dynamic error (err:XC0146) if the specified value for the override-content-types option is not an array of arrays, where the inner arrays have exactly two members of type xs:string.
err:XC0147It is a dynamic error (err:XC0147) if the specified value is not a valid XPath regular expression.
err:XD0064It is a dynamic error (err:XD0064) if the base URI is not both absolute and valid according to RFC 3986.
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:archive-manifest step is defined in the XProc 3.0: Standard Step Library. It is also described on XProcRef.org.

Supported formats

The supported formats are 7z, Ar, Arj, Cpio, Jar, Tar, and Zip. For more information, see the p:archive step.

Details about the manifest entries for the various formats follow.

7z Archives

Entries for 7z archives have the following format:

<c:entry
  name = stringThe entry name.
  href = anyURIThe entry URI.
  content-type = stringThe content-type.
  comment? = stringA comment associated with the entry.
  method? = stringThe storage method.
  level? = stringThe compression level.
  cx:mode? = integerThe Unix mode bits.
  cx:mode-string? = stringThe Unix mode as a string.
  cx:crc? = integerThe entry CRC value.
  cx:file-creation-time? = dateTimeThe file creation time.
  cx:last-access-time? = dateTimeThe file last access time.
  cx:windows-attributes? = integerThe Windows attributes
  cx:anti-item? = booleanIs this an “anti-item”?
  cx:size = nonNegativeIntegerThe size of the entry when expanded.
 />

The possible compression methods are “none” (no compression), “lzma”, “lzma2”, “deflate”, “deflate64”, “bzip2”, or “unknown” (if the method was not recognized).

Note

The 7z format calls the compression method that does no compression “copy”. It’s renamed to “none” here for consistency with the XProc archive format.

AR Archives

Entries for AR archives have the following format:

<c:entry
  name = stringThe entry name.
  href = anyURIThe entry URI.
  content-type = stringThe content-type.
  comment? = stringA comment associated with the entry.
  method? = stringThe storage method.
  level? = stringThe compression level.
  cx:mode? = integerThe Unix mode bits.
  cx:mode-string? = stringThe Unix mode as a string.
  cx:group-id = integerThe group id.
  cx:last-modified? = dateTimeThe last modification time.
  cx:size = nonNegativeIntegerThe size of the entry when expanded.
 />

ARJ Archives

Entries for ARJ archives have the following format:

<c:entry
  name = stringThe entry name.
  href = anyURIThe entry URI.
  content-type = stringThe content-type.
  comment? = stringA comment associated with the entry.
  method? = stringThe storage method.
  level? = stringThe compression level.
  cx:mode? = integerThe Unix mode bits.
  cx:mode-string? = stringThe Unix mode as a string.
  cx:windows-attributes = integerThe Windows attributes
  cx:last-modified? = dateTimeThe last modification time.
  cx:host-os? = stringOperating system where the archive was created.
  cx:size = nonNegativeIntegerThe size of the entry when expanded.
 />

The host operating system values are “Amiga”, “Apple IIGS”, “Atari ST”, “DOS”, “MacOS”, “Next”, “OS/2”, “PRIMOS”, “Unix”, “VAX/VMS”, “Windows”, or “Windows95”.

Cpio Archives

Entries for Cpio archives have the following format:

<c:entry
  name = stringThe entry name.
  href = anyURIThe entry URI.
  content-type = stringThe content-type.
  cx:mode? = integerThe Unix mode bits.
  cx:mode-string? = stringThe Unix mode as a string.
  cx:format = new|new-crc|new-mask|old-ascii|old-binary|old-mask|unknownThe CPIO format.
  cx:check-sum? = integerThe check sum.
  cx:dev-major? = integerThe device major number.
  cx:dev-minor? = integerThe device minor number.
  cx:remote-dev-major? = integerThe remote device major number.
  cx:remote-dev-minor? = integerThe remote device minor number.
  cx:device? = stringThe device number.
  cx:remote-device? = stringThe remote device number.
  cx:user-id? = stringThe user id.
  cx:group-id? = stringThe group id.
  cx:last-modified? = dateTimeThe last modification time.
  cx:number-of-links? = stringThe number of links.
  cx:time? = dateTimeThe time of the entry.
  cx:device-type? = block-device|character-device|directory|network|pipe|socket|symbolic-linkThe device type.
  cx:size = nonNegativeIntegerThe size of the entry when expanded.
 />

Integer values are omitted if they are zero.

Tar Archives

Entries for tar archives have the following format:

<c:entry
  name = stringThe entry name.
  href = anyURIThe entry URI.
  content-type = stringThe content-type.
  comment? = stringA comment associated with the entry.
  method? = stringThe storage method.
  level? = stringThe compression level.
  cx:mode = integerThe Unix mode bits.
  cx:mode-string = stringThe Unix mode as a string.
  cx:dev-major? = integerThe device major number.
  cx:dev-minor? = integerThe device minor number.
  cx:group-id = integerThe group id.
  cx:group-name = stringThe group name.
  cx:user-id = integerThe user id.
  cx:user-name = stringThe user name.
  cx:link-flag? = integerThe link flag.
  cx:link-name? = stringThe link name.
  cx:file-creation-time? = dateTimeThe file creation time.
  cx:last-access-time? = dateTimeThe file last access time.
  cx:last-modified? = dateTimeThe last modification time.
  cx:status-change-time? = dateTimeThe file last status change time.
  cx:size = nonNegativeIntegerThe size of the entry when expanded.
 />

The cx:dev-major and cx:dev-minor attributes are omited if they have a value of zero. The cx:link-flag is only present if it isn’t 0 (or ‘0’, 0x30). The cx:link-name is only present if it isn’t null or blank.

An entry with a cx:link-flag of ‘5’ is assumed to be a directory and is omited from the manifest.

Sparse tar entries are not supported.

Zip (and Jar) Archives

Jar archive files are just Zip archives with a different filename extension. Entries have the following format:

<c:entry
  name = stringThe entry name.
  href = anyURIThe entry URI.
  content-type = stringThe content-type.
  comment? = stringA comment associated with the entry.
  method? = stringThe storage method.
  level? = stringThe compression level.
  cx:mode? = integerThe Unix mode bits.
  cx:mode-string? = stringThe Unix mode as a string.
  cx:file-creation-time? = dateTimeThe file creation time.
  cx:last-access-time? = dateTimeThe file last access time.
  cx:last-modified? = dateTimeThe last modification time.
  cx:size = nonNegativeIntegerThe size of the entry when expanded.
 />

The cx:mode and cx:mode-string attributes are omited if the mode value is zero. The possible compression methods are “none” (no compression), “deflated”, or “unknown” (if the method was not recognized).

Notes

  1. Support for the 7z format requires the org.tukaani:xz:1.10 package on the classpath.

  2. The cx:mode-string attribute contains a string representation of the traditional Unix mode bits. For example, -rw-r----- for a file that is readable and writable by the owner, readable by members of the same group, and not accessible by others.

    Generally, the cx:mode and cx:mode-string attributes will either both be present or neither will be present.