The xtpxlib-container component contains the following support (pipelines and/or libraries) for XProc 3.0:

Module/PipelineDescription
container-to-disk.xplWrites an xtpxlib (3) container structure to disk. A base path must be provided, either as option $href-target path or as /*/@href-target.
container-to-zip.xplWrites an xtpxlib (3) container structure to a zip file. A name for the output zip can be specified in either option $href-target-zip or on the container in /*/@href-target-zip.
directory-to-container.xplLoads a directory (with optional sub-directories) into an xtpxlib (3) container structure.
load-for-container.xplLocal support step that loads a single file from a zip or file, and performs all the necessary container loading handling. The result will be a single container entry.
load-from-container.xplStep that loads the files, as specified by a container, that need to be written to disk:
report-error.xplCreates a standard error message for errors occurring in the container pipelines.
zip-to-container.xplLoads the contents of a zip file (directory depth can be set) into an xtpxlib (3) container structure.

4.1 XProc (3.0) pipeline: container-to-disk.xpl

File: xpl3mod/container-to-disk/container-to-disk.xpl

Type: xtlcon:container-to-disk

Writes an xtpxlib (3) container structure to disk. A base path must be provided, either as option $href-target path or as /*/@href-target.

PortTypePrimary?Description
sourceinyesThe container to process.
resultoutyesThe input container structure with additional shadow attributes filled.
OptionTypeRq?DefaultDescription
href-target-pathxs:string? ()Base path where to write the container. When you specify this it will have precedence over a /*/@href-target-path.
remove-targetxs:boolean true()Whether to attempt to remove the target directory before writing.

4.2 XProc (3.0) pipeline: container-to-zip.xpl

File: xpl3mod/container-to-zip/container-to-zip.xpl

Type: xtlcon:container-to-zip

Writes an xtpxlib (3) container structure to a zip file. A name for the output zip can be specified in either option $href-target-zip or on the container in /*/@href-target-zip.

PortTypePrimary?Description
sourceinyesThe container to process.
resultoutyesThe input container structure with additional shadow attributes filled.
OptionTypeRq?DefaultDescription
href-target-zipxs:string? ()Name of the zip file to write. When you specify this it will have precedence over a /*/@href-target-zip.

4.3 XProc (3.0) pipeline: directory-to-container.xpl

File: xpl3mod/directory-to-container/directory-to-container.xpl

Type: xtlcon:directory-to-container

Loads a directory (with optional sub-directories) into an xtpxlib (3) container structure.

PortTypePrimary?Description
resultoutyesThe resulting container structure.
OptionTypeRq?DefaultDescription
add-document-target-pathsxs:boolean false()Copies the relative source path as the target path @target-path for the individual documents.
The idea behind this is that in some cases you want to write almost the same structure back to disk. Recording the relative source path as the target path makes this easier: you don't have to set it explicitly.
depthxs:integer -1The sub-directory depth to go. When lt 0, all sub-directories are processed.
exclude-filterxs:string* '\.git/'Optional regular expression exclude filters. By default, .git directories are excluded.
href-source-directoryxs:stringyesURI of the directory to read.
href-target-pathxs:string? ()Optional target path to record on the container.
The idea behind this is that this makes it easier to write the container back to another location on disk, the target path is already there.
include-filterxs:string* ()Optional regular expression include filters.
json-as-xmlxs:boolean false()When JSON files are loaded (option $load-json is true): whether to add them to the container as XML or as JSON text. It will set the entry's content type to application/json+xml.
load-htmlxs:boolean false()Whether to load HTML files.
load-jsonxs:boolean false()Whether to load JSON files.
load-textxs:boolean false()Whether to load text files.
override-content-typesarray(array(xs:string))? ()Override content types specification (see description of p:directory-list).

4.4 XProc (3.0) pipeline: load-for-container.xpl

File: xpl3mod/local/load-for-container.xpl

Type: xtlcon:load-for-container

Local support step that loads a single file from a zip or file, and performs all the necessary container loading handling. The result will be a single container entry.

