Skip to Main Content
XML Schema
book

XML Schema

by Eric van der Vlist
June 2002
Intermediate to advanced content levelIntermediate to advanced
396 pages
11h 8m
English
O'Reilly Media, Inc.
Content preview from XML Schema

Name

xs:whiteSpace — Facet to define whitespace behavior.

Synopsis

<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

Description

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).

Restrictions

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

XML in a Nutshell, 3rd Edition

XML in a Nutshell, 3rd Edition

Elliotte Rusty Harold, W. Scott Means
Beginning XML, 5th Edition

Beginning XML, 5th Edition

Danny Ayers, Liam R.E. Quin, Joe Fawcett
XML Schema Complete Reference, The

XML Schema Complete Reference, The

Cliff Binstock, Chris Galtenberg, Mike Wooding, Chris Dix, Mitchell Smith, Dave Peterson
Programming Web Services with SOAP

Programming Web Services with SOAP

James Snell, Doug Tidwell, Pavel Kulchenko

Publisher Resources

ISBN: 0596002521Supplemental ContentErrata Page