Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Transform attribute to node >Thread Next - Re: Transform attribute to node RE: Transform attribute to nodeTo: NULL Date: 12/8/2005 1:12:00 AM Please try this stylesheet
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/root">
<root>
<xsl:apply-templates select="*" />
</root>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{name()}">
<xsl:for-each select="@*">
<xsl:element name="{name()}">
<xsl:value-of select="." />
</xsl:element>
</xsl:for-each>
<xsl:apply-templates select="*" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Regards,
Mukul
"Olivier Matrot" wrote:
> Hello,
> I'm looking for an XSLT file that transform an XML File to another XML File
> where all attributes of a node becomes node as well. For instance :
>
> <test value="1" />
>
> becomes
>
> <test>
> <value>1</value>
> </test>
>
>
> TIA.
>
>
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
