xs:normalizedString

The xs:normalizedString type is identical to xs:string, except in the way that whitespace is normalized in its values. This whitespace normalization takes place during validation, and also when values are constructed or cast to xs:normalizedString. For values of type xs:normalizedString, the processor replaces each carriage return, line feed, and tab by a single space. This is different from xs:string values, where whitespace is preserved. There is no collapsing of multiple consecutive spaces into a single space; this is done with values of type xs:token.

The whitespace handling of the xs:normalizedString type is different from that of the normalize-string function, which does collapse multiple adjacent spaces to a single space.

The xs:normalizedString type is derived by restriction from xs:string, so any functions and operations that can be performed on strings, such as substring and comparing using the < operator, can also be performed on xs:normalizedString values.

Get XQuery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.