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

丶灬走出姿态 提交于 2021-02-11 12:50:09

问题


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.

来源:https://stackoverflow.com/questions/62961923/xslresult-document-instruction-throws-error-when-invoking-stylesheet-with-calab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!