<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Simplified Forms Module -->
<grammar ns="http://www.w3.org/1999/xhtml" xmlns="http://relaxng.org/ns/structure/1.0">

<define name="form">
  <element name="form">
    <ref name="form.attlist"/>
    <!-- Don't use Block.model, because this gets redefined by the
	 legacy module. -->
    <oneOrMore>
      <ref name="Block.class"/>
    </oneOrMore>
  </element>
</define>

<define name="form.attlist">
  <ref name="Common.attrib"/>
  <attribute name="action">
    <ref name="URI.datatype"/>
  </attribute>
  <optional>
    <attribute name="method">
      <choice>
	<value>get</value>
	<value>post</value>
      </choice>
    </attribute>
  </optional>
  <optional>
    <attribute name="enctype">
      <ref name="ContentType.datatype"/>
    </attribute>
  </optional>
</define>

<define name="label">
  <element name="label">
    <ref name="label.attlist"/>
    <ref name="Inline.model"/>
  </element>
</define>

<define name="label.attlist">
  <ref name="Common.attrib"/>
  <optional>
    <attribute name="for">
      <ref name="IDREF.datatype"/>
    </attribute>
  </optional>
  <optional>
    <attribute name="accesskey">
      <ref name="Character.datatype"/>
    </attribute>
  </optional>
</define>

<define name="input">
  <element name="input">
    <ref name="input.attlist"/>
  </element>
</define>

<define name="input.attlist">
  <ref name="Common.attrib"/>
  <optional>
    <attribute name="type">
      <ref name="InputType.class"/>
    </attribute>
  </optional>
  <optional>
    <attribute name="name"/>
  </optional>
  <optional>
    <attribute name="value"/>
  </optional>
  <optional>
    <attribute name="checked">
      <value>checked</value>
    </attribute>
  </optional>
  <optional>
    <attribute name="size"/>
  </optional>
  <optional>
    <attribute name="maxlength">
      <ref name="Number.datatype"/>
    </attribute>
  </optional>
  <optional>
    <attribute name="src">
       <ref name="URI.datatype"/>
    </attribute>
  </optional>
  <optional>
    <attribute name="accesskey">
      <ref name="Character.datatype"/>
    </attribute>
  </optional>
</define>

<define name="InputType.class">
  <choice>
    <value>text</value>
    <value>password</value>
    <value>checkbox</value>
    <value>radio</value>
    <value>submit</value>
    <value>reset</value>
    <value>hidden</value>
  </choice>
</define>

<define name="select">
  <element name="select">
    <ref name="select.attlist"/>
    <oneOrMore>
      <ref name="option"/>
    </oneOrMore>
  </element>
</define>

<define name="select.attlist">
  <ref name="Common.attrib"/>
  <optional>
    <attribute name="name"/>
  </optional>
  <optional>
    <attribute name="size">
      <ref name="Number.datatype"/>
    </attribute>
  </optional>
  <optional>
    <attribute name="multiple">
      <value>multiple</value>
    </attribute>
  </optional>
</define>
   
<define name="option">
  <element name="option">
    <ref name="Common.attrib"/>
    <optional>
      <attribute name="selected">
        <value>selected</value>
      </attribute>
    </optional>
    <optional>
      <attribute name="value"/>
    </optional>
    <text/>
  </element>
</define>

<define name="textarea">
  <element name="textarea">
    <ref name="textarea.attlist"/>
  </element>
</define>

<define name="textarea.attlist">
  <ref name="Common.attrib"/>
  <optional>
    <attribute name="name"/>
  </optional>
  <attribute name="rows">
    <ref name="Number.datatype"/>
  </attribute>
  <attribute name="cols">
    <ref name="Number.datatype"/>
  </attribute>
  <optional>
    <attribute name="accesskey">
      <ref name="Character.datatype"/>
    </attribute>
  </optional>
  <text/>
</define>

<define name="Form.class">
  <ref name="form"/>
</define>

<define name="Formctrl.class">
  <choice>
    <ref name="input"/>
    <ref name="label"/>
    <ref name="select"/>
    <ref name="textarea"/>
  </choice>
</define>

<define name="Block.class" combine="choice">
  <ref name="Form.class"/>
</define>

<define name="Inline.class" combine="choice">
  <ref name="Formctrl.class"/>
</define>

</grammar>