Combine xml's and getting the ouput as a proper xml file

DeepLove

New Member
I have a requirement to combine 4 xml files into one. They are like follows. Document 1\[code\]<doc1>....<doc1>\[/code\]Document 2\[code\]<doc2>....<doc2>\[/code\]Document 3\[code\]<doc3>....<doc3>\[/code\]Document 4\[code\]<doc4>....<doc4>\[/code\]I want the output as follows\[code\]<doc1>....<doc2>....</doc2><doc3>....</doc3><doc4>....</doc4></doc1>\[/code\]I did it as follows.\[code\]<xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:copy-of select="document('doc1.xml')"/> <xsl:copy-of select="document('doc2.xml')"/> <xsl:copy-of select="document('doc3.xml')"/> <xsl:copy-of select="document('doc4.xml')"/> </xsl:template></xsl:transform>\[/code\]but the ouput I get is as follows\[code\]<doc1>....</doc1><doc2>....</doc2><doc3>....</doc3><doc4>....</doc4>\[/code\]Is it possible to change my script and get what I want?
 
Back
Top