Name

xs:boolean — Boolean (true or false).

Derived from:

xs:anySimpleType

Primary:

xs:boolean

Known subtypes:

none

Facets:

xs:pattern, xs:whiteSpace

<xs:simpleType name="boolean" id="boolean">
  <xs:restriction base="xs:anySimpleType">
    <xs:whiteSpace value="collapse" fixed="true"/>
  </xs:restriction>
</xs:simpleType>

Description

The value space of xs:boolean is “true” and “false,” and its lexical space accepts true, false, and also “1” (for true) and “0” (for false).

Restrictions

This datatype cannot be localized—for instance, to accept “vrai” and “faux” instead of “true” and “false”.

Example

<book id="b0836217462" available="true"/>

Get XML Schema 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.