Re: Component interfaces

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" />

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?



Jeni Tennison

Received on Thursday, 12 January 2006 12:17:55 UTC