IntroductionThe Pipeline processor provides support for sub-pipelines in XPL. It allows XPL programs to be used and manipulated like XML processors. It allows building the equivalent of functions and procedures in other programming languages. Inputs and outputs
Example of useLike any XML processor, the Pipeline processor is used from within an XPL pipeline. It is important to make a distinction between the calling XPL pipeline, which is the pipeline making use of the Pipeline processor, and the called XPL pipeline, which is the sub-pipeline called by the calling pipeline. This is similar to other programming language where, for example, a function calls another function. This is an example of using the Pipeline processor in a calling XPL pipeline to call a sub-pipeline:
NOTE:
In this example the
config input is contained in a separate resource
file called get-categories.xpl. Because XPL configurations are usually
fairly long, this is often the preferred way of referring to a pipeline. But as
usual with XPL, it is also possible to inline the content of inputs (as the
query input above shows), or to refer to a dynamically-generated XML
document.
Configuration
The
Optional inputs
Optional inputs allow passing XML documents to sub-pipeline. The example
sub-pipeline above requires a
The caller must therefore pass an XML document that will be received by the
sub-pipeline. This is done by setting, on the Pipeline processor, an input with name
NOTE:
Because the
config input of the Pipeline processor is used to provide
the XPL pipeline, a sub-pipeline should not expose a config input, as
it won't be possible to connect that input.
Other inputs can similarly be passed to the sub-pipeline, simply by connecting inputs on the Pipeline processor that match the names of the inputs declared by the sub-processor. Optional outputs
Optional outputs allow retrieving XML documents produced by a sub-pipeline. The
example sub-pipeline above requires a
The caller, in order to read the
As usual with XPL, the Other outputs of the sub-pipeline can similarly be read, simply by connecting outputs on the Pipeline processor that match the names of the outputs declared by the sub-processor. |