Quantcast
Viewing all articles
Browse latest Browse all 8

Answer by Michael Kay for How can I merge XML files?

It's a simple XSLT transformation something like this (which you apply to document a.xml):

<xsl:variable name="docB" select="document('b.xml')"/><xsl:template match="Root"><Root><xsl:apply-templates/></Root></xsl:template><xsl:template match="Root/LeafA"><xsl:copy-of select="*"/><xsl:copy-of select="$docB/Root/LeafA/*"/></xsl:template><xsl:template match="Root/LeafB"><xsl:copy-of select="*"/><xsl:copy-of select="$docB/Root/LeafB/*"/></xsl:template>

Viewing all articles
Browse latest Browse all 8

Trending Articles