Embedding one pipeline into another (or "defaulting pipeline libraries")

Right now, it seems that if a pipeline author wants to use an addition
pipeline in another one, they must import the pipeline from another file
with p:import.

Embedding the pipeline into the same file is currently impossible, and yet
may be desirable (or required, though I can't image THAT one) in certain
circumstances.

There are two possible solutions I see, both involving p:pipeline-library.

One however is a little too harsh on implementers and impossible in some
environments. And this is to force support of fragment identifiers and/or
xml:id to refer to a certain pipeline in a pipeline library as the starting
pipeline, from which point a pipeline may refer to other pipelines in the
same library (right?).

Having said that, you can guess what the second solution is, since it was
already discussed (and for some reason rejected) - providing a new attribute
in p:pipeline-library which would specify a default pipeline to run if the
pipeline library is invoked with no such fragment identifier. The same
attribute wouldn't have effect when the pipeline is just imported.

This will give a lot of flexibility to XProc, making it much like the XSLT
model with its named templates. I mean, I don't know about you, but
<p:pipeline-library>
<p:pipeline/>
<p:pipeline/>
</p:pipeline-library>
Reminds me a lot about
<xsl:stylesheet>
<xsl:template/>
<xsl:template/>
</xsl:stylesheet>

Providing something like a "default-pipeline" attribute will be like
specifying "initial-template" in XSLT2, which never seemed a bad idea to me.

Regards,
Vasil Rangelov

Received on Thursday, 18 October 2007 21:03:10 UTC