xs:whiteSpace — Facet to define whitespace behavior.
<xs:whiteSpace fixed = xs:boolean : “false” id = xs:ID value = ( “preserve” | “replace” | “collapse” ) {any attributes with non-schema namespace} > Content: (xs:annotation?) </xs:whiteSpace>
May be included in: xs:restriction (simple type), xs:restriction (simple content)
May be used as facet for:xs:ENTITIES, xs:ENTITY, xs:ID, xs:IDREF, xs:IDREFS, xs:language, xs:Name, xs:NCName, xs:NMTOKEN, xs:NMTOKENS, xs:normalizedString, xs:string, xs:token
This facet defines the treatment to perform on whitespace—i.e.,
#x20
(space), #x9
(tab),
#xA
(linefeed), and #xD
(carriage return)—during the transformation between the lexical
and value spaces.
Its values are preserve
(whitespace characters are
kept unchanged), replace
(all instances of
whitespace are replaced with a space), and
collapse
(leading and trailing whitespace is
removed and all the other sequences of contiguous whitespace are
replaced by a single space).
This is the only facet (or feature of W3C XML Schema) that interacts with the canonicalization transformation.
It is not possible to “relax” the
whitespace behavior during a restriction: if a datatype has a
whitespace set as preserve
, its derived datatypes
can have any whitespace behavior, but if its whitespace is set as
replace
, its derived datatypes can only have
whitespace equal to replace
or
collapse
. If its whitespace is equal to
collapse
, all its derived datatypes must have the
same behavior.
This limitation is somewhat paradoxical since it allows the actual expansion of the lexical space of a datatype during a derivation by restriction.
18.191.147.190