Copying content of one xml into other using xslt JAVA

RomanDrozd

New Member
I am trying to copy a content from one xml to other xml using Xslt.I need to copy content of file1 \[code\]<?xml version="1.0"?><products author="Jesper"> <product> <name>Delta</name> <price>800</price> <stock> <price>13a</price> </stock> <place>Denmark</place> </product></products>\[/code\]to file 2. File2 has similar tags but order is jumbled, \[code\]<?xml version="1.0"?><products author="Jesper"> <product> <stock> <price>13d</price> </stock> <price>700</price> <place>Copenhagen</place> <name>Beta</name> </product></products>\[/code\]expected output\[code\]<products author="Jesper"> <product> <stock> <price>13a</price> </stock> <price>800</price> <place>Denmark</place> <name>Delta</name> </product></products>\[/code\]so basically I need to Iterate through file1 using for-each and then find the matching tag in file2 and copy the tag value. Not sure about an efficient way to do so ... Double iterating is inefficient. Any suggestion will be helpful.
 
Back
Top