<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
 elementFormDefault="qualified"
 xmlns:xh11d="http://www.w3.org/1999/xhtml/datatypes/"
>
    <xs:import namespace="http://www.w3.org/1999/xhtml/datatypes/" 
               schemaLocation="xhtml-datatypes-1.xsd" />
  <xs:annotation>
    <xs:documentation>
      This is the XML Schema Basic Forms module for XHTML
      $Id: xhtml-basic-form-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $
    </xs:documentation>
    <xs:documentation source="xhtml-copyright-1.xsd"/>
  </xs:annotation>

  <xs:annotation>
    <xs:documentation>    
      Basic Forms

      This forms module is based on the HTML 3.2 forms model, with
      the WAI-requested addition of the label element. While this 
      module essentially mimics the content model and attributes of 
      HTML 3.2 forms, the element types declared herein also include
      all HTML 4 common attributes.

      Elements defined here:

        * form, label, input, select, option, textarea
    </xs:documentation>
    <xs:documentation source="xhtml-copyright-1.xsd"/>
    <xs:documentation 
         source="http://www.w3.org/TR/2001/REC-xhtml-modularization-20010410/abstract_modules.html#s_sformsmodule"/>
  </xs:annotation>

  <xs:attributeGroup name="xhtml.form.attlist">
    <xs:attributeGroup ref="xhtml.Common.attrib"/>
    <xs:attribute name="action" type="xh11d:URI" use="required"/>
    <xs:attribute name="method" use="optional" default="get">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="get"/>
          <xs:enumeration value="post"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="enctype" type="xh11d:ContentType" default="application/x-www-form-urlencoded"/>
  </xs:attributeGroup>
  
  <xs:group name="xhtml.form.content">
    <xs:sequence>
      <xs:group ref="xhtml.BlkNoForm.mix" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:group>

  <xs:complexType name="xhtml.form.type">
    <xs:group ref="xhtml.form.content"/>
    <xs:attributeGroup ref="xhtml.form.attlist"/>
  </xs:complexType>

  <xs:group name="xhtml.label.content">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element type="xhtml.input.type" name="input"/>
        <xs:element type="xhtml.select.type" name="select"/>
        <xs:element type="xhtml.textarea.type" name="textarea"/>
        <xs:group ref="xhtml.InlStruct.class"/>
        <xs:group ref="xhtml.InlPhras.class"/>
        <xs:group ref="xhtml.I18n.class"/>
        <xs:group ref="xhtml.InlPres.class"/>
        <xs:group ref="xhtml.InlSpecial.class"/>
        <xs:group ref="xhtml.Misc.class"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>

  <xs:attributeGroup name="xhtml.label.attlist">
    <xs:attributeGroup ref="xhtml.Common.attrib"/>
    <xs:attribute name="for" type="xs:IDREF"/>
    <xs:attribute name="accesskey" type="xh11d:Character"/>
  </xs:attributeGroup>

  <xs:complexType name="xhtml.label.type" mixed="true">
    <xs:group ref="xhtml.label.content"/>
    <xs:attributeGroup ref="xhtml.label.attlist"/>
  </xs:complexType>

<!-- 
Basic Forms removes button, 'image' and 'file' input types.
-->
  <xs:simpleType name="xhtml.InputType.class">
      <xs:restriction base="xs:NMTOKEN">
        <xs:enumeration value="text"/>
        <xs:enumeration value="password"/>
        <xs:enumeration value="checkbox"/>
        <xs:enumeration value="radio"/>
        <xs:enumeration value="submit"/>
        <xs:enumeration value="reset"/>
        <xs:enumeration value="hidden"/>
      </xs:restriction>
  </xs:simpleType>

  <xs:attributeGroup name="xhtml.input.attlist">
    <xs:attributeGroup ref="xhtml.Common.attrib"/>
    <xs:attribute name="type" type="xhtml.InputType.class" default="text"/>    
    <xs:attribute name="name" type="xh11d:CDATA"/>
    <xs:attribute name="value" type="xh11d:CDATA"/>
    <xs:attribute name="checked">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="checked"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="size" type="xh11d:Number"/>
    <xs:attribute name="maxlength" type="xh11d:Number"/>
    <xs:attribute name="src" type="xh11d:URI"/>
    <xs:attribute name="tabindex" type="xh11d:Number"/>    
    <xs:attribute name="accesskey" type="xh11d:Character"/>
  </xs:attributeGroup>
  
  <xs:group name="xhtml.input.content">
     <xs:sequence/>
  </xs:group>    

  <xs:complexType name="xhtml.input.type">
    <xs:group ref="xhtml.input.content"/>
    <xs:attributeGroup ref="xhtml.input.attlist"/>
  </xs:complexType>

  <xs:attributeGroup name="xhtml.select.attlist">
    <xs:attributeGroup ref="xhtml.Common.attrib"/>
    <xs:attribute name="name" type="xh11d:CDATA"/>
    <xs:attribute name="size" type="xh11d:Number"/>
    <xs:attribute name="multiple">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="multiple"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="tabindex" type="xh11d:Number"/>    
  </xs:attributeGroup>
  
  <xs:group name="xhtml.select.content">
    <xs:sequence>
       <xs:element name="option" type="xhtml.option.type" maxOccurs="unbounded"/>
    </xs:sequence>  
  </xs:group>       

  <xs:complexType name="xhtml.select.type">
    <xs:group ref="xhtml.select.content"/>
    <xs:attributeGroup ref="xhtml.select.attlist"/>
  </xs:complexType>

  <xs:attributeGroup name="xhtml.option.attlist">
    <xs:attributeGroup ref="xhtml.Common.attrib"/>
    <xs:attribute name="selected">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="selected"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>    
    <xs:attribute name="value" type="xh11d:CDATA"/>
    <xs:attribute name="tabindex" type="xh11d:Number"/>    
  </xs:attributeGroup>
  
  <xs:group name="xhtml.option.content">
     <xs:sequence/>
  </xs:group>  
  
  <xs:complexType name="xhtml.option.type" mixed="true">
    <xs:group ref="xhtml.option.content"/>
    <xs:attributeGroup ref="xhtml.option.attlist"/>
  </xs:complexType>

  <xs:attributeGroup name="xhtml.textarea.attlist">
    <xs:attributeGroup ref="xhtml.Common.attrib"/>
    <xs:attribute name="name" type="xh11d:CDATA"/>
    <xs:attribute name="rows" type="xh11d:Number" use="required"/>
    <xs:attribute name="cols" type="xh11d:Number" use="required"/>
    <xs:attribute name="accesskey" type="xh11d:Character"/>
  </xs:attributeGroup>
  
  <xs:group name="xhtml.textarea.content">
     <xs:sequence/>
  </xs:group>    

  <xs:complexType name="xhtml.textarea.type" mixed="true">
     <xs:group ref="xhtml.textarea.content"/>  
     <xs:attributeGroup ref="xhtml.textarea.attlist"/>
  </xs:complexType>

</xs:schema>
