使用XSL在XML文件中添加节点
如何使用XSL将两个XML文件合并到一个输出XML文件中? 例如,我们有 文件1:使用XSL在XML文件中添加节点,xml,xslt,nodes,Xml,Xslt,Nodes,如何使用XSL将两个XML文件合并到一个输出XML文件中? 例如,我们有 文件1: <tests> <test name="testOne"/> <test name="testTwo"/> <test name="testThree"/> <test name="testFour"/> </tests> 文件2: <tests> <test name
<tests>
<test name="testOne"/>
<test name="testTwo"/>
<test name="testThree"/>
<test name="testFour"/>
</tests>
文件2:
<tests>
<test name="testOne"/>
<test name="testTwo"/>
<test name="testThree"/>
<test name="testFour"/>
<test name="testFive"/>
</tests>
输出文件必须是:
<tests>
<test name="testOne"/>
<test name="testTwo"/>
<test name="testThree"/>
<test name="testFour"/>
<test name="testFive"/>
</tests>
使用相同XSL的示例2:
文件1:
文件2(之二):
输出文件:
<tests>
<test name="testOne"/>
<test name="testTwo"/>
<test name="testThree"/>
<test name="test4"/>
<test name="testFive"/>
</tests>
对于输出文件,我需要两个xml文件中包含的所有信息。我是XSL的新手,这是一个帮助我的示例。谢谢你试着做什么?你搜索了吗?您的示例没有透露所需操作的逻辑。我编辑了以下问题:)搜索“xslt合并”将找到多个解决方案。更多人应该了解的一个资源是DavePawson的XSLFAQ页面,位于。Dave从XSL用户的邮件列表中收集了许多最佳答案,本页包括许多XSL任务的解决方案,从基本任务到复杂任务,再到“我认为这是不可能的”。
<tests>
<test name="testFive"/>
</tests>
<tests>
<test name="testOne"/>
<test name="testTwo"/>
<test name="testThree"/>
<test name="test4"/>
<test name="testFive"/>
</tests>