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

Re: Variables/Parameters and Scoping

From: Alessandro Vernet <avernet@orbeon.com>
Date: Thu, 18 May 2006 18:08:47 -0700
Message-ID: <4828ceec0605181808l5a390255m633c06d408388c00@mail.gmail.com>
To: public-xml-processing-model-wg <public-xml-processing-model-wg@w3.org>

On 5/18/06, Alex Milowski <alex@milowski.org> wrote:
> <p:let default="input-1">
>
>     <!-- binds the 'x' parameter for the contained steps -->
>     <p:parameter name="x" value="blue"/>
>
>     <!-- selects from the default input and binds it to 'y' -->
>     <p:parameter name="y" select="/doc/title"/>

Alex,

Does this mean that if you want 'x' to be based on 'input-1' and 'y'
on 'input-2' then you need to nested <p:let>? As in:

    <p:let default="input-1">
        <p:param name="x" value="expression on input-1"/>
        <p:let default="input-2">
            <p:param name="y" value="expression on input-2"/>
            <p:step>
                <p:with-parm name="a" select="$x"/>
                <p:with-parm name="b" select="$y"/>
            </p:step>
        </p:let>
    </p:let>

What about just having:

<p:step>
    <p:with-parm name="a"
            select="expression on input-1" labelref="input-1"/>
    <p:with-parm name="b"
            select="expression on input-2" labelref="input-2"/>
</p:step>

This would not allow an expression that uses *both* input-1 and
input-2, hence the proposal of introducing a function instead of the
'labelref' attribute (similar to the instance() function introduced by
XForms):

    <p:step>
        <p:with-parm name="a" select="expression using
            label('input-1') and label('input-2')"/>
    </p:step>

Alex
-- 
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/
Received on Friday, 19 May 2006 01:08:52 GMT

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