Re: p:xslt

2008/12/12 Norman Walsh <ndw@nwalsh.com>:

> 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.

I can see the need... when I need them.
Why are they 'required' and more importantly,
when are they required.
I can't see from the rec where it says any child element of p:xslt is required?



>> 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.

I got a failing pipeline to work, presumably binding to the pipeline
'default' parameter port.


>
> 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.

Ah. Thanks.
OK. 5.1.2
If no binding is provided for a parameter input port other than the
primary parameter input port, then the port will be bound to an empty
sequence of documents.

Does that say the same as what you've just said?
Note the 'other than the primary' bit?



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

Is this the primary parameter port? ... due to it being the only one?
And it's bound to ... ? An empty sequence?
Getting a bit convoluted Norm :-)


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



Different question.
I started this to get a string back from p:system-property()

Do I have to run an xslt step to obtain this?
I.e. to use xpath?


regards



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

Received on Friday, 12 December 2008 14:49:23 UTC