Name

xs:token

Synopsis

xs:token is a subtype of xs:normalizedString whose normalized value does not contain any line feed (#xA) or tab (#x9) characters, does not have any leading or trailing whitespace (as whitespace is defined by XML 1.0, not XML 1.1), and has no sequence of two or more spaces. All legal strings are also legal lexical representations of type xs:token. However, a schema-aware parser that presents the normalized value of an element instead of the literal characters in the document will trim leading and trailing whitespace and compress all other runs of whitespace characters with a single space before passing the string to the client application.

Constraining facets that apply to xs:token are length, minLength, maxLength, pattern, enumeration, and whiteSpace.

Get XML in a Nutshell, 3rd Edition 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.