Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - repetition through xsl (xml to xml transformation) [Thread Next] Re: repetition through xsl (xml to xml transformation)To: NULL Date: 5/2/2007 3:08:00 PM
ajayk_gem@y... wrote:
> I m new to xsl, please help me in xml to xml transformation -
Start with the identity transformation template
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
then add templates transforming those elements you want to change
(customers -> parties, customer -> party, name -> party-name) e.g.
<xsl:template match="customers">
<parties>
<xsl:apply-templates select="@* | node()"/>
</parties>
</xsl:template>
<xsl:template match="customer">
<party>
<xsl:apply-templates select="@* | node()"/>
</party>
</xsl:template>
<xsl:template match="name">
<party-name>
<xsl:apply-templates select="@* | node()"/>
</party-name>
</xsl:template>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
