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

Re: Options or parameters

From: Jeni Tennison <jeni@jenitennison.com>
Date: Fri, 04 May 2007 08:41:37 +0100
Message-ID: <463AE3B1.5050904@jenitennison.com>
To: public-xml-processing-model-wg@w3.org

Henry S. Thompson wrote:
> Having read through this thread, I want to ask a perhaps naive
> question:  why are we requiring parameter declarations at all?

The minutes also report that Henry said that XSLT was the only component 
that would accept parameters. If that were the case, because XSLT 
ignores stylesheet parameters that it doesn't know about, then I would 
be OK with this.

However, I anticipate that the p:http-request component will also accept 
parameters, with a signature something like:

<p:declare-step type="p:http-request">
   ...
   <p:option name="href" required="yes" />
   <p:option name="method" value="GET" />
   <p:option name="version" value="1.1" />
   <p:option name="Authorisation" />
   ... various other options for relevant HTTP headers ...
   <p:parameter name="*" />
</p:declare-step>

The parameters will be used to supply extension headers that aren't 
defined in the HTTP spec.

Now, if *all* parameters in the pipeline get passed into the 
p:http-request component, then you'll end up with a load of extra 
headers being passed with all the HTTP requests, which isn't something 
you want (and might well cause bad behaviour).

Any component where all supplied parameters were processed would run 
into the same problem. For example, say that someone created a component 
to create a URI from a base URI, a relative URI and some request 
parameters. Or a specialised SAX parse component that used parameters to 
set features on the SAX parser.

I don't think we should extend the assumption that unknown parameters 
will be silently ignored to all components, just because XSLT does it. 
Given that, I do think we need a method to explicitly pass only a subset 
of the parameters passed into a pipeline on into a step (ie 
<xsl:import-parameters>).

As far as parameter declarations go, as Alessandro says, I think that 
the vast majority of pipelines won't accept arbitrary parameters. 
Identifying those that do might stop unnecessary information from being 
passed between pipelines. Those pipelines that do accept arbitrary 
parameters may well use namespaces to distinguish between parameters 
targetted at different components,and as such I think it is useful for 
components to declare at least the namespaces of the parameters that 
they accept, to aid error reporting.

Cheers,

Jeni
-- 
Jeni Tennison
http://www.jenitennison.com
Received on Friday, 4 May 2007 18:58:56 GMT

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