Top

Name

normalize-space — Returns the argument string with whitespace normalized.

Synopsis

string normalize-space ( strg string );
 

Description

The function returns the argument string with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of whitespace characters by a single space. Whitespace characters are the same as those allowed by the S production in XML, i.e. space (#x20), carriage returns (#xD), line feeds (#xA), and tabs (#x9). If the argument is omitted, it defaults to the context node converted to a string, in other words the string-value of the context node.

Parameters

strg

A string to be normalized

Return Types

Examples

Example 24.605. 

normalize-space('    too     many   spaces    ')