This document presents the schema for the MOBBL XML configs. Although the general structure of the files belonging to the schema is supposed to be final and the schema successfully validates the existing XML configs, it is still a work in progress. In order to make the schema more meaningful, the simple types (in practice: the types of the attributes) still need to be restricted further, and some elements/attributes that are not used any longer may have to be removed from the schema. Furthermore, some new features might not be supported by the schema.

Main MOBBL Schema

This file includes all other sub schema files.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:mb="http://itude.com/schemas/MB/2.0"
  targetNamespace="http://itude.com/schemas/MB/2.0"
  elementFormDefault="qualified">

  <xs:include id="commonTypes" schemaLocation="common.xsd" />
  <xs:include id="modelSchema" schemaLocation="model.xsd" />
  <xs:include id="viewSchema" schemaLocation="view.xsd" />
  <xs:include id="controllerSchema" schemaLocation="controller.xsd" />

  <xs:element name="Configuration" type="mb:Configuration" />
   <xs:complexType name="Configuration">
     <xs:choice>
       <xs:element name="Include" minOccurs="0" maxOccurs="unbounded" type="mb:Include" />

       <xs:sequence>
         <xs:element name="Model" minOccurs="0" type="mb:Model" />

         <xs:element name="Controller" minOccurs="0" type="mb:Controller" />

         <xs:element name="View" minOccurs="0" type="mb:View" />
       </xs:sequence>
     </xs:choice>
   </xs:complexType>
</xs:schema>
                    

Sub schema files

This file includes all other sub schema files.
The MVC pattern in the schema is divided up into four files: model.xsd, view.xsd, controller.xsd contain respectively the model, view and controller part of the schema; common.xsd contains components shared among all schema files.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:mb="http://itude.com/schemas/MB/2.0"
  xmlns:analysis="http://itude.com/schemas/analysis/MB/2.0"
  targetNamespace="http://itude.com/schemas/MB/2.0"
  elementFormDefault="qualified">

  <xs:include id="commonTypesModel" schemaLocation="common.xsd" />
  <xs:complexType name="Model">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Include" type="mb:Include" />

      <xs:element name="Domains" type="mb:Domains" />
      <xs:element name="Documents" type="mb:Documents" />
    </xs:choice>
  </xs:complexType>

  <!-- DOMAINS -->

  <xs:complexType name="Domains">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Include" type="mb:Include" />

      <xs:element name="Domain" type="mb:Domain" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="Domain">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Include" minOccurs="0" maxOccurs="unbounded" type="mb:Include" />

      <xs:element name="DomainValidator" type="mb:DomainValidator" />
    </xs:choice>

    <xs:attribute name="name" use="required" type="mb:DomainName" />

    <!-- Seems to be always "string" (in practice), analysis shows that
         any value except float,int,double will result in a text keyboard -->
    <xs:attribute name="type" use="required" type="mb:DomainType" />
    <!-- Doesn't occur in analyzed XML configs, is parsed, unused in code
         it seems -->
    <xs:attribute name="maxLength" use="optional" type="xs:integer" />
  </xs:complexType>

  <xs:complexType name="DomainValidator">
    <!-- any string really -->
    <xs:attribute name="title" use="required" type="xs:string" />
    <xs:attribute name="value" type="xs:string" />

    <xs:attribute name="name" use="optional" type="mb:InternalIdentifier">
      <xs:annotation><xs:appinfo>
          <analysis:absent />
          <analysis:parsed platform="android" />
        </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="lowerBound" use="optional" type="xs:double">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
        <analysis:parsed platform="android" />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="upperBound" use="optional" type="xs:double">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
        <analysis:parsed platform="android" />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:simpleType name="DomainType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="string" />
      <xs:enumeration value="int" />
      <xs:enumeration value="float" />
      <xs:enumeration value="double" />
    </xs:restriction>
  </xs:simpleType>

  <!-- DOCUMENTS -->

  <xs:complexType name="Documents">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Include" type="mb:Include" />

      <xs:element name="Document" type="mb:Document" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="Document">
    <xs:sequence>
      <xs:element name="Element" minOccurs="0" maxOccurs="unbounded"
        type="mb:Element" />
    </xs:sequence>
    <xs:attribute name="autoCreate" use="optional" type="mb:Boolean" />
    <xs:attribute name="dataManager" use="required" type="mb:ExternalIdentifier" />
    <xs:attribute name="name" use="required" type="mb:DocumentName" />
    <xs:attribute name="rootElement" use="optional" type="xs:NCName" />
  </xs:complexType>

  <xs:complexType name="Element">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Element" minOccurs="0" maxOccurs="unbounded"
        type="mb:Element" />
      <xs:element name="Attribute" minOccurs="0" maxOccurs="unbounded"
        type="mb:Attribute" />
    </xs:choice>
    <xs:attribute name="maxOccurs" use="optional" type="xs:integer" />
    <xs:attribute name="minOccurs" use="optional" type="xs:integer" />
    <xs:attribute name="name" use="required" type="xs:Name" />
    <!-- does not occur in android/iOS parsing code -->
    <xs:attribute name="type" use="optional" type="xs:QName">
      <xs:annotation>
        <xs:appinfo>
          <analysis:unused platform="android" />
        </xs:appinfo>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:complexType name="Attribute">
    <xs:attribute name="defaultValue" use="optional" />
    <xs:attribute name="name" use="required" />
    <xs:attribute name="type" use="optional" type="mb:DomainName" />

    <!-- does not occur in android/iOS parsing code -->
    <xs:attribute name="value" use="optional" type="xs:string">
      <xs:annotation><xs:appinfo>
        <analysis:unused platform="both" />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <!-- Not found in analyzed XML configs -->
    <xs:attribute name="required" use="optional">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
        <analysis:parsed platform="both" />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
  </xs:complexType>

</xs:schema>      	
                        
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:mb="http://itude.com/schemas/MB/2.0"
  xmlns:analysis="http://itude.com/schemas/analysis/MB/2.0"
  targetNamespace="http://itude.com/schemas/MB/2.0"
  elementFormDefault="qualified">
  <xs:include id="commonTypesView" schemaLocation="common.xsd" />

  <xs:complexType name="View">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Include" type="mb:Include" />

      <xs:element name="Alerts" type="mb:Alerts" />
      <xs:element name="Dialogs" type="mb:Dialogs" />
      <xs:element name="Page" type="mb:Page" />
      <xs:element name="Toolbar" type="mb:Toolbar" />
    </xs:choice>
  </xs:complexType>

  <!-- ALERTS -->
  <xs:complexType name="Alerts">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Include" type="mb:Include" />

      <xs:element name="Alert" maxOccurs="unbounded" type="mb:Alert" />
    </xs:choice>
  </xs:complexType>

  <!-- does not occur in iOS parsing code (probably different branch or something) -->
  <xs:complexType name="Alert">
    <xs:sequence>
      <xs:element name="Field" maxOccurs="unbounded" type="mb:Field" />
    </xs:sequence>
    <xs:attribute name="document" use="required" type="mb:DocumentName" />
    <xs:attribute name="name" use="required" type="mb:AlertName" />
    <xs:attribute name="title" use="required" type="xs:string" />
    <xs:attribute name="type">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
        <analysis:parsed platform="both" />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="style">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
        <analysis:parsed platform="both" />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="titlePath">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
      </xs:appinfo>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <!-- DIALOGS -->
  <xs:complexType name="Dialogs">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Include" type="mb:Include" />

      <xs:element name="DialogGroup" type="mb:DialogGroup" />
      <xs:element name="Dialog" type="mb:Dialog" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="DialogGroup"><!-- skipped! -->
    <xs:sequence>
      <xs:element name="Dialog" maxOccurs="unbounded" type="mb:Dialog" />
    </xs:sequence>
    <xs:attribute name="mode" use="required">
        <xs:annotation><xs:appinfo>
          <analysis:parsed />
        </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="name" use="required" type="mb:DialogName" />
    <xs:attribute name="title" use="required" type="xs:string" />
    <!-- does not occur in iOS parsing code -->
    <xs:attribute name="showAs" use="required" type="xs:NCName" />
    <xs:attribute name="domain" type="xs:NCName" />
    <!-- Not found in analyzed XML configs -->
    <xs:attribute name="icon">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <!-- does not occur in iOS parsing code -->
    <xs:attribute name="action" />
  </xs:complexType>

  <xs:complexType name="Dialog">
    <xs:sequence>
      <xs:element name="PageStack" minOccurs="0" maxOccurs="unbounded"
        type="mb:PageStack" />
    </xs:sequence>
    <xs:attribute name="domain" type="mb:DomainName" />
    <xs:attribute name="icon" type="xs:string">
      <xs:annotation><xs:appinfo>
        <analysis:parsed />
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="mode" use="required" >
      <xs:simpleType>
        <xs:union memberTypes="xs:string">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="STACK" />
              <xs:enumeration value="SPLIT" />
            </xs:restriction>
          </xs:simpleType>
        </xs:union>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="name" use="required" type="mb:DialogName" />
    <xs:attribute name="showAs">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="TAB" />
          <xs:enumeration value="DOCUMENT" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="action" type="mb:OutcomeName">
      <xs:annotation><xs:documentation>
        Should be called "outcome" instead of "action".
      </xs:documentation></xs:annotation>
    </xs:attribute>
    <xs:attribute name="title" type="xs:string" />
    <!-- does not occur in android parsing code -->
    <xs:attribute name="addToNavbar">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
        <analysis:absent />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="closeable" type="xs:boolean">
      <xs:annotation><xs:appinfo>
        <analysis:custom />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="titlePortrait" type="xs:string" />
    <!-- does not occur in android parsing code  (new features) -->
    <xs:attribute name="contentType">
      <xs:simpleType>
        <xs:union memberTypes="xs:string">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="SPLIT" />
              <xs:enumeration value="SINGLE" />
            </xs:restriction>
          </xs:simpleType>
        </xs:union>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="decorator">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="DEFAULT" />
          <xs:enumeration value="MODAL" />
          <xs:enumeration value="FULLSCREEN" />
          <xs:enumeration value="MENU" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="stackStrategy">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="ROOT" />
          <xs:enumeration value="STACK" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <!-- Not found in analyzed XML configs -->
    <!-- does not occur in android parsing code -->
    <xs:attribute name="groupName">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
        <analysis:parsed platform="ios" />
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="position">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
        <analysis:parsed platform="ios" />
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <!-- PAGES -->
  <xs:complexType name="Page">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Panel" type="mb:Panel" />
      <xs:element name="Field" type="mb:Field" />
      <xs:element name="ForEach" type="mb:ForEach" />
    </xs:choice>
    <xs:attribute name="document" use="required" type="mb:DocumentPath" />
    <xs:attribute name="name" use="required" type="mb:PageName" />
    <xs:attribute name="title" type="xs:string" />
    <xs:attribute name="titlePath" type="mb:DocumentPath" />
    <xs:attribute name="type" use="optional">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="normal" />
          <xs:enumeration value="popup" />
          <xs:enumeration value="error" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="height" use="optional" type="xs:integer">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
        <analysis:parsed />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="preCondition" use="optional" type="mb:PreCondition">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="style" use="optional">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="scrollable" use="optional" type="xs:boolean">
      <xs:annotation><xs:appinfo>
        <analysis:parsed platform="android" />
        <analysis:unused platform="ios" />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="orientationPermissions" use="optional">
      <xs:simpleType>
        <xs:union memberTypes="xs:string">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="PORTRAIT" />
              <xs:enumeration value="LANDSCAPE" />
            </xs:restriction>
          </xs:simpleType>
        </xs:union>
      </xs:simpleType>
    </xs:attribute>
    <!-- does not occur in android/iOS parsing code -->
    <xs:attribute name="path" use="optional" type="mb:DocumentPath">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="autoCreate" use="optional" type="mb:Boolean">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <!-- Not found in analyzed XML configs -->

    <xs:attribute name="width" use="optional" type="xs:integer">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <!-- does not occur in iOS parsing code -->
    <xs:attribute name="reloadOnDocChange" use="optional" type="mb:Boolean" />
  </xs:complexType>

  <xs:complexType name="Panel">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Field" type="mb:Field" />
      <xs:element name="ForEach" type="mb:ForEach" />
      <xs:element name="Panel" type="mb:Panel" />
    </xs:choice>
    <xs:attribute name="preCondition" use="optional" type="mb:DocumentPath" />
    <xs:attribute name="style" use="optional" type="mb:InternalIdentifier">
      <xs:annotation><xs:documentation>
        Custom styles are also possible
      </xs:documentation></xs:annotation>
    </xs:attribute>
    <xs:attribute name="title" use="optional" type="xs:string" />
    <xs:attribute name="titlePath" use="optional" type="mb:DocumentPath" />

    <xs:attribute name="type" use="optional">
      <xs:simpleType>
        <xs:union memberTypes="mb:InternalIdentifier">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="PLAIN" />
              <xs:enumeration value="LIST" />
              <xs:enumeration value="SECTION" />
              <xs:enumeration value="ROW" />
              <xs:enumeration value="MATRIX" />
              <xs:enumeration value="MATRIXHEADER" />
              <xs:enumeration value="MATRIXROW" />
              <xs:enumeration value="SEGMENTEDCONTROL" />
            </xs:restriction>
          </xs:simpleType>
        </xs:union>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="width" use="optional" type="xs:integer" />
    <!-- does not occur in iOS parsing code -->
    <xs:attribute name="focused" type="xs:boolean">
      <xs:annotation><xs:documentation>
        This attribute is only used when the value of the "type" attribute is SEGMENTEDCONTROLITEM
      </xs:documentation></xs:annotation>
    </xs:attribute>
    <xs:attribute name="mode" use="optional" type="xs:string" fixed="EDITONLY">
      <xs:annotation><xs:appinfo>
        <analysis:parsed />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="name" use="optional" type="mb:PanelName">
      <xs:annotation><xs:appinfo>
        <analysis:parsed />
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="outcome" use="optional" type="mb:OutcomeName" />
    <xs:attribute name="path" use="optional" type="mb:DocumentPath" />   
    <!-- does not occur in android/iOS parsing code -->
    <xs:attribute name="permissions">
      <xs:annotation><xs:documentation>
        It seems it's not used anymore
      </xs:documentation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="pony" use="optional" type="xs:NCName">
      <xs:annotation><xs:documentation>
        Whatever...
      </xs:documentation></xs:annotation>
    </xs:attribute>
    <!-- does not occurin android/iOS parsing code -->
    <xs:attribute name="suppressRowComponent" use="optional" type="xs:NCName">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <!-- Not found in analyzed XML configs -->

    <xs:attribute name="height" use="optional" type="xs:integer">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
        <analysis:parsed />
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <!-- does not occur in android parsing code -->
    <xs:attribute name="zoomable">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <!-- cannot find reference to PageStack definition in android/iOS parsing code -->
  <xs:complexType name="PageStack">
    <xs:attribute name="action" use="optional" type="xs:string">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="localName" use="optional" type="mb:PageStackName" />
    <xs:attribute name="mode" type="xs:NCName">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="name" use="required" type="mb:PageStackName" />
    <xs:attribute name="title" type="xs:NCName">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="Field">
    <xs:attribute name="alignment">
      <xs:annotation><xs:documentation>
        Removed the mis-spelled "aligment" attribute.
      </xs:documentation></xs:annotation>
      <xs:simpleType>
        <xs:union memberTypes="xs:string">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="LEFT" />
              <xs:enumeration value="CENTER" />
              <xs:enumeration value="RIGHT" />
              <xs:enumeration value="CENTER_VERTICAL" />
            </xs:restriction>
          </xs:simpleType>
        </xs:union>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="dataType">
      <xs:simpleType>
        <xs:union memberTypes="xs:string">
          <xs:simpleType>
            <xs:union memberTypes="mb:InternalIdentifier">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:enumeration value="int" />
                  <xs:enumeration value="double" />
                  <xs:enumeration value="float" />
                  <xs:enumeration value="dateTime" />
                  <xs:enumeration value="numberWithTwoDecimals" />
                  <xs:enumeration value="numberWithThreeDecimals" />
                  <xs:enumeration value="priceWithTwoDecimals" />
                  <xs:enumeration value="priceWithThreeDecimals" />
                  <xs:enumeration value="priceWithFourDecimals" />
                  <xs:enumeration value="volume" />
                  <xs:enumeration value="percentageWithTwoDecimals" />
                </xs:restriction>
              </xs:simpleType>
            </xs:union>
          </xs:simpleType>
        </xs:union>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="formatMask">
      <xs:simpleType>
        <xs:union memberTypes="xs:string">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="dateTime" />
              <xs:enumeration value="numberWithTwoDecimals" />
              <xs:enumeration value="numberWithThreeDecimals" />
              <xs:enumeration value="priceWithTwoDecimals" />
              <xs:enumeration value="priceWithThreeDecimals" />
              <xs:enumeration value="priceWithFourDecimals" />
              <xs:enumeration value="volume" />
              <xs:enumeration value="percentageWithTwoDecimals" />
            </xs:restriction>
          </xs:simpleType>
        </xs:union>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="hidden">
      <xs:simpleType>
        <xs:union memberTypes="mb:Boolean xs:string" />
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="name" type="mb:FieldName" />
    <xs:attribute name="outcome" type="mb:OutcomeName" />
    <xs:attribute name="path" type="mb:DocumentPath"/>
    <xs:attribute name="preCondition" type="mb:PreCondition" />
    <xs:attribute name="style" type="xs:string">
      <xs:annotation><xs:documentation>
        Style names are littered throughout the code, need to collect all possible values later.
      </xs:documentation></xs:annotation>
    </xs:attribute>
    <xs:attribute name="type" use="required">
      <xs:simpleType>
        <xs:union>
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="LABEL" />
              <xs:enumeration value="SUBLABEL" />
              <xs:enumeration value="BUTTON" />
              <xs:enumeration value="IMAGEBUTTON" />
              <xs:enumeration value="TEXT" />
              <xs:enumeration value="IMAGE" />
              <xs:enumeration value="ICON" />
              <xs:enumeration value="INPUTFIELD" />
              <xs:enumeration value="PASSWORDFIELD" />
              <xs:enumeration value="DROPDOWNLIST" />
              <xs:enumeration value="CHECKBOX" />
              <xs:enumeration value="RADIOGROUP" />
              <xs:enumeration value="MATRIX-TITLE" />
              <xs:enumeration value="MATRIX-DESCRIPTION" />
            </xs:restriction>
          </xs:simpleType>
          <xs:simpleType>
            <xs:restriction base="xs:string" />
          </xs:simpleType>
        </xs:union>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="valueIfNil" type="xs:string" />
    <xs:attribute name="width">
      <xs:simpleType>
        <xs:union memberTypes="xs:integer mb:Expression" />
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="label" type="xs:string" />
    <!-- does not occur in iOS parsing code -->
    <xs:attribute name="hint" type="xs:string" />
    <xs:attribute name="labelAttrs">
      <xs:simpleType>
        <xs:union memberTypes="mb:ExpressionList mb:InternalIdentifierList" />
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="source">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:annotation><xs:documentation>
            regex for URL needed here
          </xs:documentation></xs:annotation>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <!-- does not occur in android/iOS parsing code -->
    <xs:attribute name="max" type="xs:integer">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="min" type="xs:integer">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="readOnly" type="xs:boolean">
      <xs:annotation><xs:appinfo>
      <analysis:unused />
    </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="toRefresh" type="xs:NCName">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="value" type="xs:integer">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <!-- Not found in analyzed XML configs -->
    <xs:attribute name="height" type="xs:integer">
      <xs:annotation><xs:appinfo>
        <analysis:unused />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <!-- does not occur in android parsing code -->
    <xs:attribute name="required">
      <xs:annotation><xs:appinfo>
        <analysis:removed />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="custom1">
      <xs:annotation><xs:appinfo>
        <analysis:removed />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="custom2">
      <xs:annotation><xs:appinfo>
        <analysis:removed />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
    <xs:attribute name="custom3">
      <xs:annotation><xs:appinfo>
        <analysis:removed />
      </xs:appinfo></xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:complexType name="ForEach">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="ForEach" type="mb:ForEach" />
      <xs:element name="Panel" type="mb:Panel" />
      <xs:element name="Variable" type="mb:Variable" />
      <xs:element name="Field" type="mb:Field" />
    </xs:choice>
    <xs:attribute name="preCondition" type="mb:PreCondition" use="optional" />
    <xs:attribute name="suppressRowComponent" type="mb:Boolean" use="optional" />
    <xs:attribute name="value" use="required">
      <xs:annotation><xs:documentation>
        Need a documentpath regex here with link to documents: "docName:path/to/stuff" or something
      </xs:documentation></xs:annotation>
    </xs:attribute>
    <!-- Not found in analyzed XML configs -->
    <xs:attribute name="name">
      <xs:annotation><xs:appinfo>
        <analysis:absent />
        <analysis:unused />
      </xs:appinfo><xs:documentation>
        The "name" attribute is present in the hashmap of expected ForEach
        attributes, but it is then not retrieved from the XML. The name member
        of MBForEachDefinition objects is never accessed.
      </xs:documentation></xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:complexType name="Variable">
    <xs:attribute name="expression" use="required" type="mb:DocumentPath"/>
    <xs:attribute name="name" use="required" type="mb:VariableName" />
  </xs:complexType>

  <!-- TOOLBAR -->
  <xs:complexType name="Toolbar">
    <xs:choice>
      <xs:element name="Include" minOccurs="0" maxOccurs="unbounded" type="mb:Include" />

      <xs:element name="Tool" maxOccurs="unbounded" type="mb:Tool" />
    </xs:choice>
  </xs:complexType>

  <!-- cannot find reference to PageStack definition in iOS parsing code -->
  <xs:complexType name="Tool">
    <xs:attribute name="icon" type="mb:IconName" use="optional" />
    <xs:attribute name="name" type="mb:ToolName" use="required" />
    <xs:attribute name="outcome" type="mb:OutcomeName" use="optional" />
    <xs:attribute name="preCondition" type="mb:PreCondition" />
    <xs:attribute name="title" type="xs:string" use="required" />
    <xs:attribute name="type" use="optional">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="REFRESH" />
          <xs:enumeration value="BUTTON" />
          <xs:enumeration value="SEARCH" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="visibility" use="required">
      <xs:annotation><xs:documentation>
        This attribute can hold several flags as a value: "FLAG_1|FLAG_2|...|FLAG_N"
        The possibile flags are: ALWAYS, IFROOM, OVERFLOW, SHOWTEXT.
      </xs:documentation></xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:schema>        
                        
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:mb="http://itude.com/schemas/MB/2.0"
  targetNamespace="http://itude.com/schemas/MB/2.0"
  elementFormDefault="qualified">
  <xs:include id="commonTypesModel" schemaLocation="common.xsd" />
  <xs:complexType name="Controller">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Include" type="mb:Include" />

      <xs:element name="Actions" type="mb:Actions" />
      <xs:element name="Wiring" type="mb:Wiring" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="Actions">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Include" type="mb:Include" />

      <xs:element name="Action" type="mb:Action" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="Action">
    <xs:attribute name="className" use="required" type="xs:NCName" />
    <xs:attribute name="name" use="required" type="xs:NCName" />
  </xs:complexType>

  <xs:complexType name="Wiring">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="Include" type="mb:Include" />
      <xs:element name="Outcome" type="mb:Outcome" />
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="Outcome">
    <xs:attribute name="action" use="required" type="xs:NCName" />
    <xs:attribute name="dialog" type="xs:NCName" />
    <xs:attribute name="displayMode" type="xs:NCName" />
    <xs:attribute name="name" use="required" type="xs:NCName" />
    <xs:attribute name="noBackgroundProcessing" type="xs:NCName" />
    <xs:attribute name="origin" use="required" />
    <xs:attribute name="preCondition" />
    <xs:attribute name="transferDocument" type="xs:NCName" />

    <!-- does not occur in android/iOS code (new feature) -->
    <xs:attribute name="stack" type="xs:NCName" />
    <!-- does not occur in android parsing code (new feature)-->
    <xs:attribute name="transitioningStyle" type="xs:NCName" />
    <!-- Doesn't occur in analyzed XML configs -->
    <xs:attribute name="persist" />
    <!-- does not occur in iOS code -->
    <xs:attribute name="indicator" type="xs:NCName" />
  </xs:complexType>
</xs:schema>		
                        
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:mb="http://itude.com/schemas/MB/2.0"
  targetNamespace="http://itude.com/schemas/MB/2.0"
  elementFormDefault="qualified">
  <xs:complexType name="Include">
    <xs:attribute name="name" use="required">
      <xs:simpleType>
        <xs:annotation><xs:documentation>
          Need a file path regex here
        </xs:documentation></xs:annotation>
        <xs:restriction base="xs:string" />
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
  <!-- identifiers of entities declared in the XML -->
  <xs:simpleType name="InternalIdentifier">
    <xs:restriction base="xs:string">
      <xs:pattern value="[_a-zA-Z][_.a-zA-Z0-9-]*" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="InternalIdentifierList">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="[_a-zA-Z][_.a-zA-Z0-9-]*(,[_a-zA-Z][_.a-zA-Z0-9-]*)*" />
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:annotation><xs:documentation>
          This is a stub to get the ${...} expressions to validate, still need a regex, here or elsewhere
        </xs:documentation></xs:annotation>
        <xs:restriction base="xs:string">
          <xs:pattern value="$\{[^}]\}" />
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <!-- (Qualified) Java class name org.something.something.JavaClass or just
       JavaClass -->
  <xs:simpleType name="JavaIdentifier">
    <xs:restriction base="xs:string">
      <xs:pattern value="([_$a-zA-Z][_$a-zA-Z0-9]*\.)*[_$a-zA-Z][_$a-zA-Z0-9]*" />
    </xs:restriction>
  </xs:simpleType>
  <!-- Objective-C class name -->
  <xs:simpleType name="ObjectiveCIdentifier">
    <xs:restriction base="xs:string">
      <xs:pattern value="[_a-zA-Z][_a-zA-Z0-9]*" />
    </xs:restriction>
  </xs:simpleType>
  <!-- ExternalIdentifierType (assuming all "handlers" and such are classes
       defined elsewhere) -->
  <xs:simpleType name="ExternalIdentifier">
    <xs:union memberTypes="mb:JavaIdentifier mb:ObjectiveCIdentifier" />
  </xs:simpleType>
  <!-- MOBBL Boolean, maybe it's better to use an xs:boolean instead, but no
       config would validate -->
  <xs:simpleType name="Boolean">
    <xs:restriction base="xs:string">
      <xs:enumeration value="TRUE" />
      <xs:enumeration value="True" />
      <xs:enumeration value="true" />
      <xs:enumeration value="FALSE" />
      <xs:enumeration value="False" />
      <xs:enumeration value="false" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DomainName">
    <xs:restriction base="mb:InternalIdentifier" />
  </xs:simpleType>

  <xs:simpleType name="DocumentName">
    <xs:restriction base="mb:InternalIdentifier">
      <xs:annotation><xs:documentation>
        The name is used to determine the file name of the document, in
        case of an MBFileDataHandler, and for the name of the root element,
        if not specified.
      </xs:documentation></xs:annotation>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="AlertName">
    <xs:restriction base="mb:InternalIdentifier">
      <xs:annotation><xs:documentation>
        The name is only used once to create the MBAlertDefinition, and as the
        key for its place in a HashMap.
      </xs:documentation></xs:annotation>
    </xs:restriction>
  </xs:simpleType>



  <xs:simpleType name="DialogName">
    <xs:restriction base="mb:InternalIdentifier" />
  </xs:simpleType>


  <xs:simpleType name="OutcomeName">
    <xs:union memberTypes="mb:ExternalIdentifier mb:Expression" />
  </xs:simpleType>

  <xs:simpleType name="PageName">
    <xs:restriction base="mb:InternalIdentifier" />
  </xs:simpleType>

  <xs:simpleType name="PanelName">
    <xs:restriction base="mb:InternalIdentifier" />
  </xs:simpleType>

  <xs:simpleType name="DocumentPath">
    <xs:restriction base="xs:string">
      <xs:annotation><xs:documentation>
        Need regex matching XPath string
      </xs:documentation></xs:annotation>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="PreCondition">
    <xs:restriction base="xs:string">
      <xs:annotation><xs:documentation>
        Need regex matching XPath string plus eq/>/==/!= and stuff
      </xs:documentation></xs:annotation>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="PageStackName">
    <xs:restriction base="mb:InternalIdentifier">
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="Expression">
    <xs:restriction base="xs:string">
      <xs:annotation><xs:documentation>
        Need regex for ${XPath expression}
      </xs:documentation></xs:annotation>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ExpressionList">
    <xs:restriction base="xs:string">
      <xs:annotation><xs:documentation>
        Need regex for ${XPath expression},${XPath expression},...,${XPath expression}
      </xs:documentation></xs:annotation>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="FieldName">
    <xs:restriction base="mb:InternalIdentifier" />
  </xs:simpleType>

  <xs:simpleType name="VariableName">
    <xs:restriction base="mb:InternalIdentifier" />
  </xs:simpleType> 
  <xs:simpleType name="ToolName">
    <xs:restriction base="mb:InternalIdentifier" />
  </xs:simpleType>
  <xs:simpleType name="IconName">
    <xs:restriction base="mb:InternalIdentifier" />
  </xs:simpleType>
</xs:schema>		
                        


How to use the schema

You can use the schema to validate your XML files and there are many (free and commercial) tools available online that let you do this. To make your XML editor aware of the schema for the MOBBL 2.0 namespace you have two options:

Direct schema link

Add a schemaLocation attribute (in the W3C Schema-instace namespace) to the document element, such as the following:

<Configuration
  xmlns="http://itude.com/schemas/MB/2.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation= 
  "http://itude.com/schemas/MB/2.0
  http://itude-mobile-io.local/downloads/schema/mobbl.xsd">
  <!-- content -->
</Configuration>
    

Adding schema to XML catalog

Any XSD 1.0 compliant XML editor should be able to validate your XML configuration using our schema. Some editors have an XML catalog, in which you can link the URI leading the the online schema to the MOBBL 2.0 namespace URI, so you only have to use the xmlns attribute. An example, using eclipse:


Open eclipse preferences and navigate to the XML catalog pane (XML > XML Catalog) and click on "Add...".



Fill in the "Location" field with the current web-address of the main schema file and the "Key" field with the MOBBL 2.0 namespace URI. Click OK in this and the previous dialog to confirm. Happy validating!