RE: Revisiting "fixing parameters"

> > The main change for parameters would be that you would have to be
> > careful about how you name the options (the names have to match), but
> > suppose p:pipeline is equivalent to the following:
> >
> > <p:declare-step>
> >   <p:input port="source">
> >   <p:output port="result"/>
> >   <p:option name="parameters" inherit="true"/>
> >   ...
> > </p:declare-step>
> >
> > then you will still be able to do things like:
> >
> > <p:pipeline>
> >   <p:xslt/>
> > </p:pipeline>
> >
> > and be sure that the parameters passed to the pipeline will get
> passed to the p:xslt step.
> 
> How does that work. How does a parameter named "page-size" pass
> through?

It works because both "parameters" options on p:pipeline and p:xslt are maps.

Suppose that p:pipeline is equivalent to this:

<p:declare-step>
  <p:input port="source">
  <p:output port="result"/>
  <p:option name="parameters" inherit="true" type="map(*)"/>
  ...
</p:declare-step>

and that the declaration of p:xslt looks as follows:

<p:declare-step type="p:xslt">
  <p:input port="source" sequence="true" primary="true"/>
  <p:input port="stylesheet"/>
  <p:output port="result" primary="true"/>
  <p:output port="secondary" sequence="true"/>
  <p:option name="parameters" type="map(*)"/>
  ...
</p:declare-step>

then because the "parameters" option of p:pipeline is declared as inherit="true", the following pipeline will just auto-bind the "parameters" option of the p:xslt step to it:

<p:pipeline>
  <p:xslt/>
</p:pipeline>

The last missing bit is that the specification of p:xslt would say that the parameters for the stylesheet are taken from the "parameters" map.

Regards,
Vojtech


--
Vojtech Toman
Consultant Software Engineer
EMC | Information Intelligence Group
vojtech.toman@emc.com
http://developer.emc.com/xmltech

Received on Thursday, 6 December 2012 08:39:51 UTC