0

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.

wasmachien
  • 969
  • 1
  • 11
  • 28
  • Sounds odd although you haven't shown us how where/how you set `$source` in the XProc. Anyway, you can raise it with the oXygen support if it only happens inside oXygen or as an issue with Calabash on GitHub if it is Calabash related. – Martin Honnen Jul 18 '20 at 08:33
  • It seems I was misguided - the error was thrown by the XSpec test runner that preceded the transformation step in the pipeline (and tried to wrap the result in a variable!). – wasmachien Jul 18 '20 at 13:18

0 Answers0