XML technologies / XML Schema / Data type reference / xs:normalizedString
(Excerpt from “XML Schema” by Eric van der Vlist)
Strings with replaced whitespace
Derived from: xs:string
Primitive type: xs:string
Known subtypes: xs:token
Facets: xs:enumeration, xs:length, xs:maxLength, xs:minLength, xs:pattern, xs:whiteSpace
Definition
<xs:simpleType name="normalizedString" id="normalizedString">
<xs:restriction base="xs:string">
<xs:whiteSpace value="replace"/>
</xs:restriction>
</xs:simpleType>Description
The lexical space of xs:normalizedString is unrestricted: any valid XML character may be used. Its value space consists of strings after whitespace replacement, replacing each #x9 (tab), #xA (line feed) and #xD (carriage return) with #x20 (space), without collapsing whitespace.
Restrictions
This is the only data type replacing whitespace without collapsing it. If whitespace is insignificant, xs:token is preferred.
This data type corresponds neither to the XPath function normalize-space( ), which trims leading and trailing whitespace and collapses the rest, nor to the DOM method normalize, which merges adjacent text objects.
Example
The value of element
<title lang="de">
Auf den
Hund gekommen
</title>" is the string "Auf den Hund gekommen". All whitespace has been replaced by spaces if the title element has type xs:normalizedString.
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “XML Schema” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de