Applying templates multiple times based on string values from other document

I have two XMLsFile1.xml It contains mapping for the IP need to copied multiple times and replacing the value with given.\[code\] <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>\[/code\]File2.xml\[code\] <IPMappings> <sourceIP value="http://stackoverflow.com/questions/14065523/192.168.1.1"> <replacement>10.66.33.22</replacement> <replacement>10.66.33.44</replacement> </sourceIP> <sourceIP value="http://stackoverflow.com/questions/14065523/192.168.1.2"> <replacement>10.66.34.22</replacement> <replacement>10.66.34.44</replacement> </sourceIP> </IPMappings>\[/code\]Resulting XML should be:\[code\] <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>\[/code\]How can I use XSLT to do this?
 
Back
Top