XProc Calabash: binding the xslt secondary output port

Hi,

I have 2 xslt steps, say tr5-inst-nav and tr6-xforms-nav. The first
one takes a primary input and produces no "primary" but one or more
"secondary" output files using xsl:result-document. The (simplified)
pipeline looks like:

   <p:option name="rel-path" required="true"/>
   <p:option name="debug" select="'0'"/>
   ...
   <p:identity name="section_3"/>
   <p:xslt name="tr5-inst-nav">
      <p:with-param name="rel-path" select="$rel-path"/>
      <p:with-param name="test-dir" select="if ($debug=0) then () else
'/_test'"/>
      <p:input port="stylesheet">
         <p:inline exclude-inline-prefixes="cx dwfx xps dwf">
<xsl:stylesheet version="2.0"
   ...
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="rel-path"/>
<xsl:param name="test-dir"/>
...
<xsl:template match="c:directory">
   ...
   <xsl:result-document href="{concat($out-dir, $sub, '-nav.xml')}">
   ...
</xsl:template>
</xsl:stylesheet>
         </p:inline>
      </p:input>
   </p:xslt>
   <p:sink/>
   <p:for-each>
      <p:iteration-source>
         <p:pipe step="tr5-inst-nav" port="secondary"/>
      </p:iteration-source>
      <p:store encoding="utf-8" indent="false" omit-xml-declaration="false">
         <p:with-option name="href" select="p:base-uri()"/>
      </p:store>
   </p:for-each>

This works perfectly, thanks Calabash! My second xslt (tr6-xforms-nav)
uses the same primary input, but in addition needs to read the files
produced by tr5-inst-nav using the doc() function. So I tried the
following:

   <p:identity>
      <p:input port="source">
         <p:pipe step="section_3" port="result"/>
         <p:pipe step="tr5-inst-nav" port="secondary"/><!-- ??? -->
      </p:input>
   </p:identity>
   <p:xslt name="tr6-xforms-nav">
      <p:with-param name="rel-path" select="$rel-path"/>
      <p:with-param name="test-dir" select="if ($debug=0) then () else
'/_test'"/>
   ...

and got the error message

22.11.2010 11:21:57 com.xmlcalabash.util.DefaultXProcMessageListener error
SCHWERWIEGEND: step p:xslt named tr6-xforms-nav at file:/F:/...
1070:34: err:XD0008: More than one document in context for parameter
'rel-path'
22.11.2010 11:21:57 com.xmlcalabash.drivers.Main error
SCHWERWIEGEND: It is a dynamic error if a document sequence appears
where a document to be used as the context node is expected.

(which might indicate another problem as well). Still I have no idea
how to make the secondary output port available for tr6-xforms-nav. If
you can see any other problems please feel free to comment.

Calabash version 0.9.22, Saxon-HE 9.2.1.5J, Java version 1.6.0_14

Regards,
Manfred

Received on Monday, 22 November 2010 23:44:33 UTC