| Module/Pipeline | Description |
|---|
copy-dir.xpl | This step copies a directory and all its contents from one location to the other. |
create-clear-directory.xpl | This step does two things: |
expand-generators.mod.xpl | Library with steps for handling generate elements (see ../../xsdmod/generate.mod.xsd). |
expand-macro-definitions.xpl | This is an XProc driver for the xtlc:expand-macro-definitions template in xslmod/macrodefs.mod.xsl. |
is-out-of-date.xpl | Step that finds out if a list of target files is out-of-date against a list of source files. |
message.xpl | |
recursive-directory-list.xpl | Extension of standard the p:directory list step. Returns the contents of a directory, going into sub-directories recursively. Adds the possibility to "flatten" the list. |
subdir-list.xpl | Returns an XML document with the sub-directories of a given directory. |
validate.xpl | This step performs validation using a W3C Schema and/or Schematron. It breaks the processing if something is wrong. |
write-log.xpl | Writes an entry to a log file. |
zip-directory.xpl | Zips a directory into a single zip file. |
3.1 XProc (3.0) pipeline: copy-dir.xpl
File: xpl3mod/copy-dir/copy-dir.xpl
Type: xtlc:copy-dir
This step copies a directory and all its contents from one location to the other.
If $clear-target is true (default), before copying the target directory is cleared/emptied.
If the source directory is empty, it simply creates an empty target directory.
It can do include/exclude filtering, like p:directory-list
The step itself acts as an identity step.
| Port | Type | Primary? | Description |
|---|
source | in | yes | |
result | out | yes | |
| Option | Type | Rq? | Default | Description |
|---|
clear-target | xs:boolean | | true() | Whether to clear the target before copying. |
depth | xs:integer | | -1 | The sub-directory depth to go. When lt 0, all sub-directories are processed. |
exclude-filter | xs:string* | | '\.git/' | Regular expression(s) for files to be excluded from the copy. By default, git directories are excluded |
href-source | xs:string | yes | | The full path/URI of the source directory. If the directory does not exist, nothing will happen. |
href-target | xs:string | yes | | The full path/URI of the target directory. Any non-existing parent directories leading up to this directory will be automatically created. |
include-filter | xs:string* | | () | Regular expression(s) files to be included in the copy. |
3.2 XProc (3.0) pipeline: create-clear-directory.xpl
File: xpl3mod/create-clear-directory/create-clear-directory.xpl
Type: xtlc:create-clear-directory
This step does two things:
When $clear is true, it removes an (optionally) existing directory
Then it makes sure the directory always exists
It doesn't matter whether the directory exists beforehand.
The step itself acts as an identity step.
| Port | Type | Primary? | Description |
|---|
source | in | yes | |
result | out | yes | |
| Option | Type | Rq? | Default | Description |
|---|
clear | xs:boolean | | true() | Whether or not to empty an existing directory. |
href-dir | xs:string | yes | | The full path/URI of the directory to delete. |
3.3 XProc (3.0) library: expand-generators.mod.xpl
File: xpl3mod/expand-generators/expand-generators.mod.xpl
Library with steps for handling generate elements (see ../../xsdmod/generate.mod.xsd).
A generator is either a stylesheet or a pipeline:
The stylesheet gets the generate element as its input.
The pipeline must have a primary input called source and output port called result. Both XML, non-sequence. The generate element will be present on its input port.
The outcome of a generator must be a single well-formed XML document.
If the root element is _GENERATED, it will be removed/unwrapped. This allows returning multiple elements.
If the root element is _EMPTY, the result will be discarded.
| Prefix | Namespace URI |
|---|
xtlc | http://www.xtpxlib.nl/ns/common |
3.3.1 Step: xtlc:expand-generators
Expands all the generate elements in a document.
| Port | Type | Primary? | Description |
|---|
source | in | yes | The document to expand the generate elements in. |
result | out | yes | The resulting document. |
3.3.2 Step: xtlc:handle-generate-element
Handles a single generate element(on its source port).
| Port | Type | Primary? | Description |
|---|
source | in | yes | The generate element to handle |
result | out | yes | The resulting XML. This might be empty. |
3.4 XProc (3.0) pipeline: expand-macro-definitions.xpl
File: xpl3mod/expand-macro-definitions/expand-macro-definitions.xpl
Type: xtlc:expand-macro-definitions
This is an XProc driver for the xtlc:expand-macro-definitions template in xslmod/macrodefs.mod.xsl.
| Port | Type | Primary? | Description |
|---|
source | in | yes | The document to expand the macro definition references in |
result | out | yes | The resulting document with the macro definitions expanded. |
| Option | Type | Rq? | Default | Description |
|---|
add-macrodef-comments | xs:boolean | | false() | Whether to add a macro definition comment (summarizing all macro definitions) when a <*:macrodefs> element is processed. |
expand-in-attributes | xs:boolean | | true() | Whether to expand the macro definitions in attributes. |
expand-in-text | xs:boolean | | true() | Whether to expand the macro definitions in text nodes. |
ignore-attributes | xs:string* | | () | Attribute names to ignore. |
ignore-elements | xs:string* | | () | Element names to ignore. |
macrodefs | map(xs:string, xs:string)* | | () | Any initial macro definitions. |
use-local-macrodefs | xs:boolean | | true() | Check for <*:macrodefs> element as first child and process accordingly |
use-standard-macrodefs | xs:boolean | | true() | Whether to use the standard macro definitions. |
3.5 XProc (3.0) pipeline: is-out-of-date.xpl
File: xpl3mod/is-out-of-date/is-out-of-date.xpl
Type: xtlc:is-out-of-date
Step that finds out if a list of target files is out-of-date against a list of source files.
| Port | Type | Primary? | Description |
|---|
result | out | yes | A single c:result document, containing either true (out-of-date) or false(not out-of-date). |
| Option | Type | Rq? | Default | Description |
|---|
href-sources | xs:string+ | yes | | A list of source files. These files must exist. |
href-targets | xs:string+ | yes | | A list of target files. If one of these does not exist, the whole thing is out-of-date. |
process-xincludes | xs:boolean | | false() | Whether to take XInclude-d files also into account (recursively). |
3.6 XProc (3.0) library: message.xpl
File: xpl3mod/message/message.xpl
| Prefix | Namespace URI |
|---|
xtlc | http://www.xtpxlib.nl/ns/common |
3.6.1 Step: xtlc:message
Writes a message to the console, taking care of indents and a prompt. The step itself acts as an identity step.
| Port | Type | Primary? | Description |
|---|
source | in | yes | |
result | out | yes | |
| Option | Type | Rq? | Default | Description |
|---|
debug | xs:boolean | | false() | Turns the prompt into $debug-marker in-between the prompt characters to signify a debug message. |
debug-marker | xs:string | | $xtlc:default-message-debug-marker | The marker for a debug message. |
enabled | xs:boolean | | true() | Another way to determine whether the message should appear. |
level | xs:integer | | 0 | The indent for the message. |
prompt-string | xs:string | | $xtlc:default-message-prompt | The prompting character(s) to use (after an indent). |
silent | xs:boolean | | false() | Whether the message should appear. |
text | xs:string* | | () | Every member of this sequence gets a line on its own. If empty, an empty line is output. |
3.7 XProc (3.0) pipeline: recursive-directory-list.xpl
File: xpl3mod/recursive-directory-list/recursive-directory-list.xpl
Type: xtlc:recursive-directory-list
Extension of standard the p:directory list step. Returns the contents of a directory, going into sub-directories recursively. Adds the possibility to "flatten" the list.
This step will also not throw an error when the directory does not exist. Instead it will simply return an empty result (with an error="true attribute).
| Port | Type | Primary? | Description |
|---|
result | out | yes | The resulting directory structure in XML format. See the standard p:directory-list step for a more detailed description. |
| Option | Type | Rq? | Default | Description |
|---|
add-decoded | xs:boolean | | false() | When true and $flatten is true, attributes @href-rel-decoded and @href-abs-decoded are added in which any percent encoded characters are decoded. |
depth | xs:integer | | -1 | The sub-directory depth to go. When lt 0, all sub-directories are processed. |
detailed | xs:boolean | | false() | Whether to add detailed information. |
exclude-filter | xs:string* | | '\.git/' | Optional regular expression exclude filters. By default, git directories are excluded. |
flatten | xs:boolean | | false() | When true, the list will be "flattened": All c:file children will be direct children of the root's c:directory element. These c:file elements get a @name, @href-abs (absolute filename) and @href-rel (relative filename) attribute. |
include-filter | xs:string* | | | Optional regular expression include filters. |
override-content-types | array(array(xs:string))? | | () | Override content types specification (see description of p:directory-list). |
path | xs:string | yes | | The path to get the directory listing from. |
3.8 XProc (3.0) pipeline: subdir-list.xpl
File: xpl3mod/subdir-list/subdir-list.xpl
Type: xtlc:subdir-list
Returns an XML document with the sub-directories of a given directory.
<subdir-list href="...">
<subdir href="..." name="..."/>
...
</subdir-list>
If an error occurs, it will only return the root element with an additional error="true" attribute. Will not recurse!
| Port | Type | Primary? | Description |
|---|
result | out | yes | The sub-directory listing (as described above). |
| Option | Type | Rq? | Default | Description |
|---|
path | xs:string | yes | | The path to get the sub-directories from. Always use an absolute path! |
3.9 XProc (3.0) pipeline: validate.xpl
File: xpl3mod/validate/validate.xpl
Type: xtlc:validate
This step performs validation using a W3C Schema and/or Schematron. It breaks the processing if something is wrong.
This might seem superfluous (there are already p:validate-with... steps), but often these steps change the document. This step performs like a real identity step.
| Port | Type | Primary? | Description |
|---|
source | in | yes | Document to validate. |
result | out | yes | The same as the input document. |
| Option | Type | Rq? | Default | Description |
|---|
enabled | xs:boolean | | true() | Whether all validation is enabled. If false, nothing happens. |
href-schema | xs:string? | | () | Optional reference to an W3C Schema to validate the document with. If (), no schema validation will be performed. |
href-schematron | xs:string? | | () | Optional reference to a Schematron Schema to validate the document with. If (), no Schematron validation will be performed. |
schema-version | xs:string? | | () | The W3C Schema version to use. If empty, the pipeline tries to detect the version. |
simplify-error-messages | xs:boolean | | false() | Whether to simplify the error messages. Only output the first error. |
3.10 XProc (3.0) pipeline: write-log.xpl
File: xpl3mod/write-log/write-log.xpl
Type: xtlc:write-log
Writes an entry to a log file.
With regards to documents flowing through, acts like a p:identity step.
| Port | Type | Primary? | Description |
|---|
source | in | yes | Documents will be passed unchanged to the result port. |
result | out | yes | Documents coming from the source port, unchanged. |
| Option | Type | Rq? | Default | Description |
|---|
additional-attributes | map(xs:QName, xs:string)? | | () | A map with additional attributes to add to the log entry's entry element. |
additional-elements | element()* | | () | Elements with additional information to add to this log entry. |
enable | xs:boolean | | true() | Whether the logging will be done at all. |
enable-debug-messages | xs:boolean | | true() | Whether messages with debug status will be written as well. |
href-log | xs:string | yes | | URI of the file to write the log entries to. |
keep-entries | xs:integer | | 0 | The number of entries to keep in the logfile. If le 0, all messages are kept. |
log-comments | xs:string* | | () | Any comments to write as file header when creating a new log file. Ignored on an existing log file. |
messages | xs:string+ | yes | | The actual texts/lines of the log entry to write. All will become a separate message element. |
status | xs:string | | 'info' | Status of the entry. Must be info, warning, error or debug. |
3.11 XProc (3.0) pipeline: zip-directory.xpl
File: xpl3mod/zip-directory/zip-directory.xpl
Type: xtlc:zip-directory
Zips a directory into a single zip file.
| Port | Type | Primary? | Description |
|---|
result | out | yes | The archive manifest of the created zip file. |
| Option | Type | Rq? | Default | Description |
|---|
base-path | xs:string | yes | | URI of the directory which contents will be stored in the zip. |
depth | xs:integer | | -1 | The sub-directory depth to go. When lt 0, all sub-directories are processed. |
exclude-filter | xs:string* | | '\.git/' | Optional regular expression exclude filters. By default, git directories are excluded. |
href-target-zip | xs:string | yes | | URI for the zip file to produce. |
include-base | xs:boolean | | true() | When true, the last part of $base-path (for instance a/b/c ==> c) is used as root directory for entries in the zip file. |
include-filter | xs:string* | | | Optional regular expression include filters. |
3.12 oXygen XProc 3.0 support (oXygen versions < 26)
oXygen versions < 26 had nor editing support for XProc 3.0. The component contains an oXygen framework that enables validating
XProc 3.0 documents. To use this: