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

RE: Explicit vs. implicit parameter bindings

From: <Toman_Vojtech@emc.com>
Date: Mon, 13 Oct 2008 03:41:22 -0400
Message-ID: <6E216CCE0679B5489A61125D0EFEC7870CF6EABC@CORPUSMX10A.corp.emc.com>
To: <public-xml-processing-model-wg@w3.org>

> Consider this pipeline:
> 
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
> 		xmlns:px="http://example.org/ns/pipelines"
> 		xmlns:c="http://www.w3.org/ns/xproc-step"
> 		name="main">
> <p:input port="parameters" kind="parameter">
>   <p:inline>
>     <c:param-set>
>       <c:param name="foo" value="1"/>
>     </c:param-set>
>   </p:inline>
> </p:input>
> <p:input port="source"/>
> <p:output port="result">
>   <p:pipe step="params" port="result"/>
> </p:output>
> 
> <p:parameters name="params">
>   <p:input port="parameters">
>     <p:pipe step="main" port="parameters"/>
>   </p:input>
>   <p:with-param name="foo" select="'bar'"/>
> </p:parameters>
> 
> </p:declare-step>
> 
> The output of this pipeline is a c:param-set element with "foo='bar'"
> because the with-param occurs after the parameter input port.
> 
> If we reverse the order of the elements in the p:parameters step:
> 
> <p:parameters name="params">
>   <p:with-param name="foo" select="'bar'"/>
>   <p:input port="parameters">
>     <p:pipe step="main" port="parameters"/>
>   </p:input>
> </p:parameters>
> 
> Then the output of this pipeline is a c:param-set element 
> with "foo='1'"
> because the with-param occurs before the parameter input port.
> 
> We all agree so far, right?
> 
> So what's the output if we specify the p:parameters step this way?
> 
> <p:parameters name="params">
>   <p:with-param name="foo" select="'bar'"/>
> </p:parameters>
> 
> In other words, what is the relative order of the implicit bindings?
> 
> I'm inclined to say they come last, that they come after the things
> that you specify explicitly. But I think that by the principle of
> least surprise, the value specified by the lone with-param should be
> respected.
> 
> Thoughts?
> 

I think this has already been addressed in Section 5.1.2 (Parameter
Inputs):

"If a binding is manufactured for a primary parameter input port, that
binding occurs logically last among the other parameters, options, and
bindings passed to the step. In other words, the parameter values that
appear on that port will be used even if other values were specified
with p:with-param elements. Users can change this priority by making the
binding explicit and placing any p:with-param elements that they wish to
function as overrides after the binding."

Regards,
Vojtech
Received on Monday, 13 October 2008 07:42:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 13 October 2008 07:42:15 GMT