Subject: [xsl] Copy element with attributes From: "Diogo Vascocelos" <dgvascon@xxxxxxxxxxx> Date: Tue, 29 Nov 2005 08:55:52 +0000 |
I have an xhtml file that I want to transform using xslt, like the one below. I want to prepend and append some text and change some body tag attributes but copy any other attributes. I cannot seem to get that done in the same transformation.
<html> <head> </head> <body text="#003366" bgcolor="#663300" onload="otherAttribs()"> <p>My page</p> </body> </html>
<html> <head> </head> <body text="#000000" bgcolor="#ffffff" onload="otherAttribs()"> Prepend text <p>My page</p> Append text </body> </html>
<xsl:template match="body"> <xsl:copy> Prepend text <xsl:apply-templates/> Append text </xsl:copy> </xsl:template>
removes body tag attributes. How can I copy the body tag attributes at the same time, so I can use something like:
<xsl:template match="body/@text"> <xsl:attribute name="text">#000000</xsl:attribute> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] insert an image into a pd, Jarno.Elovirta | Thread | Re: [xsl] Copy element with attribu, Ragulf Pickaxe |
[xsl] insert an image into a pdf, LEDEAUT Stephane | Date | Re: [xsl] IDREFS and key(), David Carlisle |
Month |