xsl-list
[Top] [All Lists]

Re: Change of Attribute Value

2005-11-03 03:42:03
Hi fabrice,

This is just a very quick solution from the top of my head. Not
tested, and I am a little sure of the copy-of on the remaining
attributes - the test for not choosing the name. Another one might
help you out here.

<xsl:template match="node">
  <xsl:copy>
    <xsl:attribute
name="name">concat((ancestor::node)[2]/@name,@name"</xsl:attribute>
    <xsl:copy-of select="@*[not(self::@name)]"/>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

<xsl:template match="*[not(self::node)]">
  <xsl:copy-of select="."/>
</xsl:template>

Regards,
Ragulf Pickaxe :-)

so basically, i want to skip the first level of element <node>, and then
pick up the attribute @name value of the second level and concat it to all
sublevel attributes @name

I'm sure this is possible using some kind of recusion.
Any help, would be much appreciated.

Thanks in advance.
fabrice

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--