calabash, cx:eval and multiple outputs

Hi all

Is it possible to handle multiple outputs with cx:eval? My reading of the docs suggests it is but any attempt to evaluate a pipeline with multiple outputs is failing with the following error:

SEVERE: err:XD0007:XD0007
Oct 23, 2014 12:01:02 PM com.xmlcalabash.drivers.Main error
SEVERE: If sequence is not specified on p:output, or has the value false, then it is a dynamic error if the step does not produce exactly one document on the declared port.

For example, this works (slightly over the top I know but I was simplifying down until I worked out the problem)

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:cx="http://xmlcalabash.com/ns/extensions"
 xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0" name="tester">

 <p:input port="test-pipeline">
  <p:inline>

   <p:declare-step version="1.0" name="test">

    <p:input port="ip1">
     <p:inline>
      <p1/>
     </p:inline>
    </p:input>

    <p:output port="op1">
     <p:pipe port="result" step="i1"/>
    </p:output>


    <p:identity name="i1">
     <p:input port="source">
      <p:pipe port="ip1" step="test"/>
     </p:input>
    </p:identity>

   </p:declare-step>
  </p:inline>
 </p:input>

 <p:output port="result">
  <p:pipe port="result" step="run-test"/>
 </p:output>

 <p:import href="http://xmlcalabash.com/extension/steps/library-1.0.xpl"/>

 <cx:eval name="run-test" detailed="true">
  <p:input port="pipeline">
   <p:pipe port="test-pipeline" step="tester"/>
  </p:input>
  <p:input port="source">
   <p:empty/>
  </p:input>
  <p:input port="options">
   <p:empty/>
  </p:input>
 </cx:eval>

</p:declare-step>

However, if I add another output - changing the evaluated step to :

   <p:declare-step version="1.0" name="test">

    <p:input port="ip1">
     <p:inline>
      <p1/>
     </p:inline>
    </p:input>

    <p:input port="ip2">
     <p:inline>
      <p2/>
     </p:inline>
    </p:input>

    <p:output port="op1">
     <p:pipe port="result" step="i1"/>
    </p:output>

    <p:output port="op2">
     <p:pipe port="result" step="i2"/>
    </p:output>

    <p:identity name="i1">
     <p:input port="source">
      <p:pipe port="ip1" step="test"/>
     </p:input>
    </p:identity>

    <p:identity name="i2">
     <p:input port="source">
      <p:pipe port="ip2" step="test"/>
     </p:input>
    </p:identity>

   </p:declare-step>


I get the above error. 

Any suggestions? I’d would definitely appreciate being told that I’d made some small (or even large) error. Rewriting the rest of the pipeline to produce single results would be a pain



thanks

nic

Received on Thursday, 23 October 2014 11:06:15 UTC