W3C home > Mailing lists > Public > xproc-dev@w3.org > November 2013

RE: embedded pipelines

From: Paul Tyson <phtyson@sbcglobal.net>
Date: Sat, 09 Nov 2013 08:50:52 -0600
To: Geert Josten <geert.josten@dayon.nl>
Cc: xproc-dev@w3.org
Message-Id: <1384008652.6032.28.camel@tristan>
Hi Geert,

Thanks for the pointers. I looked at
http://www.w3.org/TR/xproc-template/, and it is sort of what I have in
mind. However, I want to put entire pipelines in the template, not just
XPath expressions, as provided by p:template. 

I cannot find any documentation for p:document-template in current
Calabash documentation. I only see references to it in mailing list
archive. It might be what I'm looking for.

For example:

<p:declare-step type="my:query-and-transform">
  <p:option name="query-text"/>
  <p:option name="transform-spec"/>
  <!-- everything needed to connect to data source, run the query, and
       transform the results -->
  <!-- these sorts of pipelines could be defined in any of
       several different ways, as appropriate for the application -->
</p:declare-step>

<px:replace-pipeline>
  <p:input port="source">
    <p:inline>
      <html xmlns="http://www.w3.org/1999/xhtml">
       <head><title>Title</title></head>
       <body>
         <my:query-and-transform>
           <!-- options for this content chunk -->
         </my:query-and-format>
         <my:query-and-transform>
           <!-- options for this content chunk -->
         </my:query-and-transform>
       </body>
     </html>
    </p:inline>
  </p:input>
</px:replace-pipeline>

The effect of px:replace-pipeline (analagous to p:replace and
p:replace-string) would be to transform the input document by replacing
the embedded pipelines with their result documents.

Note that the embedded pipelines could themselves have templates as
input documents, allowing construction of template trees with very
flexible run-time behavior controlled by parameter inputs.

Regards,
--Paul

On Sat, 2013-11-09 at 14:22 +0100, Geert Josten wrote:
> Hi Paul,
> 
> Could you give a small example?
> 
> It does sound like related to p:document-template and p:template, but not
> sure if those extensions from XMLCalabash are still working, and supported..
> 
> Cheres,
> Geert
> 
> > -----Oorspronkelijk bericht-----
> > Van: Paul Tyson [mailto:phtyson@sbcglobal.net]
> > Verzonden: zaterdag 9 november 2013 4:32
> > Aan: xproc-dev@w3.org
> > Onderwerp: embedded pipelines
> >
> > I don't know if this is in the Xproc standard (some parts are still a
> > mystery to me), or if it has been implemented anywhere, but I wanted to
> > put it out for comment.
> >
> > It would sometimes be convenient to embed pipeline steps in a
> > (non-xproc) XML document, and then perform an xproc step on the
> > document
> > with the effect of replacing all the embedded pipelines with their
> > results. The input document would serve as a template, with replaceable
> > content specified by the pipeline steps.
> >
> > This would work like p:replace, except that the invocation would not
> > specify what parts of the input document to work on or what to do with
> > them: the "match" expression would be fixed to select all pipeline steps
> > in the input, and the "replacement" document would be the result of
> > evaluating each pipeline. The outer pipeline author and the template
> > authors would have to arrange for the embedded steps and all resources
> > to be known and available in the processing context.
> >
> > For example, well-formed xhtml or xsl-fo documents could contain
> > pipeline steps that would expand to the intended content based on
> > parameter inputs. This approach would lend itself to easier analysis,
> > documentation, and maintenance than other popular templating
> > mechanisms.
> >
> > This is a similar concept to the "simplified" XSLT templates, by which
> > any XML document can be treated as an XSLT stylesheet, with restrictions
> > on the xslt features that can be included.
> >
> > If others think this might be useful, consider adding it to the
> > requirements for Xproc v2.
> >
> > Regards,
> > --Paul
> >
> 
Received on Saturday, 9 November 2013 14:51:22 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:11 UTC