RE: Explicit vs. implicit parameter bindings

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