W3C home > Mailing lists > Public > xproc-dev@w3.org > December 2008

Re: p:xslt

From: mozer <xmlizer@gmail.com>
Date: Fri, 12 Dec 2008 15:37:26 +0100
Message-ID: <21d9ade60812120637p453176d1scc51d34659115b9b@mail.gmail.com>
To: "Norman Walsh" <ndw@nwalsh.com>
Cc: "XProc Dev" <xproc-dev@w3.org>

Well

I'm in trouble with your point 2)

2. If there is no binding for a parameter input port on the top level
> pipeline (the one that you start executing first), then it
> automatically gets bound to an empty document.

Did you really mean that ?

Xmlizer

On Fri, Dec 12, 2008 at 3:15 PM, Norman Walsh <ndw@nwalsh.com> wrote:
> "Dave Pawson" <dave.pawson@gmail.com> writes:
>
>>>From http://www.w3.org/TR/xproc/#c.xslt
>> it is not obvious which 'parameters'  (xml child elements)
>> are optional, which are required.
>
> Parameters suck. The WG tried on several occasions to find a way to
> get rid of them, but we couldn't. Simply removing them would have made
> it impossible to pass parameters to XSLT stylesheets, which would have
> made XProc far, far less useful.
>
>> <p:xslt name="trsf">
>>   <p:input port='stylesheet'>
>>     <p:document href="step1.xsl"/>
>>   </p:input>
>> </p:xslt>
>>
>> Is resulting in an error
>>  Pipeline failed: err:XS0055: Parameter input parameters unbound on
>> p:xslt step named trsf and no default binding available.
>>
>> Why is the parameter parameter 'required' seemingly?
>
> It's a port, a special kind of port. It has different binding rules
> that (often) make life simpler for authors. But not always.
>
> Here's how it works.
>
> 1. If you don't specify a binding for the 'parameter' port, then it
> binds by default to the parameter port of the pipeline that contains
> it. This way, parameters you pass to the pipeline automatically get
> passed to the steps that can use them.
>
> 2. If there is no binding for a parameter input port on the top level
> pipeline (the one that you start executing first), then it
> automatically gets bound to an empty document.
>
> 3. If you declare your pipeline with <p:pipeline>, you get a parameter
> input port by default and things "just work".
>
> 4. But if you declare your pipeline with <p:declare-step>, as I usually
> do, then you have to either remember to provide a parameter input port
> explicitly:
>
>  <p:declare-step ...>
>    <p:input port="parameters" kind="parameter"/>
>    <p:input port="source"/>
>    ...
>
> Or you have to remember to explicitly provide a binding when you use
> the XSLT step:
>
>  <p:xslt>
>    <p:input port="parameters">
>      <p:empty/>
>    </p:input>
>    ...
>
> Like I said, they suck.
>
>> I'm guessing this relates to params passed to the xslt processor?
>
> Yep.
>
>                                        Be seeing you,
>                                          norm
>
> --
> Norman Walsh <ndw@nwalsh.com> | One's never alone with a rubber duck.
> http://nwalsh.com/            |
>
Received on Friday, 12 December 2008 14:38:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 12 December 2008 14:38:01 GMT