hub:evolve-hub evolve-hub

evolve-hub/xpl/evolve-hub.xpl

Import URI: http://transpect.io/evolve-hub/xpl/evolve-hub.xpl

evolve-hub deals with up-converting flat hub to hub documents with proper lists, hierarchies, etc. This is the up-conversion part where most knowledge about layout and style names (e.g., for headings or box types) comes into play. Therefore it is essential that everything is customizable per imprint, series, work, etc.

The basic evolve-hub.xsl library is an XSLT micropipeline. It uses some meta-information from the hub input data to determine whether the document is already purportedly hierarchized or contains proper lists. But other than some branching according to these document properties and XSLT’s import mechanism (that allows for clumsy reshuffling of the default pipeline), the pipeline is of a fixed, one-size-fits-all kind.

Therefore we outsource the pipelining part to XProc here, and we allow evaluation of pipelines that are determined dynamically at runtime.

This front-end pipeline step loads dynamically evolve-hub/driver.xpl and evolve-hub/driver.xsl from the first configuration directory where it can find each file. The directories searched are, in that order, from higher to lower specificity: work, series, publisher, common. driver.xsl imports the central evolve-hub.xsl and typically configures variables for the relevant modes. driver.xpl is a custom pipeline that orchestrates some or all of the modes available in evolve-hub.

Please note that every transformation in evolve-hub.xpl always uses the same XSLT, namely the most specific driver.xsl that could be found.

If templates are needed that aren’t included in evolve-hub or driver.xsl, they’d have to be imported by driver.xsl, too.

Also note that driver.xsl and driver.xpl don’t need to reside in the same configuration directory. You might perfectly well use the common pipeline together with a series’ XSLT stylesheet. The tr:load-cascaded mechanism will take care of loading the most specific available of each file type.

If some (not just one, not all) series would like to share a pipeline or an XSLT stylesheet, they should create the corresponding files at some location (= for some series) and create stub pipelines/stylesheets in the other locations. These stubs should simply import the master series’ files.

Input Ports

NameDocumentationConnections

source

paths

Output Ports

NameDocumentationConnections

result

Options

NameDocumentationDefault

load

'evolve-hub/driver'

srcpaths

'no'

debug

'no'

debug-dir-uri

'debug'

status-dir-uri

'status'

fallback-xsl

'http://transpect.io/evolve-hub/xsl/evolve-hub.xsl'

fallback-xpl

'http://transpect.io/evolve-hub/xpl/fallback.xpl'

Subpipeline

StepInputsOutputsOptions

tr:simple-progress-msg start-msg

source

source paths on evolve-hub

msgs

 <c:messages>
   <c:message xml:lang="en">Starting upconversion of flat Hub XML (section hierarchies etc.)</c:message>
   <c:message xml:lang="de">Beginne Hochkonvertierung des flachen Hub XML (Überschriftenhierarchie etc.)</c:message>
 </c:messages>

result

file = 'evolve-hub-start.txt'

status-dir-uri = $status-dir-uri

tr:dynamic-transformation-pipeline d98e37

Example Pipelines

paths

result on start-msg

additional-inputs

p:empty

options

p:empty

result

fallback-xpl = $fallback-xpl

fallback-xsl = $fallback-xsl

debug = $debug

debug-dir-uri = $debug-dir-uri

load = $load

tr:simple-progress-msg success-msg

source

result on d98e37

msgs

 <c:messages>
   <c:message xml:lang="en">Successfully evolved Hub XML</c:message>
   <c:message xml:lang="de">Evolution des flachen Hub XML erfolgreich abgeschlossen</c:message>
 </c:messages>

result

file = 'evolve-hub-success.txt'

status-dir-uri = $status-dir-uri