Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - attribute transformation puzzle ( group reference to element - rename attribute and copy it's value ) [Thread Next] RE: attribute transformation puzzle ( group reference to element - renTo: NULL Date: 8/2/2005 3:48:00 AM Please try this XSL..
<?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="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*" />
</xsl:copy>
</xsl:template>
<xsl:template match="car">
<car>
<xsl:attribute
name="car_ref">http://someurl/standard</xsl:attribute>
<xsl:apply-templates />
</car>
</xsl:template>
</xsl:stylesheet>
Regards,
Mukul
"Torsten Reichert" wrote:
> Hi experts
>
> I wonder, what the xsl looks like to achieve the following transformation:
>
> ==== INPUT =====
> <?xml version="1.0"?>
> <source car_ref_default="http://someurl/standard">
> <car>BMW</car>
> </source>
>
> ==== OUTPUT to be achieved =====
> <?xml version="1.0"?>
> <source car_ref_default="http://someurl/standard">
> <car car_ref=""http://someurl/standard">BMW</car>
> </source>
>
> Does anyone see how this is done ?
>
> Thank you
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
