<xslTutorial creator="nicmila@idoox.com">
<index keywords='string-length() normalize-space()'/>

<description>The string-length function returns the number of characters in the string. The normalize-space function returns the argument string with white space normalized by stripping leading and trailing whitespace and replacing sequences of whitespace characters by a single space. 
</description>

<xmlSource id="id1">
<P>
<text>Normalized text</text>
<text>Sequences   of      whitespace characters</text>
<text>    Leading and trailing whitespace.    </text>
</P>
</xmlSource>

<attValues>
<value match=''></value>
</attValues>

<xslStylesheet id="id2">
<xsl:template match="/">
<TABLE>
<xsl:for-each select="//text">
<TR><TH colspan='4'>
<xsl:value-of select="."/></TH></TR>
<TR>
<TD>Starting length:</TD>
<TD><xsl:value-of select="string-length(.)"/></TD>
<TD>Normalized length:</TD>
<TD><xsl:value-of select="string-length(normalize-space(.))"/></TD>
</TR>
</xsl:for-each>
</TABLE>
</xsl:template>
</xslStylesheet>

</xslTutorial>