|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Adding attributes
this'll work: <xsl:template match="myelement"> <xsl:copy> <xsl:copy-of select="attribute::*"/> <xsl:attribute name="color">blind</xsl:attribute> <xsl:copy-of select="descendant::*"/> </xsl:copy> </xsl:template> -Jeff -----Original Message----- From: Ivan Rubin Ayma [mailto:Iayma@xxxxxxxxxxxx] Sent: Thursday, February 07, 2002 9:13 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Adding attributes Hello, How can I add an attribute to an element and copy the attributes it already had? Suppose I had an XML: <myelement type="10"> <somedata/> </myelement> and with the transformation I need to get: <myelement type="10" color="blind"> <somedata/> </myelement> Thanks, XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








