XML technologies / XML Schema / Data type reference / xs:string
(Excerpt from “XML Schema” by Eric van der Vlist)
Arbitrary strings
Derived from: xs:anySimpleType
Primitive type: xs:string
Known subtypes: xs:normalizedString
Facets: xs:enumeration, xs:length, xs:maxLength, xs:minLength, xs:pattern, xs:whiteSpace
Definition
<xs:simpleType name="string" id="string">
<xs:restriction base="xs:anySimpleType">
<xs:whiteSpace value="preserve"/>
</xs:restriction>
</xs:simpleType>Description
The lexical and value spaces of xs:string consist of all possible strings composed of characters permitted in XML 1.0 documents. No processing of whitespace takes place.
Restrictions
This is the only data type preserving all whitespace characters. If whitespace is insignificant, xs:token is preferred.
Example
The value of the following element:
<title lang="de">
Auf den
Hund gekommen
</title>is the complete string
Auf den
Hund gekommen
Including all tabs and CR/LF, if the title element has type xs:string.
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