[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Change of Attribute Value

Subject: Re: Change of Attribute Value
From: Ragulf Pickaxe <ragulf.pickaxe@xxxxxxxxx>
Date: Thu, 3 Nov 2005 11:42:03 +0100
Re:  Change of Attribute Value
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.