<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/1999/xhtml">

  <xs:annotation>
    <xs:documentation>
      This is the XML Schema Basic Forms module for XHTML
      $Id: xhtml-basic-form-1.xsd 28982 2006-05-04 09:40:07 +0000 (Thu, 04 May 2006) radu_coravu $
    </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="form.attlist">
    <xs:attributeGroup ref="Common.attrib"/>
    <xs:attribute name="action" type="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="ContentType" default="application/x-www-form-urlencoded"/>
  </xs:attributeGroup>
  
  <xs:group name="form.content">
    <xs:sequence>
      <xs:group ref="BlkNoForm.mix" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:group>

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

  <xs:element name="form" type="form.type"><xs:annotation><xs:documentation>The FORM element creates a form. A form can contain textfields, checkboxes, radio-buttons etc. Forms are used to pass user-data to a specified URL, usually a CGI.</xs:documentation></xs:annotation></xs:element>

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

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

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

  <xs:element name="label" type="label.type"><xs:annotation><xs:documentation>The LABEL element may be used to attach information to controls. Each LABEL element is associated with exactly one form control. The "for" attribute binds a label to another element. Set the value of the "for" attribute equal to the value of the "id" attribute of the related element.</xs:documentation></xs:annotation></xs:element>

<!-- 
Basic Forms removes button, 'image' and 'file' input types.
-->
  <xs:simpleType name="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="input.attlist">
    <xs:attributeGroup ref="Common.attrib"/>
    <xs:attribute name="type" type="InputType.class" default="text"/>    
    <xs:attribute name="name" type="CDATA"/>
    <xs:attribute name="value" type="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="Number"/>
    <xs:attribute name="maxlength" type="Number"/>
    <xs:attribute name="src" type="URI"/>
    <xs:attribute name="tabindex" type="Number"/>    
    <xs:attribute name="accesskey" type="Character"/>
  </xs:attributeGroup>
  
  <xs:group name="input.content">
     <xs:sequence/>
  </xs:group>    

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

  <xs:element name="input" type="input.type"><xs:annotation><xs:documentation>The INPUT element defines the start of an input field where the user can enter data. The INPUT element is empty, it contains attributes only.</xs:documentation></xs:annotation></xs:element>

  <xs:attributeGroup name="select.attlist">
    <xs:attributeGroup ref="Common.attrib"/>
    <xs:attribute name="name" type="CDATA"/>
    <xs:attribute name="size" type="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="Number"/>    
  </xs:attributeGroup>
  
  <xs:group name="select.content">
    <xs:sequence>
       <xs:element ref="option" maxOccurs="unbounded"/>
    </xs:sequence>  
  </xs:group>       

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

  <xs:element name="select" type="select.type"><xs:annotation><xs:documentation>The select element creates a drop-down list. Use this element in the FORM element to accept user input.</xs:documentation></xs:annotation></xs:element>

  <xs:attributeGroup name="option.attlist">
    <xs:attributeGroup ref="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="CDATA"/>
    <xs:attribute name="tabindex" type="Number"/>    
  </xs:attributeGroup>
  
  <xs:group name="option.content">
     <xs:sequence/>
  </xs:group>  
  
  <xs:complexType name="option.type" mixed="true">
    <xs:group ref="option.content"/>
    <xs:attributeGroup ref="option.attlist"/>
  </xs:complexType>

  <xs:element name="option" type="option.type"><xs:annotation><xs:documentation>The option element defines an option in the drop-down list. Use this element in conjunction with the SELECT element, elsewhere it is meaningless.</xs:documentation></xs:annotation></xs:element>

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

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

  <xs:element name="textarea" type="textarea.type"><xs:annotation><xs:documentation>The TEXTAREA element creates a multi-line text input control. User agents should use the contents of this element as the initial value of the control and should render this text initially.</xs:documentation></xs:annotation></xs:element>

</xs:schema>