Subject: Re: [xsl] Testing attribute name and replacing them with other attribute name From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Mon, 05 Sep 2005 19:28:35 +0200 |
I want to find some attributes by name and then replacing them with other attributes (actually doing language transformation) :
for example
<tshirts size="XXL" brand="Nike" price="14">
should be changed into :
<tshirts lC$nge="XXL" marke="Nike" preis="14">
How can this be done ?
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/>
<xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*" /> </xsl:copy> </xsl:template>
<xsl:template match="@size"> <xsl:attribute name="lC$nge"><xsl:value-of select="."/></xsl:attribute> </xsl:template>
<xsl:template match="@brand"> <xsl:attribute name="marke"><xsl:value-of select="."/></xsl:attribute> </xsl:template>
<xsl:template match="@price"> <xsl:attribute name="preis"><xsl:value-of select="."/></xsl:attribute> </xsl:template>
regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) B+Error, keyboard not foundb press F1 to continueB; , BIOS
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Testing attribute name and re, Thomas Winkler | Thread | RE: [xsl] Testing attribute name an, Kevin L. Cobb |
Re: [xsl] muliple level sorting usi, Joris Gillis | Date | RE: [xsl] xslt2 complex content seq, Michael Kay |
Month |