使用SaxonHE 9.7/XPath-2.0
为什么此身份模板在将其输出发送到文件时返回“无法将多个结果文档写入同一URI”?如果没有xsl:result-document,它会像预期的那样将其发送到标准。
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="@*|node()">
<xsl:result-document href="Output.xml">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:result-document>
</xsl:template>
</xsl:stylesheet>发布于 2017-02-03 20:18:41
使用
<xsl:template match="/">
<xsl:result-document href="Output.xml">
<xsl:apply-templates/>
</xsl:result-document>
</xsl:template>再加上普通的标识转换模板,这样样式表创建的输出就会转到Output.xml。您当前的代码匹配任何节点,并且对于每个匹配的节点,都尝试打开相同的文件,这是不允许的。
https://stackoverflow.com/questions/42023826
复制相似问题