xsl:result-document instruction throws error when invoking stylesheet with Calabash

142 Views Asked by At

I have an XSL stylesheet that looks like this:

<xsl:template name="xsl:initial-template">
  <xsl:for-each-group select="collection($doc-collection)//dr:description" group-by="format-date(dr:date, '[Mn]-[Y]')">
    <xsl:result-document href="{current-grouping-key()}.html" method="html" indent="yes">
      <xsl:call-template name="page">
        <xsl:with-param name="desc" select="current-group()"/>
      </xsl:call-template>  
    </xsl:result-document>
  </xsl:for-each-group>
</xsl:template>

(Variables and other templates omitted for brevity.)

When I invoke this using Saxon, everything runs fine and I end up with x documents created through xsl:result-document.

When it is run as part of an XProc pipeline with Calabash as follows:

<p:xslt name="transformation" template-name="xsl:initial-template">
  <p:input port="stylesheet">
    <p:document href="../xslt/main.xsl"/>
  </p:input>
  <p:input port="source">
    <p:empty/>
  </p:input>
  <p:with-param name="doc-collection" select="resolve-uri($source)"/>
</p:xslt>

I get a run-time error during the transformation: Cannot execute xsl:result-document while evaluating xsl:variable. I tried stripping down the code to a bare minimum, but I cannot prevent the error from occuring when calling xsl:result-document.

I don't know what variable it is referring to, I can only assume it is created somewhere inside the pipeline?

Working with Saxon EE 9.9.1.5 and Calabash 1.1.30-99 inside Oxygen XML Developer.

0

There are 0 best solutions below