Re: Loading a parameter into a p:variable

As far as I understand this limitation on connections of p:variable @select is to avoid chicken-and-eggs situations where a variable could be based on the result of a step which itself uses the variable.

To clarify these situations, you need to wrap in a p:group the variable and all the steps depending on it: 

…
<p:group>
  <p:variable name="security" select="//c:param[@name =
'security']/@value" xmlns:c="http://www.w3.org/ns/xproc-step">
    <p:pipe port="result" step="params"/>
  </p:variable>

 … other steps depending on $security … 
</p:group>

  <p:parameters name="params">
    <p:input port="parameters">
      <p:pipe port="parameters" step="main"/>
    </p:input>
  </p:parameters>
...

On 2 mai 2012, at 00:20, David Cramer wrote:

> Hi there,
> I'm in the same situation as Kevin Flynn describes in this thread:
> 
> http://lists.w3.org/Archives/Public/xproc-dev/2010Jul/0002.html
> 
> I've tried Vojtech's suggestion (though I've implemented it
> incorrectly) and now receive "XS0019:Variable binding to result on
> params not allowed." from Calabash:
> 
> ...
>   <p:variable name="security" select="//c:param[@name =
> 'security']/@value" xmlns:c="http://www.w3.org/ns/xproc-step">
>     <p:pipe port="result" step="params"/>
>   </p:variable>
> 
>   <p:parameters name="params">
>     <p:input port="parameters">
>       <p:pipe port="parameters" step="main"/>
>     </p:input>
>   </p:parameters>
> ...
> 
> I'm quite puzzled as to how this should work, though it seems like
> extracting the value of a parameter into a variable for use in the
> pipeline should be a common task.
> 
> Btw., I notice that search results to http://xprocbook.com now take
> you to empty pages. Is that intentional?
> 
> Thanks,
> David

Received on Tuesday, 1 May 2012 22:48:32 UTC