cafeearabia
New Member
I am completely new to XSLT so please bear with me.I have two xml files that I am attempting to concatenate together using XSLT. I would like to combine the files such that any values specified in the second file override the first. E.g.firstFile.xml\[code\]<person> <person-name>Sandy</person-name> <person-age>21</person-age></person><person> <person-name>Bob</person-name> <person-age>15</person-age></person>\[/code\]override.xml\[code\]<person> <person-name>Bob</person-name> <person-age>21</person-age></person>\[/code\]Result:\[code\]<person> <person-name>Sandy</person-name> <person-age>21</person-age></person><person> <person-name>Bob</person-name> <person-age>21</person-age></person>\[/code\]My template for concatenating the 2 files is as follows:\[code\] <xsl:template match="/"> <!-- MainFile --> <xsl:copy-of select="/*"/> <!-- Overrides--> <xsl:copy-of select="document($overrideFile)/*"/> </xsl:template>\[/code\]I was attempting to setup a for-each loop such that before copying each person in firstFile.xml check if there is a corresponding node in override.xml, but was unsuccessful.Any tips would be greatly appreciated