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

Re: Component interfaces

From: Jeni Tennison <jeni@jenitennison.com>
Date: Thu, 12 Jan 2006 12:17:49 +0000
Message-ID: <1687115530.20060112121749@jenitennison.com>
To: public-xml-processing-model-wg@w3.org

Erik wrote:
> Rui Lopes wrote:
>> My feeling is while named inputs will result in a more verbose
>> language usage, I believe we can benefit from it, since it's more
>> clear. However, I think that mixing stylesheet referencing with
>> other inputs can be somewhat confusing.
>
> An XSLT stylesheet is an XML document like any other, and there are
> uses cases where you may want to dynamically produce an XSLT
> stylesheet from other pipeline steps.

I strongly agree with Erik and Alessandro that we should have named
component parameters (not to be confused with XSLT parameters),
precisely for the reason Erik states above (which is illustrated in
one of my use cases).

>> Providing parameters is crucial, as it allows more flexibility in
>> component usage. A simple example in XSLT: if you want to perform a
>> tree flattening operation when some arbitrary element is found, a
>> single stylesheet does the job (with a parameter defining the
>> element name).  Without parameters, you would have to develop a
>> stylesheet per element.  In extremis, you could have infinite
>> different elements. Parameters should solve this issue.
>
> I think the original question should translate as: do you need, in
> the language, parameters that are not XML documents? If a component
> take multiple inputs, then you can feed it with multiple XML
> documents. An XML document can encapsulate XSLT stylesheet
> parameters, for example.

We're suffering from a terminology problem here: Rui interprets
"parameters" as meaning XSLT parameters (and rightly says that you
sometimes want to pass in values other than XML documents as the
values of XSLT parameters), whereas Erik and Alessandro are talking
about component parameters. Perhaps we should think up another term
for component parameters to avoid this confusion...

I'm not absolutely convinced, though, of Erik and Alessandro's
argument that the only kind of values that component parameters should
take are XML documents. What about the case where I want to run an
XSLT transformation using my-stylesheet.xsl with the initial template
called "main". It would seem easier to be able to do something like:

<process name="xslt">
  <input name="stylesheet" href="my-stylesheet.xsl" />
  <input name="initial-template" value="main" />
  <output href="my-output.xml" />
</process>

rather than construct a new XML document to hold the value "main".

Perhaps I'm misinterpreting, though. Erik, Alessandro: can you outline
how you handle the above case?

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Thursday, 12 January 2006 12:17:55 GMT

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