[Home] [By Thread] [By Date] [Recent Entries]
varun bhatnagar varun292006@xxxxxxxxx wrote:
But I am sorry this is not the root element. There are few more elements above this one and if I do this then the whole xml is getting written twice. Is there anything else I can do? Yes, assuming you know a pattern to identify the parent element of the elements to merge then change
to e.g. <xsl:template match="/root/foo/config">
<xsl:copy>
<xsl:apply-templates select="@* , $doc2/root/foo/config, node()"/>
</xsl:copy>
</xsl:template>or for instance, as long as "config" suffices to identify the parent element of the elements you want to merge it should suffice to use <xsl:template match="config">
<xsl:copy>
<xsl:apply-templates select="@* , $doc2//config, node()"/>
</xsl:copy>
</xsl:template>
|

Cart



