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

Re: Proposal for changing choose/when/otherwise

From: Jeni Tennison <jeni@jenitennison.com>
Date: Sat, 21 Oct 2006 20:48:17 +0100
Message-ID: <453A7981.3060309@jenitennison.com>
To: public-xml-processing-model-wg@w3.org

Hi,

Norman Walsh wrote:
> The following proposal changes p:choose/p:when/p:otherwise to remove
> the syntactic inconsistency.

I'm very much in favour of making the syntaxes of 
p:choose/p:when/p:otherwise, p:for-each and p:viewport consistent with 
each other. But, as I've argued before [1], I think that this should be 
done by changing p:for-each and p:viewport so that the 
(((step,source)|href),select) attributes appear on those elements, 
rather than a separate <p:input>. A <p:input> is still needed to specify 
the name of the source that's visible to the steps within the 
<p:for-each> or <p:viewport>.

Using the examples from the spec, I'd like to see:

<p:for-each name="chapters"
             href="http://example.org/docbook.xml"
             select="//chapter">
   <p:input port="chap"/>
   <p:output port="html" step="xform-to-html source="result"/>
   <p:output port="fo" step="xform-to-fo" source="result"/>
   <p:step name="xform-to-fo" type="p:xslt">
     <p:input name="document" step="chapters" source="chap"/>
     <p:input name="stylesheet" href="fo/docbook.xsl"/>
   </p:step>
   <p:step name="xform-to-html" type="p:xslt">
     <p:input name="document" step="chapters" source="chap"/>
     <p:input name="stylesheet" href="html/docbook.xsl"/>
   </p:step>
</p:for-each>

<p:viewport name="encdivs"
             step="step" source="port"
             subtrees="//h:div[@class='enc']">
   <p:input port="div" />
   <p:output port="html" step="encrypt" source="result"/>
   <p:step name="encrypt" type="p:encrypt-document">
     <p:input name="document" step="encdivs" source="div"/>
   </:step>
</p:viewport>

Note that I've changed the 'select' on the viewport to 'subtrees' to 
reflect the different semantic of the XPath (which doesn't create new 
input documents but selects subtrees within the given input document(s)).

Conversely, giving <p:when> a <p:input> that specifies the context of 
the test on the <p:when> seems really confusing to me. It also leads one 
to think that there is a new source visible within the contained steps 
of the <p:when>/<p:otherwise>, but I don't think that's meant to be the 
case.

Cheers,

Jeni

[1] 
http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2006Aug/0029.html
-- 
Jeni Tennison
http://www.jenitennison.com
Received on Saturday, 21 October 2006 19:48:23 GMT

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