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-macro-definitions.xpl | This is an XProc driver for the xtlc:expand-macro-definitions template in xslmod/macrodefs.mod.xsl . |
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) 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. |
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.4 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.5 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.6 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 |
---|
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 | | '1.0' | The W3C Schema version to use. |
simplify-error-messages | xs:boolean | | false() | Whether to simplify the error messages. Only output the first error. |
3.7 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.8 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.9 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: