Saturday, May 12, 2012

convert uppercase to lowercase in xslt

Here i will show how to translate the uppercase letter to lowercase using xslt.For this i have created a variables ,which are used in this conversion process.Then the result will be assigned to one parameter which is "purl".
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
    <xsl:param name="CurrentUrl"></xsl:param>
    <xsl:param name="PUrl"></xsl:param>
    <xsl:variable name="lowercletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
    <xsl:variable name="uppercletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable> 
    <xsl:template match="/">
        <xsl:for-each select="/Item/Menu">
            <xsl:if test="$PUrl = translate(Link, $uppercletters, $lowercletters)">
                    <xsl:value-of select="item"/>

No comments: