2013-07-05 28 views

回答

2

使用document()函数来加载其他XML文档。如果你想简单地插入第二个文档的内容逐字在输出树可以使用

<xsl:copy-of select="document('otherfile.xml')/*" /> 
2

为了增加伊恩·罗伯茨的回答,如果要插入第二个文档作为最外层的最后一个子元素,这样做“:

<xsl:template match="/*"> 
    <xsl:copy> 
    <xsl:copy-of select="@*, node()"/> 
    <xsl:copy-of select="document('otherfile.xml')"/> 
    </xsl:copy> 
</xsl:template> 
相关问题