我有这个基本模板,可以对 XML 文档中的某些节点进行排序和删除。当将 XML 文件作为 Saxon 命令的输入参数传递时,它在独立 XSLT 中按预期工作。
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()">
<xsl:sort select="RatingDate" order="descending"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="ChangesByServerID|Distance|NewRatingPending"/>
但是,我想将其包含在现有的 XSL 文件中,其中 XML 文件被加载到变量中:
<xsl:variable name="BANES_326" select="document('FHRS_BANES_326.xml')"/>
如何将 XML 变量传递给此例程?
简单地做
<xsl:apply-templates select="$BANES_236"/>