View Single Post
  #1 (permalink)  
Old September 4th, 2006, 08:46 AM
lexzeus lexzeus is offline
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default translate element name to element name

Hi,

How to translate:

<aName att1="1" att2="2" att3="3">

to

<differentName att1="1" att2="2" att3="3">

?

Currently I use something like this:

<xsl:template match="aName">
    <xsl:element name="differentName">
        <xsl:attribute name="att1">...</xsl:attribute>
        <xsl:attribute name="att2">...</xsl:attribute>
        <xsl:attribute name="att3">...</xsl:attribute>
        <xsl:copy-of select='./*'/>
    ...
    </xsl:element>
...
</xsl:template>

which I don't think is ugly and get locked with those explicit attribute definitions.

Any opinion?

Reply With Quote