A Schema for XForms

<?xml version="1.0"?>
<!-- edited with XML Spy v4.0.1 U (http://www.xmlspy.com) by Micah Dubinko (XForms WG) -->
<!--$Id: sliceA.html,v 1.1 2002/01/17 00:08:14 tvraman Exp $-->
<xsd:schema targetNamespace="http://www.w3.org/2002/01/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
		xmlns:xlink="http://www.w3.org/1999/xlink"
		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
		xmlns:xforms="http://www.w3.org/2002/01/xforms"
		elementFormDefault="qualified">
  <!--
Open Issues

Need a datatype for 'list of mediaTypes' on mediaType of <upload>
-->
  <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd">
    <xsd:annotation>
      <xsd:documentation>Get access to xml:lang and friends</xsd:documentation>
    </xsd:annotation>
  </xsd:import>
  <xsd:import namespace="http://www.w3.org/1999/xlink" schemaLocation="XLink-Schema.xsd"/>
  <xsd:import namespace="http://www.w3.org/2001/xml-events" schemaLocation="XML-Events-Schema.xsd"/>
  <!-- 
structural elements
-->
  <xsd:attributeGroup name="horzAttrs">
    <xsd:annotation>
      <xsd:documentation>Attributes for _every_ element in XForms</xsd:documentation>
    </xsd:annotation>
    <xsd:anyAttribute namespace="##other"/>
  </xsd:attributeGroup>
  <xsd:element name="model">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:instance" minOccurs="0"/>
        <xsd:element ref="xforms:schema" minOccurs="0"/>
        <xsd:sequence minOccurs="0" maxOccurs="unbounded">
          <xsd:choice>
            <xsd:element ref="xforms:submitInfo"/>
            <xsd:element ref="xforms:privacy"/>
            <xsd:element ref="xforms:bind"/>
            <xsd:element ref="xforms:action"/>
            <xsd:element ref="xforms:extension"/>
          </xsd:choice>
        </xsd:sequence>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="extensionFunctions" type="xforms:QNameList" use="optional"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="schema">
    <xsd:annotation>
      <xsd:documentation>schema container.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:any namespace="##other"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:linkingAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="instance">
    <xsd:annotation>
      <xsd:documentation>instance container.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:any namespace="##any" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:linkingAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="privacy">
    <xsd:annotation>
      <xsd:documentation>privacy reference.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:linkingAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="submitInfo">
    <xsd:annotation>
      <xsd:documentation>submit info container.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence minOccurs="0" maxOccurs="unbounded">
        <xsd:group ref="xforms:actionGroup"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="action" type="xsd:anyURI" use="optional"/>
      <xsd:attribute name="mediaTypeExtension" use="optional" default="none">
        <xsd:simpleType>
          <xsd:union memberTypes="xforms:QNameButNotNCNAME">
            <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                <xsd:enumeration value="none"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:union>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attribute name="method" use="optional" default="post">
        <xsd:simpleType>
          <xsd:union memberTypes="xforms:QNameButNotNCNAME">
            <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                <xsd:enumeration value="post"/>
                <xsd:enumeration value="get"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:union>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attribute name="version" type="xsd:NMTOKEN" use="optional"/>
      <xsd:attribute name="indent" type="xsd:boolean" use="optional"/>
      <xsd:attribute name="encoding" type="xsd:string" use="optional"/>
      <xsd:attribute name="mediaType" type="xsd:string" use="optional"/>
      <xsd:attribute name="omitXMLDeclaration" type="xsd:boolean" use="optional"/>
      <xsd:attribute name="standalone" type="xsd:boolean" use="optional"/>
      <xsd:attribute name="CDATASectionElements" type="xforms:QNameList" use="optional"/>
      <xsd:attribute name="replace" use="optional" default="all">
        <xsd:simpleType>
          <xsd:union memberTypes="xforms:QNameButNotNCNAME">
            <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                <xsd:enumeration value="all"/>
                <xsd:enumeration value="instance"/>
                <xsd:enumeration value="none"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:union>
        </xsd:simpleType>
      </xsd:attribute>
    </xsd:complexType>
  </xsd:element>
  <xsd:attributeGroup name="linkingAttributes">
    <xsd:attribute ref="xlink:type" default="simple"/>
    <xsd:attribute ref="xlink:href"/>
    <xsd:attribute name="href" type="xsd:anyURI" use="prohibited"/>
  </xsd:attributeGroup>
  <xsd:element name="bind">
    <xsd:annotation>
      <xsd:documentation>Definition of bind container.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence minOccurs="0" maxOccurs="unbounded">
        <xsd:element ref="xforms:bind"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="ref" type="xsd:string" use="optional"/>
      <xsd:attribute name="type" type="xsd:QName" use="optional"/>
      <xsd:attribute name="readOnly" type="xsd:string" use="optional"/>
      <xsd:attribute name="required" type="xsd:string" use="optional"/>
      <xsd:attribute name="relevant" type="xsd:string" use="optional"/>
      <xsd:attribute name="isValid" type="xsd:string" use="optional"/>
      <xsd:attribute name="calculate" type="xsd:string" use="optional"/>
      <xsd:attribute name="maxOccurs" use="optional">
        <xsd:simpleType>
          <xsd:union memberTypes="xsd:nonNegativeInteger">
            <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                <xsd:enumeration value="unbounded"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:union>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attribute name="minOccurs" type="xsd:nonNegativeInteger" use="optional"/>
    </xsd:complexType>
  </xsd:element>
  <!--
User Interface form controls
-->
  <xsd:group name="formControls">
    <xsd:choice>
      <xsd:element ref="xforms:input"/>
      <xsd:element ref="xforms:textarea"/>
      <xsd:element ref="xforms:secret"/>
      <xsd:element ref="xforms:output"/>
      <xsd:element ref="xforms:upload"/>
      <xsd:element ref="xforms:selectOne"/>
      <xsd:element ref="xforms:selectMany"/>
      <xsd:element ref="xforms:range"/>
      <xsd:element ref="xforms:submit"/>
      <xsd:element ref="xforms:button"/>
    </xsd:choice>
  </xsd:group>
  <xsd:attributeGroup name="bindFirstAttributes">
    <xsd:attribute name="model" type="xsd:IDREF" use="optional"/>
    <xsd:attribute name="ref" type="xsd:string" use="optional"/>
    <xsd:attribute name="bind" type="xsd:IDREF" use="optional"/>
  </xsd:attributeGroup>
  <xsd:attributeGroup name="bindAllAttributes">
    <xsd:attribute name="model" type="xsd:IDREF" use="optional"/>
    <xsd:attribute name="nodeset" type="xsd:string" use="optional"/>
    <xsd:attribute name="bind" type="xsd:IDREF" use="optional"/>
  </xsd:attributeGroup>
  <xsd:attributeGroup name="commonUIAttributes">
    <xsd:attribute ref="xml:lang" type="xsd:language" use="optional"/>
    <xsd:attribute name="class" type="xsd:string" use="optional"/>
    <xsd:attribute name="accessKey" type="xsd:string" use="optional"/>
    <xsd:attribute name="navIndex" type="xsd:nonNegativeInteger" use="optional"/>
  </xsd:attributeGroup>
  <xsd:element name="caption">
    <xsd:complexType mixed="true">
      <xsd:sequence>
        <xsd:any namespace="##any"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
      <xsd:attributeGroup ref="xforms:linkingAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="hint">
    <xsd:complexType mixed="true">
      <xsd:sequence>
        <xsd:any namespace="##any"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
      <xsd:attributeGroup ref="xforms:linkingAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="help">
    <xsd:complexType mixed="true">
      <xsd:sequence>
        <xsd:any namespace="##any"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
      <xsd:attributeGroup ref="xforms:linkingAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="alert">
    <xsd:complexType mixed="true">
      <xsd:sequence>
        <xsd:any namespace="##any"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
      <xsd:attributeGroup ref="xforms:linkingAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="extension">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:any namespace="##other"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="choices">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption" minOccurs="0"/>
        <xsd:sequence maxOccurs="unbounded">
          <xsd:choice>
            <xsd:element ref="xforms:choices"/>
            <xsd:element ref="xforms:item"/>
            <xsd:element ref="xforms:itemset"/>
          </xsd:choice>
        </xsd:sequence>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="value">
    <xsd:complexType mixed="true">
      <xsd:sequence>
        <xsd:any namespace="##any"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="item">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption"/>
        <xsd:element ref="xforms:value"/>
        <xsd:group ref="xforms:optionalUIChildren" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="itemset">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption"/>
        <xsd:element ref="xforms:value"/>
        <xsd:group ref="xforms:optionalUIChildren" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindAllAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:group name="optionalUIChildren">
    <xsd:sequence>
      <xsd:choice>
        <xsd:element ref="xforms:help"/>
        <xsd:element ref="xforms:hint"/>
        <xsd:element ref="xforms:alert"/>
        <xsd:group ref="xforms:actionGroup"/>
        <xsd:element ref="xforms:extension"/>
      </xsd:choice>
    </xsd:sequence>
  </xsd:group>
  <xsd:element name="input">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption"/>
        <xsd:group ref="xforms:optionalUIChildren" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attribute name="inputMode" type="xsd:string" use="optional"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="textarea">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption"/>
        <xsd:group ref="xforms:optionalUIChildren" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attribute name="inputMode" type="xsd:string" use="optional"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="secret">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption"/>
        <xsd:group ref="xforms:optionalUIChildren" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attribute name="inputMode" type="xsd:string" use="optional"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="upload">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption"/>
        <xsd:group ref="xforms:optionalUIChildren" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
      <xsd:attribute name="mediaType" type="xsd:string" use="optional"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:group name="listChoices">
    <xsd:sequence>
      <xsd:choice>
        <xsd:element ref="xforms:item"/>
        <xsd:element ref="xforms:itemset"/>
        <xsd:element ref="xforms:choices"/>
      </xsd:choice>
    </xsd:sequence>
  </xsd:group>
  <xsd:element name="selectOne">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption"/>
        <xsd:group ref="xforms:listChoices" maxOccurs="unbounded"/>
        <xsd:group ref="xforms:optionalUIChildren" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
      <xsd:attribute name="selectUI" use="optional">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="radio"/>
            <xsd:enumeration value="checkbox"/>
            <xsd:enumeration value="menu"/>
            <xsd:enumeration value="listbox"/>
            <xsd:enumeration value="combo"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attribute name="selection" use="optional" default="closed">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="open"/>
            <xsd:enumeration value="closed"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="selectMany">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption"/>
        <xsd:group ref="xforms:listChoices" maxOccurs="unbounded"/>
        <xsd:group ref="xforms:optionalUIChildren" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
      <xsd:attribute name="selectUI" use="optional">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="radio"/>
            <xsd:enumeration value="checkbox"/>
            <xsd:enumeration value="menu"/>
            <xsd:enumeration value="listbox"/>
            <xsd:enumeration value="combo"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attribute name="selection" use="optional" default="closed">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="open"/>
            <xsd:enumeration value="closed"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="range">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption"/>
        <xsd:group ref="xforms:optionalUIChildren" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
      <xsd:attribute name="start" type="xsd:string" use="optional"/>
      <xsd:attribute name="end" type="xsd:string" use="optional"/>
      <xsd:attribute name="stepSize" type="xsd:string" use="optional"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="button">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption"/>
        <xsd:group ref="xforms:optionalUIChildren" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="output">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="ref" type="xsd:string" use="optional"/>
      <xsd:attribute name="model" type="xsd:string" use="optional"/>
      <xsd:attribute name="format" type="xsd:string" use="optional"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="submit">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:caption"/>
        <xsd:group ref="xforms:optionalUIChildren" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="submitInfo" type="xsd:IDREF" use="required"/>
    </xsd:complexType>
  </xsd:element>
  <!--
XForms Actions
-->
  <xsd:attributeGroup name="XMLEvents">
    <xsd:attribute ref="ev:event"/>
    <xsd:attribute ref="ev:observer"/>
    <xsd:attribute ref="ev:target"/>
    <xsd:attribute ref="ev:handler"/>
    <xsd:attribute ref="ev:phase"/>
    <xsd:attribute ref="ev:propagate"/>
    <xsd:attribute ref="ev:defaultAction"/>
  </xsd:attributeGroup>
  <xsd:group name="actionGroup">
    <xsd:choice>
      <xsd:element ref="xforms:action"/>
      <xsd:group ref="xforms:actions"/>
    </xsd:choice>
  </xsd:group>
  <xsd:element name="action">
    <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded">
        <xsd:group ref="xforms:actions"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:group name="actions">
    <xsd:choice>
      <xsd:element ref="xforms:dispatch"/>
      <xsd:element ref="xforms:refresh"/>
      <xsd:element ref="xforms:revalidate"/>
      <xsd:element ref="xforms:recalculate"/>
      <xsd:element ref="xforms:setFocus"/>
      <xsd:element ref="xforms:loadURI"/>
      <xsd:element ref="xforms:setValue"/>
      <xsd:element ref="xforms:submitInstance"/>
      <xsd:element ref="xforms:resetInstance"/>
      <xsd:element ref="xforms:insert"/>
      <xsd:element ref="xforms:delete"/>
      <xsd:element ref="xforms:setRepeatCursor"/>
      <xsd:element ref="xforms:toggle"/>
      <xsd:element ref="xforms:script"/>
      <xsd:element ref="xforms:message"/>
    </xsd:choice>
  </xsd:group>
  <xsd:element name="dispatch">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="name" type="xsd:NMTOKEN" use="required"/>
      <xsd:attribute name="target" type="xsd:IDREF" use="required"/>
      <xsd:attribute name="bubbles" type="xsd:boolean" use="optional" default="true"/>
      <xsd:attribute name="cancelable" type="xsd:boolean" use="optional" default="true"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="refresh">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="recalculate">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="revalidate">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="setFocus">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="idref" type="xsd:IDREF" use="required"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="loadURI">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attribute ref="xlink:href" use="required"/>
      <xsd:attribute ref="xlink:show" use="optional"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="setValue">
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
          <xsd:attributeGroup ref="xforms:horzAttrs"/>
          <xsd:attribute name="id" type="xsd:ID" use="optional"/>
          <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
          <xsd:attribute name="value" type="xsd:string"/>
          <xsd:attributeGroup ref="xforms:XMLEvents"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="submitInstance">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="submitInfo" type="xsd:IDREF" use="optional"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="resetInstance">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
      <xsd:attribute name="model" type="xsd:IDREF"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="insert">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindAllAttributes"/>
      <xsd:attribute name="at" type="xsd:string" use="required"/>
      <xsd:attribute name="position" use="required">
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="before"/>
            <xsd:enumeration value="after"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="delete">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindAllAttributes"/>
      <xsd:attribute name="at" type="xsd:string" use="required"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="setRepeatCursor">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="repeat" type="xsd:IDREF" use="required"/>
      <xsd:attribute name="cursor" type="xsd:string" use="required"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="toggle">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="case" type="xsd:IDREF" use="required"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="script">
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
          <xsd:attributeGroup ref="xforms:horzAttrs"/>
          <xsd:attribute name="id" type="xsd:ID" use="optional"/>
          <xsd:attribute name="type" type="xsd:string" use="required"/>
          <xsd:attribute name="role" type="xsd:string" use="optional"/>
          <xsd:attributeGroup ref="xforms:XMLEvents"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="message">
    <xsd:complexType>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attribute name="level" type="xsd:string" use="required"/>
      <xsd:attributeGroup ref="xforms:XMLEvents"/>
    </xsd:complexType>
  </xsd:element>
  <!--
Advanced User Interface
-->
  <xsd:element name="group">
    <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded">
        <xsd:element ref="xforms:caption" minOccurs="0"/>
        <xsd:any namespace="##any"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="switch">
    <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded">
        <xsd:element ref="xforms:case"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="required"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
      <xsd:attribute name="default" type="xsd:IDREF" use="optional"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="case">
    <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded">
        <xsd:any namespace="##any"/>
      </xsd:sequence>
      <xsd:attribute name="selected" type="xsd:boolean" use="optional"/>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="required"/>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="repeat">
    <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded">
        <xsd:any namespace="##any"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindAllAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
      <xsd:attribute name="startIndex" type="xsd:positiveInteger" use="optional"/>
      <xsd:attribute name="number" type="xsd:nonNegativeInteger" use="optional"/>
    </xsd:complexType>
  </xsd:element>
  <!--
New simpleTypes
-->
  <xsd:simpleType name="QNameList">
    <xsd:list itemType="xsd:QName"/>
  </xsd:simpleType>
  <xsd:simpleType name="QNameButNotNCNAME">
    <xsd:restriction base="xsd:QName">
      <xsd:pattern value="[^:]+:[^:]+"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="listItem">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="/S+"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="listItems">
    <xsd:list itemType="xforms:listItem"/>
  </xsd:simpleType>
</xsd:schema>

A.1 Schema for XLink

This schema is not normative with respect to XLink, although it is considered a normative part of the XForms definition.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.w3.org/1999/xlink"
      xmlns:xl="http://www.w3.org/1999/xlink"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified" attributeFormDefault="unqualified">
  <!--
  This schema is in no way normative for XLink; it functions only as a part of the
  Schema for XForms to allow proper assessment of XForms documents and fragments.
  
  See the XForms specification for details.
-->
  <xsd:attribute name="href" type="xsd:anyURI"/>
  <xsd:attribute name="type" type="xsd:string"/>
  <xsd:attribute name="role" type="xsd:anyURI"/>
  <xsd:attribute name="arcrole" type="xsd:anyURI"/>
  <xsd:attribute name="title" type="xsd:string"/>
  <xsd:attribute name="actuate">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="onLoad"/>
        <xsd:enumeration value="onRequest"/>
        <xsd:enumeration value="other"/>
        <xsd:enumeration value="none"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="show">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="new"/>
        <xsd:enumeration value="replace"/>
        <xsd:enumeration value="embed"/>
        <xsd:enumeration value="other"/>
        <xsd:enumeration value="none"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="label" type="xsd:NCName"/>
  <xsd:attribute name="from" type="xsd:NCName"/>
  <xsd:attribute name="to" type="xsd:NCName"/>
</xsd:schema>

A.2 Schema for XML Events

This schema is not normative with respect to XML Events, although it is considered a normative part of the XForms definition.

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v4.0.1 U (http://www.xmlspy.com) by Micah Dubinko (XForms WG) -->
<xsd:schema targetNamespace="http://www.w3.org/2001/xml-events"
     xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    attributeFormDefault="unqualified">
  <!--
  This schema is in no way normative for XML Events; it functions only as a part of the
  Schema for XForms to allow proper assessment of XForms documents and fragments.
  
  See the XForms specification for details.
-->
  <xsd:attribute name="event" type="xsd:NMTOKEN"/>
  <xsd:attribute name="observer" type="xsd:IDREF"/>
  <xsd:attribute name="target" type="xsd:IDREF"/>
  <xsd:attribute name="handler" type="xsd:anyURI"/>
  <xsd:attribute name="phase">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="capture"/>
        <xsd:enumeration value="default"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="propagate">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="stop"/>
        <xsd:enumeration value="continue"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="defaultAction">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="cancel"/>
        <xsd:enumeration value="perform"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
</xsd:schema>