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

Re: Options or parameters

From: Alessandro Vernet <avernet@orbeon.com>
Date: Tue, 1 May 2007 18:41:31 -0700
Message-ID: <4828ceec0705011841l3245915do277eb7496b8aec24@mail.gmail.com>
To: public-xml-processing-model-wg <public-xml-processing-model-wg@w3.org>

On 5/1/07, Norman Walsh <ndw@nwalsh.com> wrote:
> 1. Add in-scope options to the environment; treat options and parameters
>    in exactly the same way with respect to scoping and shadowing.
> 2. Allow compound steps to declare both options and parameters.

Yes.

> 3. Make variable references in XPath expressions refer to *options*
>    instead of parameters.

If a pipeline can accepts both options and parameters, you will have
some use cases where you need to access options by name and others
where you need to access parameters by name. A proposal that lets you
access only options or parameters (but not both) won't be
satisfactory.

For instance consider the case of a pipeline that automatically sets
the value of a parameter based on the value of some other parameter
you pass to the pipeline:

<p:pipeline name="my:foo">
    <p:input port="source"/>
    <p:output port="result"/>
    <p:parameter name="param-a"/>
    <p:parameter name="*"/>
    <p:group>
        <p:parameter name="param-b" value="$param-a"/>
        <p:xslt2>
            <p:input port="stylesheet">
                <p:document href="foo2html.xsl"/>
            </p:input>
            <p:import-parameter name="*"/>
        </p:xslt2>
    </p:group>
</p:pipeline>

> 4. Allow p:import-parameter to change the namespace of parameters.

I am not sure we need this. I would consider this for V.next.

> The distinction between options and parameters then becomes simply that
> the names of options are all known in advance. The names of parameters
> may not be.

Yes, the name options are known in advance. But the names of
parameters may be known in advance as well and have a particular
significance to the pipeline. Imagine a pipeline that receives HTTP
request headers. Headers are passed to the pipeline as parameters. The
pipeline delegates part of the processing to some components passing
all the headers. Here HTTP request parameters are seen by the pipeline
as a bag of name/value, but it might still recognize some specific
header and do something special with those headers. Hence the need to
access those by name.

Alex
-- 
Orbeon Forms - Web 2.0 Forms for the Enterprise
http://www.orbeon.com/
Received on Wednesday, 2 May 2007 01:41:34 GMT

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