提问人:DaveF 提问时间:10/1/2023 更新时间:10/1/2023 访问量:31
xsl 如何将 XML 文档作为变量应用于模板
xsl how do I apply a XML document as a variable to a template
问:
我有这个基本模板,它可以从我的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 变量传递给此例程?
答:
0赞
Michael Kay
10/1/2023
#1
简单做到<xsl:apply-templates select="$BANES_236"/>
评论