Re: Variables/Parameters and Scoping

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 UTC