RE: Possible new XProc 1.1 step: p:template

> Except that the spec says of p:inline:
> 
>    Inline documents are considered “quoted”. The pipeline processor
>    passes them literally to the port, even if they contain elements
>    from the XProc namespace or other namespaces that would have other
>    semantics outside of the p:inline.
> 
> Hence my suggestion with the ugly name p:interpolated-inline.

My (XProc 1.0-based) understanding was that you would simply pass the template to p:template using p:inline (that is, "quoted") or any other binding and the step itself would then do the template processing based on some well-defined logic.

If I were to implement p:template using XProc 1.0, I think I would do something like this:

<p:declare-step type="p:template">
  <p:input port="source" primary="true"/>
  <p:input port="template"/>
  <p:input port="parameters" kind="parameter"/>
  <p:output port="result"/>
  <p:option name="match" required="true"/>
</p:declare-step>

- The "source" input port contains the document that you want to apply the template to (perhaps it could be sequence="true" to allow 0 documents?)
- The "template" input port contains the template document
- The "parameters" parameter input port contains variable bindings that you can refer to in your template
- The "match" option is used for selecting nodes that you want to transform in the input document
- The "output" port contains the transformed document

Now, the annoying part (in my view) is the need to use a parameter port for passing in the variable/option bindings. So in XProc 1.1 we could say that inside p:template, all in-scope variable/option bindings are visible.

Regards,
Vojtech

--
Vojtech Toman
Consultant Software Engineer
EMC | Information Intelligence Group
vojtech.toman@emc.com
http://developer.emc.com/xmltech

Received on Friday, 13 August 2010 17:05:03 UTC