This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: lowercasing all attributes...
- From: Oleg Tkachenko <olegt at multiconn dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sun, 27 Jan 2002 16:51:07 +0200
- Subject: Re: [xsl] lowercasing all attributes...
- Organization: Multiconn International
- References: <008401c1a786$bc8f9ff0$0a00a8c0@earth>
- Reply-to: xsl-list at lists dot mulberrytech dot com
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