Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将一个XML文件内容添加到另一个XML文件(在特定位置)_Xml_Xslt - Fatal编程技术网

如何将一个XML文件内容添加到另一个XML文件(在特定位置)

如何将一个XML文件内容添加到另一个XML文件(在特定位置),xml,xslt,Xml,Xslt,我想使用Xslt将一个XML文件内容添加到另一个XML文件中 我们如何做到这一点?使用document()函数加载其他XML文档。如果只想在输出树中逐字插入第二个文档的内容,可以使用 <xsl:copy-of select="document('otherfile.xml')/*" /> 使用document()函数加载其他XML文档。如果只想在输出树中逐字插入第二个文档的内容,可以使用 <xsl:copy-of select="document('otherfile.xm

我想使用Xslt将一个XML文件内容添加到另一个XML文件中

我们如何做到这一点?

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

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

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

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

要添加到Ian Roberts的答案中,如果要插入第二个文档作为最外层元素的最后一个子元素,请执行以下操作:


要添加到Ian Roberts的答案中,如果要插入第二个文档作为最外层元素的最后一个子元素,请执行以下操作: