我有两个 XML
File1.xml 它包含需要多次复制的 IP 映射并将值替换为给定的值。
<baseNode>
<internal ip="192.168.1.1">
<someOtherTags>withsome values which should not be changed</someOtherTags>
</internal>
<internal ip="192.168.1.2">
<someOtherTags>withsome more values which should not be changed</someOtherTags>
</internal>
</baseNode>
文件2.xml
<IPMappings>
<sourceIP value="192.168.1.1">
<replacement>10.66.33.22</replacement>
<replacement>10.66.33.44</replacement>
</sourceIP>
<sourceIP value="192.168.1.2">
<replacement>10.66.34.22</replacement>
<replacement>10.66.34.44</replacement>
</sourceIP>
</IPMappings>
生成的 XML 应该是:
<baseNode>
<internal ip="10.66.33.22">
<someOtherTags>withsome values which should not be changed</someOtherTags>
</internal>
<internal ip="10.66.33.44">
<someOtherTags>withsome values which should not be changed</someOtherTags>
</internal>
<internal ip="10.66.34.22">
<someOtherTags>withsome more values which should not be changed</someOtherTags>
</internal>
<internal ip="10.66.34.44">
<someOtherTags>withsome more values which should not be changed</someOtherTags>
</internal>
</baseNode>
我如何使用 XSLT 来做到这一点?