Re: Binding output port of p:choose

Le 03/10/2010 21:41, Florent Georges a écrit :
>    Hi,
>
>    I am trying to bind the result port of a p:choose/p:when to the
> output port of my pipeline, which has another name:
>
>      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
>                      name="pipeline"
>                      version="1.0">
>
>         <p:output port="my-result">
>            <p:pipe port="result" step="s"/>
>         </p:output>
>
>         <p:choose name="s">
>            <p:when test="true()">
>               <p:identity>
>                  <p:input port="source">
>                     <p:inline>
>                        <true/>
>                     </p:inline>
>                  </p:input>
>               </p:identity>
>            </p:when>
>         </p:choose>
>
>      </p:declare-step>
>
>    But when I execute it with Calabash, I get the error "XE0001:
> Unreadable port: result on s".  I guess I missed (again) something
> obvious, but what?

Hi Florent,

from the spec: "If the selected subpipeline has a primary output port, 
the port with the same name on the p:choose is also a primary output port."
Here, p:identity has no *primary* output port, therefore p:choose isn't 
connected to the result port.

You have to do do the connection explicitly (tested with Calabash 0.9.19):

<p:when test="true()">
	<p:output port="result">
		<p:pipe port="result" step="id"/>
	</p:output>
	<p:identity name="id">
		<p:input port="source">
			<p:inline>
				<true/>
			</p:inline>
		</p:input>
	</p:identity>
</p:when>

Olivier

Received on Sunday, 3 October 2010 21:07:54 UTC