Saturday, June 16, 2012

Upper case to lower case and lower case to upper case in XSLT

Here i will show how to cover the lower case characters to upper case and upper case characters to lower case in xslt.There simple way i have used to create variable for both lower and upper letters ,then URL string replace will be done using those variable
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
     <xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
    <xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
    <xsl:template match="/">
        <xsl:variable name="PUrlLower" select="translate($PUrl, $ucletters, $lcletters)">
           <xsl:attribute name="href">
                <xsl:value-of select="$PUrl"/>
            <xsl:attribute name="title">
                <xsl:value-of select="$PTitle"/>
            <xsl:value-of select="$PTitle"/>

No comments: