Proposal for changing choose/when/otherwise

The following proposal changes p:choose/p:when/p:otherwise to remove
the syntactic inconsistency.

4.2.9 p:choose/p:when/p:otherwise Elements

A p:choose represents a choose.

<p:choose
  name = NCName>
   (p:input?,
    p:output*,
    p:when*,
    p:otherwise?)
</p:choose>

At most one input may be declared. If an input is declared, it must
include a binding for the port it declares.

The single input declared provides a context in which the XPath
expressions that occur on each branch are evaluated. If a context is
specified, it must be specified in exactly one of three ways,
by source, by URI, or by here document.

If outputs are declared, they must also include a binding. All of the
p:when branches and the p:otherwise must declare the same number of
output ports with the same names. It is a static error if they do not.

Each conditional subpipeline is represented by a p:when element.

<p:when
  test = expression>
   (p:input?,
    p:output*,
    p:parameter*,
    subpipeline)
</p:when>

At most one input may be declared. If an input is declared, it must
include a binding for the port it declares. If outputs are declared,
they must also include a binding.

The single input declared provides a context in which the XPath
expression that occurs on this branch is evaluated. If a context is
specified, it must be specified in exactly one of three ways,
by source, by URI, or by here document.

If no context is specified on the p:when, the context specified on the
p:choose is used. It is a static error if no context is specified in
either place.

The test attribute provides the guard expression for the subpipeline.

The default branch is represented by a p:otherwise element.

<p:otherwise>
   (p:output*,
    p:parameter*,
    subpipeline)
</p:otherwise>

The result of the p:choose is the result of the selected subpipeline.
It is a dynamic error if no p:when is selected and no p:otherwise is
specified.

                                        Be seeing you,
                                          norm

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

Received on Thursday, 19 October 2006 19:00:16 UTC