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

p:choose

From: Norman Walsh <Norman.Walsh@Sun.COM>
Date: Thu, 27 Jul 2006 10:50:49 -0400
To: public-xml-processing-model-wg@w3.org
Message-ID: <87ejw7t83a.fsf@nwalsh.com>
I suppose the consistent design for p:choose is:

<p:choose name="pickone">
  <p:declare-input port="input" ref="#some/input"/>
  <p:declare-output port="result"/>
  <p:declare-output port="error"/>

  <p:when test="/fo:root">
    <p:step kind="identity">
      <p:input port="input" ref="#pickone/input"/>
      <p:output port="result" ref="#pickone/result"/>
    </p:step>
    <p:step kind="empty">
      <p:output port="result" ref="#pickone/error"/>
    </p:step>
  </p:when>
  <p:otherwise>
    <p:step kind="empty">
      <p:output port="result" ref="#pickone/result"/>
    </p:step>
    <p:step kind="identity">
      <p:input port="input">
        <p>Root must be fo:root!</p>
      </p:input>
      <p:output port="result" ref="#pickone/error"/>
    </p:step>
  </p:otherwise>
</p:choose>

Here the user declares exactly one input as the input for the tests
and all the outputs that are needed.

Whether we allow "dangling outputs" to be automatically made empty or
if we require them to to be explicitly connected is an open question.

                                        Be seeing you,
                                          norm

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

Received on Thursday, 27 July 2006 14:50:52 GMT

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