cascade

Libraries to implement a transpect cascade configuration

Repository
Git URLhttps://github.com/transpect/cascade.git
SVN URLhttps://github.com/transpect/cascade
Base URIhttp://transpect.io/cascade/

Source ⬇

tr:directory-loop

The step performs a recursive directory listing and looks for parameter documents named 'params.xml'. The parameter documents are included in the XML directory listing.

Import

<p:import href="http://transpect.io/cascade/xpl/directory-loop.xpl"/>

Dependencies

Synopsis

<tr:directory-loop xmlns:tr="http://transpect.io">
  <p:output port="result"/>
  <p:option name="depth" select="-1"/>
  <p:option name="path" required="true"/>
  <p:option name="exclude-filter"/>
</tr:directory-loop>

tr:identity-fallback

Import

<p:import href="http://transpect.io/cascade/xpl/dynamic-transformation-identity-fallback.xpl"/>

Synopsis

<tr:identity-fallback xmlns:tr="http://transpect.io">
  <p:input port="source" primary="true"/>
  <p:input port="stylesheet"/>
  <p:input port="meta"/>
  <p:input port="parameters" primary="true"/>
  <p:output port="result" primary="true"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri"/>
</tr:identity-fallback>

tr:dynamic-transformation-pipeline

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 tr: 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 tr: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 tr: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 tr:xslt-mode steps therein, thus making it available via the default collection in each transformation).

There is a limitation that additional inputs are limited to single documents per port. If you have a sequence, you’ll have to wrap it into a custom element before wrapping it in the cx:document.

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.

Import

<p:import href="http://transpect.io/cascade/xpl/dynamic-transformation-pipeline.xpl"/>

Dependencies

Synopsis

<tr:dynamic-transformation-pipeline xmlns:tr="http://transpect.io">
  <p:input port="source" sequence="true" primary="true"/>
  <p:input port="additional-inputs" sequence="true" primary="false"/>
  <p:input port="options" sequence="true"/>
  <p:input port="paths" primary="true"/>
  <p:output port="report" sequence="true"/>
  <p:output port="result" sequence="true" primary="true"/>
  <p:option name="load"/>
  <p:option name="fallback-xsl" required="false" select="''"/>
  <p:option name="fallback-xpl" required="false" select="''"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri" required="false" select="'debug'"/>
</tr:dynamic-transformation-pipeline>

tr:get-clades-from-dirs

This step converts a transpect clades document from the output of tr:directory-loop. The clades document can be used as input for the tr:paths step.

Import

<p:import href="http://transpect.io/cascade/xpl/get-clades-from-dirs.xpl"/>

Dependencies

Synopsis

<tr:get-clades-from-dirs xmlns:tr="http://transpect.io">
  <p:input port="params"/>
  <p:output port="result" primary="true"/>
  <p:output port="directory-param-sets" primary="false"/>
  <p:option name="debug" select="'yes'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="status-dir-uri" select="concat($debug-dir-uri, '/status')"/>
</tr:get-clades-from-dirs>

tr:load-cascaded

Loads the most specific XML file $filename from a sequence of paths, supplied as parameters on the paths port ($s9y1-path, $s9y2-path, …, in descending specificity). The XML file can be an XProc pipeline, an XSLT stylesheet, a Schematron schema, an XHTML file, whatever. If no document named {$filename} is found at a given path, it checks whether {$filename}.xsl exists. If it exist, the main template of this XSL is invoked and this should return the document that was originally expected at {$filename}. If neither a proper {$filename} nor {$filename}.xsl can be found under any of the paths, and if a non-empty option $fallback is specified, the fallback file will be used.

Import

<p:import href="http://transpect.io/cascade/xpl/load-cascaded.xpl"/>

Dependencies

Synopsis

<tr:load-cascaded xmlns:tr="http://transpect.io">
  <p:input port="paths" primary="true"/>
  <p:input port="source" sequence="true" primary="true"/>
  <p:input port="catalog" sequence="true"/>
  <p:output port="result" primary="true"/>
  <p:option name="filename" required="true"/>
  <p:option name="required" required="false" select="'yes'"/>
  <p:option name="fallback" required="false" select="''"/>
  <p:option name="set-xml-base-attribute" required="false" select="'yes'"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri"/>
</tr:load-cascaded>

tr:load-cascaded-binary

Import

<p:import href="http://transpect.io/cascade/xpl/load-cascaded.xpl"/>

Dependencies

Synopsis

<tr:load-cascaded-binary xmlns:tr="http://transpect.io">
  <p:input port="paths" primary="true"/>
  <p:output port="result" primary="true"/>
  <p:option name="filename" required="true"/>
  <p:option name="required" required="false" select="'yes'"/>
  <p:option name="fallback" required="false" select="''"/>
  <p:option name="result-with-file-prefix" required="false" select="'no'"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri"/>
</tr:load-cascaded-binary>

tr:load-whole-cascade

Loads all documents of a specific name from the path cascade. With the default order of 'least-specific-first', the most generic document will be first, the most specific last. The option 'order' may be set to 'most-specific-first'.

Import

<p:import href="http://transpect.io/cascade/xpl/load-cascaded.xpl"/>

Synopsis

<tr:load-whole-cascade xmlns:tr="http://transpect.io">
  <p:input port="paths" primary="true"/>
  <p:output port="result" sequence="true" primary="true"/>
  <p:option name="filename" required="true"/>
  <p:option name="order" select="'least-specific-first'"/>
</tr:load-whole-cascade>

tr:paths

This step provides the transpect cascade paths document for a given filename. The filename is passed with the file option.

The step takes two inputs. First, the step expects a transpect clades configuration. Clades are a hierarchical structure of configuration layers. These layers are typically represented as directories on the filesystem, where transpect steps search for overrides. Second, the step takes an XSLT stylesheet. The stylesheet imports the paths.xsl and is used to override some of its functions, especially for detecting clades based upon file names or other strings.

A RelaxNG schema for the clades configuration is here: ../schema/cascade.rng.

Import

<p:import href="http://transpect.io/cascade/xpl/paths.xpl"/>

Dependencies

Synopsis

<tr:paths xmlns:tr="http://transpect.io">
  <p:input port="conf"/>
  <p:input port="stylesheet" primary="true"/>
  <p:input port="params" sequence="true" primary="false"/>
  <p:output port="result" primary="true"/>
  <p:output port="report" sequence="true" primary="false"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="status-dir-uri" select="'status'"/>
  <p:option name="interface-language" select="'en'"/>
  <p:option name="clades" select="''"/>
  <p:option name="file" required="true"/>
  <p:option name="pipeline" select="'unknown'"/>
  <p:option name="progress" select="'no'"/>
  <p:option name="progress-to-stdout" required="false" select="'no'"/>
  <p:option name="determine-transpect-project-version" required="false" select="'no'"/>
</tr:paths>

GitHub sync date: 2017-07-06+02:00