- From: Jeni Tennison <jeni@jenitennison.com>
- Date: Mon, 28 May 2007 19:55:56 +0100
- To: public-xml-processing-model-wg <public-xml-processing-model-wg@w3.org>
Alessandro Vernet wrote:
> Instead of adding the concept of parameters to the pipeline language,
> could this be solved by creating a component that makes it easy to
> create a "parameters document" based on options, or the combination of
> options and another "parameters document"?
>
> This would have the following benefits:
>
> 1) We keep the language simple.
> 2) I think it will be easier for us to agree on a component that does
> the things we need rather than agree on a feature of the language.
> Components are much more contained, and easier to modify or deprecate
> in the future if we want to.
Yes. I felt there was a problem doing this because you can't specify
options unless the component has defined them (this being the difference
between options and parameters).
If the in-scope options are passed into every step anyway, then we could
say that the 'p:parameter-set' component accepts an input in which the
<c:parameter> elements can have 'select' attributes which hold XPath
expressions that are evaluated with the in-scope options supplying the
variable bindings.
In other words, you could do:
<p:parameter-set name="xslt-parameters">
<p:input port="source">
<!-- inherit parameters from the parent pipeline -->
<p:pipe step="pipe" source="parameters" />
<!-- add a couple of extra ones based on options -->
<p:inline>
<c:parameters>
<c:parameter name="foo" select="$foo" />
<c:parameter name="baa"
select="translate($foo, 'fo', 'ba')" />
</c:parameters>
</p:inline>
</p:input>
</p:parameter-set>
<p:xslt>
...
<p:input port="parameters">
<p:pipe step="xslt-parameters" source="result" />
</p:input>
</p:xslt>
So I agree that we could *technically* do this, but to be honest I think
creating parameters this way is a huge burden on users (not much better
than not having the <p:parameter-set> step).
Cheers,
Jeni
--
Jeni Tennison
http://www.jenitennison.com
Received on Monday, 28 May 2007 18:56:00 UTC