RE: Initialize a variable with a parameter port

Actually, I don't really understand why the parameters port is returning a
sequence at all. Can anyone give a use case for that? I was kinda
surprised it isn't normalized with a p:parameters under the hood by
default..

About sequence input: if you use the ut:parameters within a declare-step
that has non-sequence primary input, ut:parameters will receive just a
single doc and pass that through identically. So, it works anyhow. But
perhaps useful for static analysis. Though, it is my impression, it isn't
that advanced yet. (These no-doc or multi-doc errors could be prevented
with it largely I'd think. Not sure though, always tricky cases like an
XSLT producing wrong results..)

Kind regards,
Geert

-----Oorspronkelijk bericht-----
Van: fgeorges@gmail.com [mailto:fgeorges@gmail.com] Namens Florent Georges
Verzonden: dinsdag 22 november 2011 1:19
Aan: Geert Josten
CC: Norman Walsh; XProc Dev
Onderwerp: Re: Initialize a variable with a parameter port

On 21 November 2011 21:57, Geert Josten wrote:

  Hi,

> You can put it just below your inputs, outputs and options as a
> simple <ut:parameters name="params"/>. After that you have to
> use a p:group, and declare p:variables at the top of that with
> a <p:pipe step="params" port="parameters"/>.

  Yes, that's more or less what I had in mind too.  The problem
for a generic step is that you have to choose between a sequence
or not for the primary input port (which is supposed to be the
pass-through).  Probably both ut:parameters and ut:parameters-seq
would make sense then...

  Nice library of tools, BTW :-)

  Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/

Received on Tuesday, 22 November 2011 06:44:35 UTC