tr:load-cascaded (in library load-cascaded.xpl) 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.

Output Ports

NameDocumentationConnections

result

Options

NameDocumentationDefault

filename

required

'yes'

fallback

''

set-xml-base-attribute

'yes'

debug

'no'

debug-dir-uri

Subpipeline

StepInputsOutputsOptions

p:xslt load-cascaded-xsl

source

p:empty

parameters

paths on load-cascaded

stylesheet

p:documenthttp://transpect.io/cascade/xsl/load-cascaded.xsl

result

template-name = 'main'

p:sink d104e53

source

result on load-cascaded-xsl

p:choose potentially-eval-returned-xsl

replace(base-uri(/*), '^.+/', '') = concat(replace($filename, '^.+/', ''), '.xsl')

p:xslt d104e65

source

p:empty

parameters

paths on load-cascaded

stylesheet

result on load-cascaded-xsl

result

template-name = 'main'

p:otherwise

p:identity d104e84

source

result on load-cascaded-xsl

result

tr:store-debug store-debug

source

result

active = $debug

base-uri = $debug-dir-uri

pipeline-step = replace($filename, '^(.+?)\.([^/]+)$', '$1')

extension = replace($filename, '^(.+?)\.([^/]+)$', '$2')