/ Published in: XSLT

Useful for handling badly formatted string. You could also use normalize-space to remove bad spaces if needed.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!-- first char to uppercase--> <xsl:value-of select="concat( translate( substring( $my-string, 1, 1 ),$lowerCase, $upperCase ), substring( @type, 2, string-length( $my-string )))" /> <!-- remainder of string --> <xsl:value-of select="substring($my-string,2,string-length($my-string)-1)" /> <!-- fullstop --> <xsl:if test="substring($my-string,string-length($my-string)) !='.'">.</xsl:if>
Comments
