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

RE: merging attributes (with xsl:copy?)

Subject: RE: merging attributes (with xsl:copy?)
From: Bovone Stefano <Stefano.Bovone@xxxxxxxx>
Date: Tue, 20 Jul 1999 11:41:21 +0200
xsl copy new attribute
I'm trying:

<xsl:template match="x">
 <xsl:copy>
  <xsl:for-each select="./@*"><xsl:copy/></xsl:for-each>
  <xsl:attribute name="b">
   b
  </xsl:attribute>
 </xsl:copy>
</xsl:template>

Bye.

> ----------
> From: 	Christian Lindig[SMTP:lindig@xxxxxxxxxxx]
> Reply To: 	xsl-list@xxxxxxxxxxxxxxxx
> Sent: 	martedì 20 luglio 1999 10.18
> To: 	xsl-list@xxxxxxxxxxxxxxxx
> Subject: 	merging attributes (with xsl:copy?)
> 
> 
> I'm looking for a way to match all elements <x> (which may have
> attributes) and add new attributes:
>     
>     <x>                 --> <x             b="b" c="c">
>     <x a="a">           --> <x a="a"       b="b" c="c">
>     <x a="a" d="d">     --> <x a="a" d="d" b="b" c="c">
> 
> When <x> has no attributes this is easy: 
> 
>     <xsl:template match="x">
>         <x b="b" c="c">
>             <xsl:apply-templates/>
>         </x>
>     </xsl:template>
> 
> But how to copy all existing attributes to the new element?  I'm sorry
> in case this is a FAQ - I did not found it in the XSL archive. 
> 
> -- Christian
>  
> -- 
>  Christian Lindig       Gaertner Datensysteme GbR, Braunschweig, Germany 
>                         lindig@xxxxxxxxxxx http://www.gaertner.de/~lindig 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.