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

Re: p:choose

From: Alessandro Vernet <avernet@orbeon.com>
Date: Wed, 19 Jul 2006 23:53:58 -0700
Message-ID: <4828ceec0607192353m1cfaca4bkeb3180ea50b24565@mail.gmail.com>
To: public-xml-processing-model-wg <public-xml-processing-model-wg@w3.org>

Norm,

On 7/19/06, Norman Walsh <Norman.Walsh@sun.com> wrote:
> A choose looks like:
>
>   choose := ($over?, when+, otherwise?)

Any reason we wouldn't reuse the 'from' attribute we have on the
<p:with-input> instead of introducing a new 'over' attribute? Should
we also allow an 'href' here, to be consistent with the
<p:with-input>?

> 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"?

In XPL as we have initially implemented it (and how it is still
implemented and used today), there is no <p:output> in <p:choose>, as
in your proposed syntax. The labels (to use our current terminology)
exposed to the outside by the <p:choose> are determined automatically
by the engine.

In the XPL implementation, the engine determines for each <p:when> or
<p:otherwise> what the set of exposed labels is. It does this by
taking for each <p:when> or <p:otherwise> all the labels that are
declared, but not used. Then it checks that each <p:when> or
<p:otherwise> declared the exact same set of labels. This test can be
performed statically, which IMHO is a good thing, but this method has
some downsides.

Because of those downsides, in our XPL submission
(http://www.w3.org/Submission/xpl/), we have introduced an element to
declare the output of a <p:choose>. I still think this is a good idea:
it allows static checking and avoids some strange cases that come up
when using the above algorithm. A <p:choose> would look like:

<p:choose>
    <p:choose-output label="..." from="..."/>
    'label' is the label exposed to the outside of the <p:choose>
    'from' is a reference to a label that must be declared by each
    branch of the <p:choose>
    ...
</p:choose>

Alex
-- 
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/
Received on Thursday, 20 July 2006 06:54:06 GMT

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