Re: Proposal for changing choose/when/otherwise


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"
   <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 name="xform-to-html" type="p:xslt">
     <p:input name="document" step="chapters" source="chap"/>
     <p:input name="stylesheet" href="html/docbook.xsl"/>

<p:viewport name="encdivs"
             step="step" source="port"
   <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"/>

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 



Jeni Tennison

Received on Saturday, 21 October 2006 19:48:23 UTC