Converting uppercase to loswercase using XSLT 1.0 however first character should remain caps



I have an requirement in which I need to convert from uppercase to lowercase. However the first letter should remain uppercase.


Input:<LineStatus>DELETED</LineStatus>


Expected Output: <LineStatus>Deleted</LineStatus>


Below is the code



`<xsl:template match="/">
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:value-of select="translate(DELETED, $smallcase, $uppercase)" />
</xsl:template>`


This will give the output as deleted


I have tried something like <xsl:value-of select="translate(substring(DELETED,1,1), $smallcase, $uppercase)" /> but it gave me output d


Can anyone please advise?


No comments:

Post a Comment