Appendix C: Sample Forms


C.1 XForms and XHTML

XHTML Document with Multiple XForms - Page.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xml:lang="en" lang="en" 

  <title>Sample XForms Document</title>

  <xform xmlns="" id="poll">
    <submitInfo target="" />
        <number name="choiceCode" enum="closed">

  <xform xmlns="" id="search">
    <submitInfo target="" />
    <bind id="Query" ref="/query/searchstring"/>
      <schema xmlns="">
        <element name="query">
            <attribute name="searchstring" type="string" />
    <instance model="search" xmlns="">
      <query searchstring="Enter your Query Here" />

  <!-- ... -->

  <!-- Site Search Markup -->
  <xform:textbox ref="id('Query')">
    <xform:caption>Search our Web Site<xform:caption>
    <xform:help>Enter your search term here and hit "Go!"</xform:help>
  <xform:submit xform="search">

  <!-- ... -->

  <!-- Daily Poll Markup -->
  <xform:exclusiveSelect style="list-ui: radio" xform="poll"
    <xform:caption>When do you plan to implement XForms?</xform:caption>
    <xform:item value="-1">Don't know</xform:item>
    <xform:item value="10">0-6 Months</xform:item>
    <xform:item value="20">6-12 Months</xform:item>
    <xform:item value="30">More than 12 Months</xform:item>
  <xform:submit xform="poll">

  <!-- ... -->

This is an example of a single document that might be hand authored. This example shows an XHTML document with two separate XForms embedded using simple syntax, one with a set of initial instance data.
Sample Instance Data for Poll

Here is a sample of the instance data for the Poll form.

Sample Instance Data for Site Search
<query xmlns="" searchstring="MP3" />

Here is a sample of the instance data for Site Search form.