The component contains a framework for oXygen that enables it to validate XProc 3.0 documents. To use this:
Add the framework to the oXygen configuration:
Menu: Options / Preferences…
Navigate to: Document Type Association / Locations
Add the full path to xtpxlib-common/frameworks
Navigate on up to: Document Type Association
Check that the XProc 3.0 framework is enabled
Disable the use of the XProc 1.0 support in oXygen. To do this:
Menu: Options / Preferences…
Navigate to: File types
Associate the file types that you use for XProc 3.0 (in my case .xpl
files) with the plain XML editor
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: |
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. |
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. |
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. |
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. |
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. |
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. |
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 . |
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. |