This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: lowercasing all attributes...


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]