W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > December 2012

RE: Revisiting "fixing parameters"

From: Toman, Vojtech <vojtech.toman@emc.com>
Date: Thu, 6 Dec 2012 03:39:04 -0500
To: "public-xml-processing-model-wg@w3.org" <public-xml-processing-model-wg@w3.org>
Message-ID: <F3C7EBECE80AC346BE4D1C5A9BB4A41F2F37CC19CA@MX11A.corp.emc.com>
> > 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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 6 December 2012 08:39:51 GMT