Re: Variables again

Norm,

In fact the way you write it wouldn't work for many reason

Here is an attempt to keep the way you wanted to wrote it

<p:pipeline xmlns:p="http://www.w3.org/ns/xproc" name="pipeline">
    <p:input port="data"/>
    <p:www-form-urlencode name="foo" match="toreplace">
        <p:input port="source">
            <p:inline>
                <root>
                    <toreplace/>
                </root>
            </p:inline>
        </p:input>
        <p:with-param name="foo" select="'bar'"/>
        <p:with-param name="bar" select="'baz'"/>
    </p:www-form-urlencode>
    <p:group>
        <p:variable name="url" select=".">
            <p:pipe step="foo" port="result"/>
        </p:variable>
        <p:string-replace match="a/@href">
            <p:input port="source">
                <p:pipe step="pipeline" port="data"/>
            </p:input>
            <p:with-option name="replace" select="concat('concat(.',$url,
')')">
                <p:empty/>
            </p:with-option>
        </p:string-replace>
    </p:group>
</p:pipeline>

Mohamed


On Thu, May 1, 2008 at 6:14 PM, Norman Walsh <ndw@nwalsh.com> wrote:

> Bah. Our decision to allow p:variable only at the start of a compound
> step introduces another spurious group:
>
> <p:url-form-encode name="foo">
>  <p:with-param name="foo" select="'bar'"/>
>  <p:with-param name="bar" select="'baz'"/>
> </p:url-form-encode>
>
> <p:group>
>  <p:variable name="param" select=".">
>    <p:pipe step="foo" port="result"/>
>  </p:variable>
>
>  <p:string-replace match="whatever">
>    <p:input port="source">
>      ...
>    </p:input>
>    <p:option name="replace" select="concat(.,$param)"/>
>  </p:string-replace>
> </p:group>
>
> We made this rule so that we wouldn't have to deal with what happens
> when steps get reordered.
>
> I wonder if it would make sense instead to say:
>
> 1. Variables are attached to the step that follows them.
> 2. No forward references allowed in the (possibly reordered) sequence.
>
>                                        Be seeing you,
>                                          norm
>
> --
> Norman Walsh <ndw@nwalsh.com> | How can there be laughter, how can
> http://nwalsh.com/            | there be pleasure, when the world is
>                              | burning?--The Dhammapada (probably 3rd
>                              | century BC)
>



-- 
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 9 52 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 €

Received on Friday, 2 May 2008 14:35:22 UTC