Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Add child node to a parent node >Thread Next - Re: Add child node to a parent node Re: Add child node to a parent nodeTo: NULL Date: 5/15/2009 12:13:00 PM Yuriy wrote:
> <parents>
> <parent name="A">
> <child name="A1"/>
> <child name="A1"/>
> </parent>
> </parents>
>
> A target one would look like:
>
> <parents>
> <parent name="A">
> <child name="A1"/>
> <child name="A1"/>
> <child name="A1"/>
> </parent>
> </parents>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:tempate>
<xsl:template match="parent[@name = 'A']">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
<child name="A1"/>
</xsl:copy>
</xsl:template>
--
Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
