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

p:choose

From: Norman Walsh <Norman.Walsh@Sun.COM>
Date: Wed, 19 Jul 2006 16:19:10 -0400
To: public-xml-processing-model-wg@w3.org
Message-ID: <87hd1duz41.fsf@nwalsh.com>
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 GMT

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