by Eric van der Vlist is published by O'Reilly & Associates (ISBN: 0596004214)


Name

xsd:normalizedString — Whitespace-replaced strings

Synopsis

<xsd:simpleType name="normalizedString" id="normalizedString">
 <xsd:restriction base="xsd:string">
 <xsd:whiteSpace value="replace"/>
 </xsd:restriction>
</xsd:simpleType>

Derived from

xsd:string

Primary

xsd:string

Known subtypes

xsd:token

Data parameters (facets)

enumeration, length, maxLength, minLength, pattern

Description

The lexical space of xsd:normalizedString is unconstrained (any valid XML character may be used). Its value space is the set of strings after whitespace replacement—i.e., after any occurrence of #x9 (tab), #xA (linefeed), and #xD (carriage return) have been replaced by an occurrence of #x20 (space) without any whitespace collapsing.

Restrictions

This is the only datatype that performs whitespace replacement without collapsing. When whitespace isn't significant, xsd:token is preferred.

This datatype corresponds neither to the XPath function normalize-space() (which performs whitespace trimming and collapsing) nor to the DOM normalize method (which is a merge of adjacent text objects).

Example

The value of the element:

<title lang="en">
  Being a Dog Is 
  a Full-Time Job
</title>"

is the string: " Being a Dog Is a Full-Time Job ", in which all whitespace has been replaced by spaces, if the title element is a type xsd:normalizedString.


This text is released under the Free Software Foundation GFDL.