Re: How do I connect a step to the output of p:choose?

"Costello, Roger L." <costello@mitre.org> writes:
> How do I connect the pipeline's p:output to p:choose, so that the
> pipeline output's is the file path of the stored document?

Each branch of the p:choose must declare the same output ports. After
you've done that, you can connect to the p:choose as if it declared
those ports. Here's an example with some of the connections made explicit
(which isn't strictly necessary in this particular example):

<p:pipeline xmlns:p="http://www.w3.org/ns/xproc">

  <p:choose name="choice">
    <p:when test="count(//p:when) &gt; 0">
      <p:output port="result"/>
      <p:identity>
	<p:input port="source">
	  <p:inline><doc>uses when</doc></p:inline>
	</p:input>
      </p:identity>
    </p:when>
    <p:otherwise>
      <p:output port="result"/>
      <p:identity>
	<p:input port="source">
	  <p:inline><doc>doesn't use when</doc></p:inline>
	</p:input>
      </p:identity>
    </p:otherwise>
  </p:choose>

  <p:identity>
    <p:input port="source">
      <p:pipe step="choice" port="result"/>
    </p:input>
  </p:identity>

</p:pipeline>


                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | All of us are creatures of a day; the
http://nwalsh.com/            | rememberer and the remembered
                              | alike.--Marcus Aurelius

Received on Sunday, 17 May 2009 19:36:39 UTC