Tuesday, March 21, 2006

The Boolean Type in XML Schema

In XML Schema, true and false are Boolean values, but I am learning through Koranteng blog that there are two other valid values: 0 and 1. At first, I found that hard to believe. So I headed towards the Schema Sandbox and entered this as document to validate:


And this XML Schema:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs :element name="root" type="xs:boolean"/>

And yes, 0 and 1 are in fact valid Boolean values in XML schema!

No comments:

Post a Comment