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

Re: Variables again

From: Innovimax SARL <innovimax@gmail.com>
Date: Thu, 1 May 2008 21:58:06 +0200
Message-ID: <546c6c1c0805011258y30fc70cbn5f0449e0cc0fa129@mail.gmail.com>
To: "Norman Walsh" <ndw@nwalsh.com>
Cc: public-xml-processing-model-wg@w3.org
Here is another way to write 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: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(.,',/root,
')')">
           <p:pipe step="foo" port="result"/>
        </p:with-option>
    </p:string-replace>
</p:pipeline>


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 Thursday, 1 May 2008 19:58:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 1 May 2008 19:58:47 GMT