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

Re: Rename Some Node and attribute

Subject: Re: Rename Some Node and attribute
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 16 Oct 2006 17:43:16 +0200
Re:  Rename Some Node and attribute
Davide Antoni wrote:

But how to rename the node : RICHIESTA_PRESTAZIONI_EROGABILI into :ELENCO_PRESTAZIONI


In much the same way, but the difference being that an attribute never has any children, but an element has. So in this case we have to re-apply the templates, like so (add this snippet to the previous one):


<xsl:template match="RICHIESTA_PRESTAZIONI_EROGABILI">
<xsl:element name="ELENCO_PRESTAZIONI ">
  <xsl:apply-templates />
</xsl:element>
</xsl:template>


The fun thing about XSLT matching rules is: you provide a general rule that applies to everything, and you provide special rules for special cases. XSLT will automatically select the special rules when they are encountered up the tree, and applies the generic rules when no special rule is found for a specific node.


Hope this helps,

Cheers,
-- Abel Braaksma
   http://www.nuntia.com

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.