Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - RE: Transform attribute to node [Thread Next] Re: Transform attribute to nodeTo: NULL Date: 12/8/2005 11:28:00 AM This is working perfectly !
Thanks.
"Mukul Gandhi" <MukulGandhi@d...> wrote in message
news:D676194C-4BE0-4C44-BA88-C3AC738352DD@m......
> 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 | |||
|
