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

Re: Global change of an attribute name

Subject: Re: Global change of an attribute name
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 12 Jun 2000 15:51:11 +0100 (BST)
globally change attribute
 
   I am using XSLT to change XML in one DTD to XML in a slightly modified
   DTD.  In the original DTD, the attribute R can appear on virtually any
   element; I would prefer that the attribute be called REND.  Is there a way
   to change this globally anywhere it appears (<xsl:template match="@R">, I
   presume), or does it have to be adressed on an element by element level?

<xsl:template match="@R">
<xsl:attribute name="REND">
  <xsl:value-of select="."/>
</xsl:attribute>

<xsl:template match="@*">
<xsl:copy-of select="."/>
</xsl:attribute>

will copy all attributes, except for renaming R to REND
but as attribute nodes are not on the default selection for
apply-templates you'll need to make sure that every template that is
making an element node calls
<xsl:apply-templates select="@*"/>

David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.