p:choose

A choose looks like:

  choose := ($over?, when+, otherwise?)

Where $over must equal the label attribute of some in-scope input
stream.

Each when is considered in document order. The content of the first
when which has a test condition that evaluates to true is used. All
other when (and otherwise) elements are ignored.

If no when is used and an otherwise is specified, then the content of
the otherwise is used.

I'm concerned that we don't have this one very clearly specified
yet. Consider:

  <p:pipeline>
    <p:input name="doc"><doc/></p:input>
    <p:output name="result" from="out"/>

    <p:choose over="doc">
      <p:when test="false()">
        <p:step kind="identity">
           <p:with-input name="input"><foobar/></p:input>
           <p:with-output name="output" label="out"/>
        </p:step>
      </p:when>
    </p:choose>
  </p:pipeline>

This clearly won't work at run time, but is there any way we can
constrain the syntax of the choose elements so that this is manifest
at "compile time"?

I've sketched things out using both p:input/p:output and
p:with-input/p:with-output. The problem is that the semantics are
quite different in this case. Specifically, there's no clear set of
"allowed names" for a choose, the names would have to be unbounded.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
XML Standards Architect
Sun Microsystems, Inc.

Received on Wednesday, 19 July 2006 20:21:20 UTC