PortTypePrimary?Description
resultoutyesThe resulting container entry
OptionTypeRq?DefaultDescription
add-document-target-pathsxs:booleanyesIf true, copies the relative source path as the target path @target-path for the individual documents.
content-typexs:string?yesExpected content-type of the entry.
href-source-absxs:string? ()Absolute filename of the file to load from the file system. Ignored when loading from zip.
href-source-relxs:stringyesRelative filename of the file to load. Used when loading files from a zip and recorded as @href-source on the entry.
href-zipxs:string? ()Name of the zip file to use. If (), load from the file system.
json-as-xmlxs:booleanyesWhen json files are loaded (option $load-json is true): whether to add them to the container as XML or as JSON text. It will set the entry's content type to application/json+xml.
load-htmlxs:booleanyesWhether to load HTML files.
load-jsonxs:booleanyesWhether to load JSON files.
load-textxs:booleanyesWhether to load text files.

4.5 XProc (3.0) pipeline: load-from-container.xpl

File: xpl3mod/local/load-from-container.xpl

Type: xtlcon:load-from-container

Step that loads the files, as specified by a container, that need to be written to disk:

Provides an additional output port "container" that outputs the original container, supplemented with all the appropriate shadow attributes (starting with _).

PortTypePrimary?Description
sourceinyesThe container to load
resultoutyesThe resulting documents with some additional document properties (see pipeline description).
containerout The original container, supplemented with additional shadow attributes for the paths and filenames.
OptionTypeRq?DefaultDescription
do-container-paths-for-zipxs:booleanyesSet to true for container-to-zip, false otherwise.
href-target-pathxs:string? ()Base path where to write the documents, used for computing the target locations. When you specify this it will have precedence over a /*/@href-target-path.
href-target-zipxs:string? ()Zip file location. When you specify this it will have precedence over a /*/@href-target-zip.
main-pipeline-static-base-urixs:stringyesThe static-base-uri() of the calling pipeline.

4.6 XProc (3.0) pipeline: report-error.xpl

File: xpl3mod/local/report-error.xpl

Type: xtlcon:report-error

Creates a standard error message for errors occurring in the container pipelines.

PortTypePrimary?Description
sourceinyesThe original error document (c:errors element).
resultoutyesThis output port is just here for convenience. No document will ever appear on it because the step always fails.
OptionTypeRq?DefaultDescription
error-codexs:QNameyes
href-targetxs:string? ()
messagexs:stringyes

4.7 XProc (3.0) pipeline: zip-to-container.xpl

File: xpl3mod/zip-to-container/zip-to-container.xpl

Type: xtlcon:zip-to-container

Loads the contents of a zip file (directory depth can be set) into an xtpxlib (3) container structure.

PortTypePrimary?Description
resultoutyesThe resulting container structure
OptionTypeRq?DefaultDescription
add-document-target-pathsxs:boolean false()Copies the relative source path as the target path @target-path for the individual documents.
The idea behind this is that in some cases you want to write almost the same structure back to disk or zip. Recording the relative source path as the target path makes this easier: you don't have to set it explicitly.
depthxs:integer -1The sub-directory depth to go. When lt 0, all sub-directories are processed.
exclude-filterxs:string* '\.git/'Optional regular expression exclude filters. By default, .git directories are excluded.
href-source-zipxs:stringyesURI of the zip file to read.
href-target-pathxs:string? ()Optional target path to record on the container.
The idea behind this is that this makes it easier to write the container back to another location on disk, the target path is already there.
include-filterxs:string* Optional regular expression include filters.
json-as-xmlxs:boolean false()When JSON files are loaded (option $load-json is true): whether to add them to the container as XML or as JSON text. It will set the entry's content type to application/json+xml.
load-htmlxs:boolean false()Whether to load HTML files.
load-jsonxs:boolean false()Whether to load JSON files.
load-textxs:boolean false()Whether to load text files.
override-content-typesarray(array(xs:string))? ()Override content types specification (see description of p:archive-manifest).