xsl-list
[Top] [All Lists]

RE: Testing attribute name and replacing them with other attribute name

2005-09-05 08:24:28

I think this will work . . .

<xsl:template match="@size">
      <xsl:attribute name="lange"><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> 

Yes, provided you also do <xsl:apply-templates select="@*"/> on the
containing element.

Michael Kay
http://www.saxonica.com/





-----Original Message-----
From: Thomas Winkler [mailto:thomasm003(_at_)yahoo(_dot_)de] 
Sent: Monday, September 05, 2005 11:11 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Testing attribute name and replacing them with 
other attribute name

Hello, 

I am a newbie in XSL and using Xalan.

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 länge="XXL" marke="Nike" preis="14">


How can this be done ?



Thanks in advance !







      
              
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - 
Hier anmelden: http://mail.yahoo.de

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--