Re: [xsl] lowercasing all attributes...

Subject: Re: [xsl] lowercasing all attributes...
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Sun, 27 Jan 2002 16:51:07 +0200
Martijn wrote:

I'd like to lowercase a document's attributes through <xsl:apply-templates
select="???">

I know it's translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'abcdefghijklmnopqrstuvwxyz') but how 'bout the template match pattern and
the select for apply-templates ??


I'm not sure I fully understand your question, but anyway if you want to lowercase all attributes values, you can do it this way:

<xsl:template match="@*">
<xsl:attribute name="{name()}">
<xsl:value-of select="translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
</xsl:attribute>
</xsl:template>


I f you wanna lowercase attributes' names, try this one:
<xsl:template match="@*">
<xsl:attribute name="{translate(name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>


--
Oleg Tkachenko
Multiconn International, Israel


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread