<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         xmlns:rng="http://relaxng.org/ns/structure/1.0"
         xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
         xmlns:doc="http://nwalsh.com/xmlns/documentation"
         xmlns:db="http://nwalsh.com/xmlns/docbook-grammar-structure"
         xmlns:html="http://www.w3.org/1999/xhtml"
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

<rng:div doc:docbook="yes" xmlns="">
<partinfo>
<releaseinfo
   role="cvs">$Id: forms.rng,v 1.3 2003/02/18 13:48:57 nwalsh Exp $</releaseinfo>
<title>Website HTML Forms Module</title>
<productname>Website</productname>
<productnumber>2.4.1</productnumber>
<releaseinfo role="filename">forms</releaseinfo>
<copyright>
<year>2002</year>
<year>2003</year>
<holder>Norman Walsh</holder>
</copyright>
</partinfo>

<partintro>
<para>This is the HTML Forms module for Website.</para>

<para>Please direct all questions and comments about this schema to
Norman Walsh, <email>ndw@nwalsh.com</email>.</para>
</partintro>
</rng:div>

<define name="local.para.char.mix" combine="choice">
  <choice>
    <ref name="html-input"/>
    <ref name="html-button"/>
    <ref name="html-label"/>
    <ref name="html-select"/>
    <ref name="html-textarea"/>
  </choice>
</define>

<define name="local.divcomponent.mix" combine="choice">
  <choice>
    <ref name="html-form"/>
  </choice>
</define>

<define name="events.attrib">
  <optional>
    <attribute name="onclick"/>
  </optional>
  <optional>
    <attribute name="ondblclick"/>
  </optional>
  <optional>
    <attribute name="onmousedown"/>
  </optional>
  <optional>
    <attribute name="onmouseup"/>
  </optional>
  <optional>
    <attribute name="onmouseover"/>
  </optional>
  <optional>
    <attribute name="onmousemove"/>
  </optional>
  <optional>
    <attribute name="onmouseout"/>
  </optional>
  <optional>
    <attribute name="onkeypress"/>
  </optional>
  <optional>
    <attribute name="onkeydown"/>
  </optional>
  <optional>
    <attribute name="onkeyup"/>
  </optional>
</define>

<define name="html-form">
  <element name="html:form">
    <oneOrMore>
      <choice>
        <ref name="component.mix"/>
        <ref name="html-input"/>
        <ref name="html-button"/>
        <ref name="html-label"/>
        <ref name="html-select"/>
        <ref name="html-textarea"/>
      </choice>
    </oneOrMore>
    <ref name="common.attrib"/>
    <ref name="events.attrib"/>
    <attribute name="action"/>
    <optional>
      <attribute name="method" a:defaultValue="GET">
        <choice>
          <value>GET</value>
          <value>POST</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="onsubmit"/>
    </optional>
    <optional>
      <attribute name="onreset"/>
    </optional>
  </element>
</define>

<define name="inputtype">
  <choice>
    <value>text</value>
    <value>password</value>
    <value>checkbox</value>
    <value>radio</value>
    <value>submit</value>
    <value>reset</value>
    <value>file</value>
    <value>hidden</value>
    <value>image</value>
    <value>button</value>
  </choice>
</define>

<define name="html-input">
  <element name="html:input">
    <ref name="common.attrib"/>
    <ref name="events.attrib"/>
    <optional>
      <attribute name="type" a:defaultValue="text">
        <ref name="inputtype"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="name"/>
    </optional>
    <optional>
      <attribute name="value"/>
    </optional>
    <optional>
      <attribute name="checked">
        <choice>
          <value>checked</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="disabled">
        <choice>
          <value>disabled</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="readonly">
        <choice>
          <value>readonly</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="size"/>
    </optional>
    <optional>
      <attribute name="maxlength"/>
    </optional>
    <optional>
      <attribute name="src"/>
    </optional>
    <optional>
      <attribute name="alt"/>
    </optional>
    <optional>
      <attribute name="usemap"/>
    </optional>
    <optional>
      <attribute name="tabindex"/>
    </optional>
    <optional>
      <attribute name="accesskey"/>
    </optional>
    <optional>
      <attribute name="onfocus"/>
    </optional>
    <optional>
      <attribute name="onblur"/>
    </optional>
    <optional>
      <attribute name="onselect"/>
    </optional>
    <optional>
      <attribute name="onchange"/>
    </optional>
    <empty/>
  </element>
</define>

<define name="html-button">
  <element name="html:button">
    <ref name="common.attrib"/>
    <ref name="events.attrib"/>
    <optional>
      <attribute name="type" a:defaultValue="submit">
        <choice>
          <value>button</value>
          <value>submit</value>
          <value>reset</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="name"/>
    </optional>
    <optional>
      <attribute name="value"/>
    </optional>
    <optional>
      <attribute name="disabled">
        <choice>
          <value>disabled</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="tabindex"/>
    </optional>
    <optional>
      <attribute name="accesskey"/>
    </optional>
    <optional>
      <attribute name="onfocus"/>
    </optional>
    <optional>
      <attribute name="onblur"/>
    </optional>
    <zeroOrMore>
      <ref name="para.char.mix"/>
    </zeroOrMore>
  </element>
</define>

<define name="html-label">
  <element name="html:label">
    <ref name="common.attrib"/>
    <ref name="events.attrib"/>
    <optional>
      <attribute name="for">
        <data type="IDREF"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="accesskey"/>
    </optional>
    <optional>
      <attribute name="onfocus"/>
    </optional>
    <optional>
      <attribute name="onblur"/>
    </optional>
    <ref name="para.char.mix"/>
  </element>
</define>

<define name="html-select">
  <element name="html:select">
    <ref name="common.attrib"/>
    <ref name="events.attrib"/>
    <optional>
      <attribute name="name"/>
    </optional>
    <optional>
      <attribute name="size"/>
    </optional>
    <optional>
      <attribute name="multiple">
        <choice>
          <value>multiple</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="disabled">
        <choice>
          <value>disabled</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="tabindex"/>
    </optional>
    <optional>
      <attribute name="onfocus"/>
    </optional>
    <optional>
      <attribute name="onblur"/>
    </optional>
    <optional>
      <attribute name="onchange"/>
    </optional>
    <oneOrMore>
      <ref name="html-option"/>
    </oneOrMore>
  </element>
</define>

<define name="html-option">
  <element name="html:option">
    <ref name="common.attrib"/>
    <ref name="events.attrib"/>
    <optional>
      <attribute name="selected">
        <choice>
          <value>selected</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="disabled">
        <choice>
          <value>disabled</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="value"/>
    </optional>
    <text/>
  </element>
</define>

<define name="html-textarea">
  <element name="html:textarea">
    <ref name="common.attrib"/>
    <ref name="events.attrib"/>
    <optional>
      <attribute name="name"/>
    </optional>
    <attribute name="rows"/>
    <attribute name="cols"/>
    <optional>
      <attribute name="disabled">
        <choice>
          <value>disabled</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="readonly">
        <choice>
          <value>readonly</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="tabindex"/>
    </optional>
    <optional>
      <attribute name="accesskey"/>
    </optional>
    <optional>
      <attribute name="onfocus"/>
    </optional>
    <optional>
      <attribute name="onblur"/>
    </optional>
    <optional>
      <attribute name="onselect"/>
    </optional>
    <optional>
      <attribute name="onchange"/>
    </optional>
    <text/>
  </element>
</define>

</grammar>
