boolean

A boolean is a datatype that is used to represent the mathematical concept of binary-valued logic. Practically speaking, that translates to true and false.

The boolean type has a predefined value set of “true, false, 1, 0” where 1 is the same as true, and 0 is the same as false.

A boolean can be used when you need a datatype that represents a true condition or a false condition. For example, if you wanted to create an element called "attendance" for keeping track of meeting attendees:

<xs:element name="attendance" type="xs:boolean"/> 

In the instance document, the element could be either

<attendance>true</attendance> or <attendance>false</attendance> 

depending on whether the person in question had attended or not. Booleans are a very ...

Get Special Edition Using XML, Second 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.