W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > July 2007

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

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 24 Jul 2007 11:55:13 +0100
Message-ID: <46A5DA91.7000007@jenitennison.com>
To: public-xml-processing-model-wg@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:53 GMT