Port declaration problem in Calabash

Hi,

Can anybody explain the following to me:

I have a library containing the following pointless pipeline:

  <p:declare-step type="eb:copy">
        <p:input port="source"/>
        <p:output port="result"/>

    <p:identity/>
  </p:declare-step>

And a similarly pointless pipeline in another file that uses it to copy 
all the XML files in one folder to another folder:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:eb="http://some/id"
                xmlns:c="http://www.w3.org/ns/xproc-step"
                name="copy-all">

      <p:input port="source">
        <p:empty/>
      </p:input>

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

  <p:import href="my-library.xpl" />

  <p:variable name="source-folder" select="'/some/source/folder'"/>
  <p:variable name="source-format" select="'xml'"/>
  <p:variable name="output-folder" select="'out'"/>

  <p:directory-list>
    <p:with-option name="include-filter" 
select="concat('.*\.',$source-format)"/>
    <p:with-option name="path" select="$source-folder"/>
  </p:directory-list>

  <p:filter select="//c:file"/>
  <p:for-each>
    <p:variable name="current-file-stem" 
select="substring-before(/c:file/@name,'.')"/>
    <p:load>
      <p:with-option name="href" 
select="concat($source-folder,'/',$current-file-stem,'.',$source-format)"/>
    </p:load>
    <eb:copy/>
    <p:store name="store">
      <p:with-option name="href" 
select="concat($output-folder,'/',$current-file-stem,'-copy.xml')"/>
    </p:store>
  </p:for-each>

  <p:identity name="finished">
     <p:input port="source">
         <p:inline>
             <p>Copy completed</p>
         </p:inline>
     </p:input>
  </p:identity>

</p:declare-step>

which works as expected: all the .xml files in /some/source/folder get 
copied to out and have '-copy' appended to their names.

However, if I add a parameter port to the eb:copy pipeline as follows:

  <p:declare-step type="eb:copy">
        <p:input port="source"/>
        <p:input port="parameters" kind="parameter"/>
        <p:output port="result"/>

    <p:identity/>
  </p:declare-step>

and supply it with some input in my main pipeline:

    <eb:copy>
      <p:input port="parameters">
        <p:inline>
          <c:data content-type="text/plain">foo</c:data>
        </p:inline>
      </p:input>
    </eb:copy>

Then only the first .xml file in the source folder is processed, and the 
pipeline fails with the following message:

Error  : Pipeline failed: err:XS0035: null  It is a static error if the 
declaration of a parameter input port contains a binding; parameter 
input port declarations must be empty.

Am I misunderstanding something, or is this a bug in Calabash (0.9.14)?

Hope someone can help!

Kevin Flynn

PS The eb:copy step is, of course, just a placeholder for "real" steps 
that do interesting stuff and actually need parameters...

Received on Wednesday, 5 August 2009 10:51:04 UTC