W3C home > Mailing lists > Public > xproc-dev@w3.org > May 2009

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

From: Norman Walsh <ndw@nwalsh.com>
Date: Sun, 17 May 2009 15:35:53 -0400
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <m2vdnzbjza.fsf@nwalsh.com>
"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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 17 May 2009 19:36:39 GMT