transpect:dynamic-transformation-pipeline dtp
pubcoach/xpl/dynamic-transformation-pipeline.xpl
Import URI: http://transpect.le-tex.de/book-conversion/converter/xpl/dynamic-transformation-pipeline.xpl
This encapsulates the dynamic loading of an XSLT stylesheet and an XPL pipeline and execution of the pipeline. Dynamic loading means that the most specific (specificity cascade: work, series, publisher, common) XSL and XPL files will be loaded. The pipeline usually consists of transformations with the same dynamically loaded stylesheet in different modes, according to the dynamically loaded pipeline (that consists of transpect:xslt-mode steps). The pipeline may have multiple documents on the source and result ports. The transformation will be applied to each document in turn. Additional input files that will be passed to each transformation may be sent to the additional-input port. They must be wrapped in cx:document with the appropriate port name of the dynamically executed pipeline. Even if you don’t have additional inputs, make sure to always include the additional-inputs port when invoking transpect:dynamic-transformation-pipeline. Connect it to p:empty by default. Please note the difference between a sequence of source documents (will be transformed one by one) and a sequence of additional files (will be available to the dynamically loaded pipeline and will typically be used as additional input documents for some of the letex:xslt-mode steps therein, thus making it available via the default collection in each transformation). There is also an options port. You may submit options in a cx:options document with cx:option entries (with name and value attributes). These options will be merged with the debug and debug-dir-uri options and passed on to the dynamically loaded pipeline. Before preparing a cx:options document, check whether the options can be read in the dynamically invoked pipeline from the primary parameter port.
Visualisation
The pre-creation of this SVG image needs the Graphviz software installed. Please inform your project maintainer.
Input Ports
Name | Documentation | Connections |
---|---|---|
sourceⓅⓈ | ||
additional-inputsⓈ | Additional cx:document(s) whose port(s) attribute(s) designate(s) the input port(s) of the dynamically evaluated XProc step | |
optionsⓈ | Options that will be passed to the pipeline, in a cx:options document | |
pathsⓅ |
Output Ports
Name | Documentation | Connections |
---|---|---|
resultⓅⓈ | A sequence of documents | A sequence of documents |
Options
Name | Documentation | Default |
---|---|---|
load | The base name of the .xsl and .xpl files to load, e.g., foo2bar/foo2bar, where foo2bar is the name of directories in the customization folders for publisher, series, etc. | |
fallback-xsl | Fallback URI to 'default' stylesheet file. Will be loaded when no customization is available in the customization folders for publisher, series, etc. You have to use the URI located in [code repo]/xmlcatalog/catalog.xml together wie the path to the stylesheet. Example (evolve-hub): http://transpect.le-tex.de/evolve-hub/evolve-hub.xsl | '' |
fallback-xpl | Fallback URI to 'default' pipeline file. Leave it empty when no .xpl exists. | '' |
debug | 'no' | |
debug-dir-uri | 'debug' |
Subpipeline
Step | Inputs | Outputs | Options | ||
---|---|---|---|---|---|
p:parameters consolidate-params | result | ||||
p:wrap d287e50 |
| result | wrapper = 'cx:document' match = '/' | ||
p:add-attribute parameters | result | attribute-name = 'port' attribute-value = 'parameters' match = '/*' | |||
p:sink d287e58 |
| ||||
transpect:load-cascaded load-stylesheet |
| result | filename = concat($load, '.xsl') fallback = $fallback-xsl debug = $debug debug-dir-uri = $debug-dir-uri | ||
p:sink d287e74 |
| ||||
p:wrap d287e75 |
| result | wrapper = 'cx:document' match = '/' | ||
p:add-attribute stylesheet | result | attribute-name = 'port' attribute-value = 'stylesheet' match = '/*' | |||
p:sink d287e85 |
| ||||
transpect:load-cascaded pipeline |
| result | filename = concat($load, '.xpl') fallback = $fallback-xpl debug = $debug debug-dir-uri = $debug-dir-uri | ||
p:try validate-pipeline | |||||
p:group d287e99 | |||||
p:validate-with-relax-ng d287e101 |
| result | assert-valid = 'true' | ||
p:sink d287e114 | |||||
p:catch failed | error | ||||
cx:message d287e119 | result | message = concat('Invalid dynamic transformation pipeline (or no pipeline present): ', base-uri(/*), ' Please look for error messages in ', resolve-uri('dynamic-transformation-pipeline.error.xml', $debug-dir-uri)) | |||
p:store d287e127 | result | href = resolve-uri('dynamic-transformation-pipeline.error.xml', $debug-dir-uri) | |||
p:store d287e137 | result | href = resolve-uri(concat('dynamic-transformation-pipeline.error_', replace(base-uri(/*), '^.+/', '')), $debug-dir-uri) | |||
p:xslt options |
| result | template-name = 'main' | ||
p:sink d287e190 | |||||
p:for-each iteration | |||||
p:wrap d287e198 | result | wrapper = 'cx:document' match = '/' | |||
p:add-attribute source | result | attribute-name = 'port' attribute-value = 'source' match = '/*' | |||
p:sink d287e208 | |||||
cx:eval eval |
| result | detailed = 'true' | ||
p:unwrap d287e235 | result | match = '/cx:document[@port eq 'result']' |