XProc Editors Draft 2007-07-19: Section 5.11 Comments

I don't feel extremely strongly about this, but I wonder whether 
<p:pipe> should have reasonable defaults for 'step' and 'port', namely:

'step' defaults to the previous step, or the container step if there's 
no previous step.

If the selected step contains this step (at any level), 'port' defaults 
to the primary input port on that step. Otherwise, 'port' defaults to 
the primary output port of the step. It's an error if 'port' isn't 
specified and there's no primary input port or primary output port, as 
applicable.

This just means that in many cases you don't have to specify both 'step' 
and 'port', and that <p:pipe /> pipes in the default readable port. For 
example, rather than:

<p:for-each name="chapters">
   <p:iteration-source select="//chapter"/>
   <p:output port="html-results">
     <p:pipe step="make-html" port="result"/>
   </p:output>
   <p:output port="fo-results">
     <p:pipe step="make-fo" port="result"/>
   </p:output>

   <p:xslt name="make-html">
     <p:input port="stylesheet">
       <p:document href="http://example.com/xsl/html.xsl"/>
     </p:input>
   </p:xslt>

   <p:xslt name="make-fo">
     <p:input port="source">
       <p:pipe step="chapters" port="current"/>
     </p:input>
     <p:input port="stylesheet">
       <p:document href="http://example.com/xsl/fo.xsl"/>
     </p:input>
   </p:xslt>
</p:for-each>

you could write:

<p:for-each name="chapters">
   <p:iteration-source select="//chapter"/>
   <p:output port="html-results">
     <p:pipe step="make-html" />  <!-- defaults -->
   </p:output>
   <p:output port="fo-results">
     <p:pipe step="make-fo" />    <!-- defaults -->
   </p:output>

   <p:xslt name="make-html">
     <p:input port="stylesheet">
       <p:document href="http://example.com/xsl/html.xsl"/>
     </p:input>
   </p:xslt>

   <p:xslt name="make-fo">
     <p:input port="source">
       <p:pipe step="chapters" />  <!-- defaults -->
     </p:input>
     <p:input port="stylesheet">
       <p:document href="http://example.com/xsl/fo.xsl"/>
     </p:input>
   </p:xslt>
</p:for-each>

Jeni
-- 
Jeni Tennison
http://www.jenitennison.com

Received on Tuesday, 24 July 2007 11:05:37 UTC