Datatype: boolean

Description:

True or False. XML Schema has a boolean data type, which accepts values of (true, false). This datatype extends the possibilities to other case modes. For exampe, true, True, TRUE are all acceptable.

Proposed Usage:

This datatype was developed to support the Epicentre boolean data type. Its intended usage is shown in the PEF boolean element document. Usage as a useful datatype is shown in the following sample usage schema and sample XML.

XML Schema:

  • The schema and examples do not explicitly show the lines that set the namespaces.
  • All schema examples will use xsd: as the namespace for the schema tags and datatypes, and null for all the locally generated namespaces.
  • XML Examples will exclude namespace modifiers for clarity. Actual XML will probably need namespaces.
  • <xsd:simpleType name="xsd:boolean">
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="true"/>
        <xsd:enumeration value="True"/>
        <xsd:enumeration value="TRUE"/>
        <xsd:enumeration value="false"/>
        <xsd:enumeration value="False"/>
        <xsd:enumeration value="FALSE"/>
      </xsd:restriction>
    </xsd:simpleType>
    

    Sample Usage Schema:

  • This datatype implies that the application must be able to accept the various case alternatives of true and false. If only {true, false} are to be acceptable, use the schema boolean datatype.
  • This datatype alone contains no elements. All namespace requirements will be derived from the schema that includes this file. The following uses unqualified.
  •    <xsd:element name="someFlag" type="boolean"/>
    

    Sample XML:

       <someFlag>True</someFlag>
    

    Last Modified: March 21, 2001
    ©Copyright 2001 POSC. All rights reserved.