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

Re: choose/when

From: Innovimax SARL <innovimax@gmail.com>
Date: Wed, 24 Jan 2007 22:17:04 +0100
Message-ID: <546c6c1c0701241317l56070ad8s1af9b2861e216929@mail.gmail.com>
To: "Norman Walsh" <Norman.Walsh@sun.com>
Cc: public-xml-processing-model-wg@w3.org

Norm,

I would vote for Option 2

But I would also vote for keeping it in sync with p:for-each and p:viewport

Mohamed


On 1/24/07, Norman Walsh <Norman.Walsh@sun.com> wrote:
> The last time we talked about this at a telcon, the minutes[1] record
> three options:
>
> 1. The status quo:
>
>   <p:choose name="version">
>     <p:input port="source">
>       <p:pipe step="prevstep" port="result"/>
>     </p:input>
>
>     <p:when test="/*[@version = 1]">
>       <p:output port="result">
>         <p:pipe step="v1valid" port="result"/>
>       </p:output>
>
>       <p:step type="p:validate" name="v1valid">...</p:step>
>     </p:when>
>
>     <p:when test="/*[@version = 2]">
>       <p:input port="source">
>         <p:pipe step="v2valid" port="result"/>
>       </p:input>
>       <p:output port="result">
>         <p:pipe step="v2valid" port="result"/>
>       </p:output>
>
>       <p:step type="p:validate" name="v2valid">...</p:step>
>     </p:when>
>   </p:choose>
>
> (Yes, I've needlessly repeated the input on both the choose and the
> second when in order to expose the general case)
>
> 2. A nested context with test on the when:
>
>   <p:choose name="version">
>     <p:xpath-context>
>       <p:pipe step="prevstep" port="result"/>
>     </p:xpath-context>
>
>     <p:when test="/*[@version = 1]">
>       <p:output port="result">
>         <p:pipe step="v1valid" port="result"/>
>       </p:output>
>
>       <p:step type="p:validate" name="v1valid">...</p:step>
>     </p:when>
>
>     <p:when test="/*[@version = 2]">
>       <p:xpath-context>
>         <p:pipe step="prevstep" port="result"/>
>       </p:xpath-context>
>       <p:output port="result">
>         <p:pipe step="v2valid" port="result"/>
>       </p:output>
>
>       <p:step type="p:validate" name="v2valid">...</p:step>
>     </p:when>
>   </p:choose>
>
> 3. A nested context with test on the context:
>
>   <p:choose name="version">
>     <p:xpath-context>
>       <p:pipe step="prevstep" port="result"/>
>     </p:xpath-context>
>
>     <p:when>
>       <p:xpath-context test="/*[@version = 1]">
>         <p:pipe step="prevstep" port="result"/>
>       </p:xpath-context>
>       <p:output port="result">
>         <p:pipe step="v1valid" port="result"/>
>       </p:output>
>
>       <p:step type="p:validate" name="v1valid">...</p:step>
>     </p:when>
>
>     <p:when>
>       <p:xpath-context test="/*[@version = 2]">
>         <p:pipe step="prevstep" port="result"/>
>       </p:xpath-context>
>       <p:output port="result">
>         <p:pipe step="v2valid" port="result"/>
>       </p:output>
>
>       <p:step type="p:validate" name="v2valid">...</p:step>
>     </p:when>
>   </p:choose>
>
> It seems to me that one problem with option 3 is that it requires the
> user to provide the xpath-context element in each and every when in
> order to have a place to hang the test attribute.
>
> On that basis, I think the real choice is between options 1 and 2
> unless someone has a third option that I've forgotten to list.
>
> Let's pick one tomorrow!
>
>                                         Be seeing you,
>                                           norm
>
> [1] http://www.w3.org/XML/XProc/2006/12/21-minutes.html#item05
>
> --
> Norman Walsh
> XML Standards Architect
> Sun Microsystems, Inc.
>
>
>


-- 
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 8 72 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 
Received on Wednesday, 24 January 2007 21:17:15 GMT

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