<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="Training-to-slidy.xsl"?>
<training>
<training-material id="XForms"> 
  <title>XForms</title><presentation-info><conference-name></conference-name> 
  <date>September 21, 2010</date></presentation-info><authorinfo> <name>Betty
  Harvey</name><company>Electronic Commerce Connection, Inc.</company> 
  <e-mail>harvey@eccnet.com</e-mail></authorinfo> 
  <introduction id="Main-Intro"> 
	 <para>The W3C describes XForms as:</para> 
	 <quoted-block quoted-from="W3C XForms Specification">XForms is an XML
	 application that represents the next generation of forms for the Web. XForms is
	 not a free-standing document type, but is intended to be integrated into other
	 markup languages, such as XHTML, ODF or SVG. An XForms-based web form gathers
	 and processes XML data using an architecture that separates presentation,
	 purpose and content. The underlying data of a form is organized into instances
	 of data schema (though formal schema definitions are not required).
	 </quoted-block> 
  </introduction><section id="section1"> 
  <title>Brief Introduction to XForms</title>
			<introduction id="XFormIntro">
				<para>This section provides a brief introduction to the XForms technology.</para>
			</introduction> 
  <slide id="slide534609"> 
	 <title>Vocabulary</title> 
	 <para>There is some common vocabulary that will be used throughout this
		presentation. </para><deflist><termgrp><term>XML Instance</term><definition>The
	 XML Instance is an <i>instantiation</i> or a single document of a XML
	 vocabulary defined by a XML schema language. </definition></termgrp><termgrp> 
	 <term>XInclude</term><definition>A W3C specification for merging multiple XML
	 documents into a single instance by referencing the physical location of the
	 document.</definition></termgrp>
					<termgrp>
						<term>XHTML</term>
						<definition>XHTML (Extensible Hypertext Markup Language) is a family of XML
							markup languages that mirror or extend versions of the widely used
							Hypertext Markup Language (HTML), the language in which web pages are
							written.</definition>
					</termgrp></deflist> 
  </slide> 
  <slide> 
	 <title>XForms Specification</title> 
	 <list> 
		<item>XForms is a W3C Specification 
		  <list>
							<item>XForms 1.1 - dated October 20, 2009</item> 
			 <item>Version 3 - dated 29 October 2007</item> 
			 <item>Version 2 - dated14 March 2006</item> 
			 <item>Version 1 - dated 14 October 2003</item> 
		  </list></item> 
	 </list> 
  </slide> 
  <slide id="slide0729"> 
	 <title>Why XForms Generation</title> 
	 <para>There are many technologies for developing forms:</para> 
	 <list> 
		<item>HTML</item> 
		<item>PHP</item> 
		<item>AJAX</item> 
		<item>JSP</item> 
		<item><b>XForms</b></item> 
	 </list>
				<para>XForms and HTML are the only standard for developing forms.  XForms provides
					the ability to work directly with XML objects.  </para>
				<para>Input on HTML forms need to be sent to another language to be
					manipulated.</para> 
  </slide> 
  <slide> 
	 <title>Benefits of XForms</title> 
	 <list> 
		<item>Standard Vocabulary</item> 
		<item>Reusable modules (XInclude)</item> 
		<item>Native XML Results</item> 
		<item>Use of MVC (Model–view–controller) - separation of business
		  logic and user interface.</item> 
		<item>Used with other vocabularies, usually XHTML but could be custom
		  vocabulary.</item> 
	 </list> 
	 <para>The user should not be able to distinguish what technology is being
		used for a well-designed form.</para> 
	 <para>XForms has been described as "<i>Next generation of webforms</i>".
		Actually XForms is an XML vocabulary for defining forms and it is not limited
		to the web</para> 
	 <para>Most implementation of XForms are web-based client/server implementations.</para> 
  </slide> 
  <slide id="slide013855"> 
	 <title>XForms Implementations</title> 
	 <table border="1"> 
		<tbody> 
		  <tr> 
			 <td><b>Client Side</b></td> 
			 <td><b>Server Side</b></td> 
		  </tr> 
		  <tr> 
			 <td>Firefox XForms extension</td> 
			 <td>Orbeon Forms</td> 
		  </tr> 
		  <tr> 
			 <td>IBM Locus Forms</td> 
			 <td>Chiba</td> 
		  </tr> 
		  <tr> 
			 <td>Open Office 2.0</td> 
			 <td>IBM Lotus Forms</td> 
		  </tr> 
		  <tr> 
			 <td>X-Smiles</td> 
			 <td>XSLT Forms</td> 
		  </tr> 
		  <tr> 
			 <td>DENG</td> 
			 <td></td> 
		  </tr> 
		  <tr> 
			 <td>PicoForms</td> 
			 <td></td> 
		  </tr> 
		  <tr> 
			 <td>DataMovil</td> 
			 <td></td> 
		  </tr> 
		</tbody> 
	 </table> 
	 <instructors-notes> 
		<para>I have personal knowledge and have used Firefox Xforms and Orbeon.
		  I have 'played' with Chiba but haven't developed any applications using
		  it.</para> 
	 </instructors-notes> 
  </slide></section> <section id="section53252"> 
  <title>XForms Model</title>
			<introduction id="XFormsModel">
				<para>This section provides a brief understanding of the XFoprms Model.  The
					following topics will be discussed:</para>
				<list>
					<item>Model Controls</item>
					<item>XForms Instance</item>
					<item>Binding Data</item>
					<item>XForms Submission</item>
				</list>
			</introduction> 
  <slide id="slide87294948"> 
	 <title>Model Controls</title> 
	 <para>The XForms <i>model</i> component can contain 4 different types of
		components:</para> 
	 <list> 
		<item><b>xforms:instance</b>: The XML document for results.</item> 
		<item><b>xforms:bind</b>: A mechanism to set a value in the result tree
		  (XML instance).</item> 
		<item><b>xforms:variable</b>: A mechanism to set a variable to me used
		  within XForm calculations.</item> 
		<item><b>xforms:control</b>: Processing controls for the XForm, for
		  example &lt;xform:submission&gt;</item> 
	 </list><figure id="xforms-model"><caption>XForms Model</caption><graphic
	 name="graphics/model.jpg" width="173" height="338"
	 alt="XForms Model"/></figure> 
  </slide> 
  <slide id="slide1008"> 
	 <title>XForms Model</title> 
	 <para>The XForms Model provides form setup. </para> 
	 <example>
        &lt;xforms:model&gt;
            &lt;xforms:instance id="Contact-instance"&gt;
                &lt;Contact&gt;
                    &lt;PersonalName&gt;
                        &lt;FirstName/&gt;
                        . . .
                    &lt;/PersonalName&gt;
                    &lt;Address&gt;
                        &lt;Street/&gt;
                        . . .
                    &lt;/Address&gt;
                    &lt;Email/&gt;
                &lt;/Contact&gt;
            &lt;/xforms:instance&gt;
            &lt;xforms:submission id="save-submission"
                ref="instance('Contact-instance')" resource="http://localhost:8080/exist/rest/db/home/era/TransferRequests/{$TRID}.xml"
                method="put" replace="none"&gt;
                &lt;xforms:action ev:event="xforms-submit-done"&gt;
                    &lt;xforms:message level="modal"&gt;Submission complete&lt;/xforms:message&gt;
                &lt;/xforms:action&gt;
                &lt;xforms:action ev:event="xforms-submit-error"/&gt;
            &lt;/xforms:submission&gt;         
        &lt;/xforms:model&gt;
</example>

  </slide> 
  <slide id="slide5"> 
	 <title>XForms Instance</title> 
	 <para>XForms uses the &lt;xforms:instance&gt; element to create the XML
		model. There are 2 ways define the model.</para><example-grp> 
	 <header>W3C Schema</header> 
	 <example>
&lt;xforms:instance id="Contact-instance" schema="contact.xsd"&gt;

</example>

	 </example-grp><example-grp> 
	 <header>Embedded XML Document</header> 
	 <example>
&lt;xforms:instance id="Contact-instance"&gt;
                &lt;Contact&gt;
                   . . .
                &lt;/Contact&gt;
            &lt;/xforms:instance&gt;
</example>

	 </example-grp><example-grp> 
	 <header>Pointer to XML Document</header> 
	 <example>
&lt;xforms:instance id="Contact-instance" src="contact.xml"&gt;
</example>

	 </example-grp> 
	 <instructors-notes> 
		<para>When developing a form the form designer decides how they want to
		  create the XML XForms Instance. There can be multiple XML instance models in a
		  single form. Separate instances can be used to store state data about the
		  individuals form.</para> 
	 </instructors-notes> 
  </slide> 
  <slide> 
	 <title>XForms Bind</title> 
	 <para>XML components can be set using the &lt;xforms:bind&gt;
		element.</para><example-grp> 
	 <header>Set Datatype</header> 
	 <example>
&lt;xforms:bind nodeset="TodayDate" type="xsd:date" required="yes"&gt;
</example>

	 </example-grp><example-grp> 
	 <header>Perform Calculations</header> 
	 <example>
&lt;xforms:bind nodeset="instance('Contact-instance')/TodayDate" calculate="now()"/&gt;
</example>

	 </example-grp><example-grp> 
	 <header>Combination Calculations</header> 
	 <example>
&lt;xforms:bind nodeset="instance('Contact-instance')/TodayDate" calculate="now()"/&gt;
</example>

	 </example-grp> 
	 <para role="launch"><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/contact">Example of
		Calculation working.</xlink></para> 
  </slide> 
  <slide> 
	 <title>XForms Submission</title> 
	 <para>The &lt;xforms:submission&gt; element is a child element of the
		&lt;xforms:model&gt; element and tells the &lt;xforms:submit&gt; element what
		do to. </para><example-grp> 
	 <header>Example XForms Submission Element</header> 
	 <example> 
&lt;xforms:submission id="save-submission"
        ref="instance('Contact-instance')"
        resource="http://localhost:8080/exist/rest/db/myfile.xml"
        method="put" replace="none"&gt;
        &lt;xforms:action ev:event="xforms-submit-done"&gt;
             &lt;xforms:message level="modal"&gt;Submission complete&lt;/xforms:message&gt;
        &lt;/xforms:action&gt;
        &lt;xforms:action ev:event="xforms-submit-error"/&gt;          
 &lt;/xforms:submission&gt;</example>

	 </example-grp> 
  </slide></section> <section id="section192934"> 
  <title>XForms Controls</title> 
  <slide id="slide946"> 
	 <title>XForms Controls</title> 
	 <para>Very similar to HTML forms but with more functionality.</para> 
	 <table border="1"> 
		<tbody> 
		  <tr> 
			 <td valign="bottom"><b>XForms </b><br/><b>Control</b></td> 
			 <td valign="bottom"><b>Definition</b></td> 
			 <td valign="bottom">Example</td> 
		  </tr> 
		  <tr> 
			 <td>&lt;xforms:input&gt;</td> 
			 <td>Free form text. </td> 
			 <td><xlink
				href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#input">Link to
				Example</xlink></td> 
		  </tr> 
		  <tr> 
			 <td>&lt;xforms:secret&gt;</td> 
			 <td>Used to capture data while being hidden. Can be used to capture
				password information.</td> 
			 <td><xlink
				href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#secret">Link to
				Example</xlink></td> 
		  </tr> 
		  <tr> 
			 <td>&lt;xforms:textarea&gt;</td> 
			 <td>Free formed block of text in a multiline format.</td> 
			 <td><xlink
				href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#textarea">Link to
				Example</xlink></td> 
		  </tr> 
		  <tr> 
			 <td>&lt;xforms:output&gt;</td> 
			 <td>Display information to the user. </td> 
			 <td><xlink
				href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#output">Link to
				Example</xlink></td> 
		  </tr> 
		  <tr> 
			 <td>&lt;xforms:upload&gt;</td> 
			 <td>Provides the ability for a user to upload an external file.</td> 
			 <td><xlink
				href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#upload">Link to
				Example</xlink></td> 
		  </tr> 
		  <tr> 
			 <td>&lt;xforms:range&gt;</td> 
			 <td>Provides the ability for a person to upload a value from a range
				of values.</td> 
			 <td><xlink
				href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#range">Link to
				Example</xlink></td> 
		  </tr> 
		  <tr> 
			 <td>&lt;xforms:trigger&gt;</td> 
			 <td>Provides a user triggered action</td> 
			 <td><xlink
				href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#trigger">Link to
				Example</xlink></td> 
		  </tr> 
		  <tr> 
			 <td>&lt;xforms:select&gt;</td> 
			 <td>Provides the ability to allow the user to select multiple values
				from a list.</td> 
			 <td><xlink
				href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#select">Link to
				Example</xlink></td> 
		  </tr> 
		  <tr> 
			 <td>&lt;xforms:select1&gt;</td> 
			 <td>Provides the ability to allow the user to select a single value
				from a list.</td> 
			 <td><xlink
				href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#select1">Link to
				Example</xlink></td> 
		  </tr> 
		  <tr> 
			 <td>&lt;xforms:submit&gt;</td> 
			 <td>Provides the ability submit data to a processor. Works in
				conjunction with the &lt;xforms:submission&gt; element.</td> 
			 <td><xlink
				href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#submit">Link to
				Example</xlink></td> 
		  </tr> 
		</tbody> 
	 </table> 
  </slide> 
  <slide id="slide274"> 
	 <title>&lt;xforms:input&gt;</title> 
	 <para>The <i>input</i> control allows the users the ability to input a
		piece of information. This is usually short pieces of information that the user
		wants to capture.</para><example-grp> 
	 <header>Example &lt;forms:input&gt;</header> 
	 <example>
&lt;xforms:input ref="Example1"&gt;
       &lt;xforms:label&gt;First Name&lt;/xforms:label&gt;
&lt;/xforms:input&gt;
</example>

	 </example-grp> 
	 <para role="launch"><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#input">Link to
		Example</xlink></para> 
	 <list> 
		<header>Allowed Attribute Types</header> 
		<item>Common</item> 
		<item> UI Common</item> 
		<item>Single Node Binding</item> 
	 </list> 
  </slide> 
  <slide id="slide163411438"> 
	 <title>&lt;xforms:secret&gt;</title> 
	 <para>The <i>secret</i> control allows the user to imput data that is
		encrypted at the time it is captured. The <i>secret</i> control is most often
		used for a password.</para><example-grp> 
	 <header>Example &lt;xforms:secret&gt;</header> 
	 <example>
  &lt;xforms:secret ref="Example2"&gt;
            &lt;xforms:label&gt;Password&lt;/xforms:label&gt;
  &lt;/xforms:secret&gt;
</example>

	 </example-grp> 
	 <para role="launch"><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#secret">Link to
		Example</xlink></para> 
	 <list> 
		<header>Allowed Attribute Types</header> 
		<item>Common</item> 
		<item> UI Common</item> 
		<item>Single Node Binding</item> 
	 </list> 
  </slide> 
  <slide id="slide453870"> 
	 <title>&lt;xforms:textarea&gt;</title> 
	 <para>The <i>textarea</i> control provides the user the ability to input a
		block of text. The <i>textarea</i> control provides the ability to have
		multiline display.</para><example-grp> 
	 <header>Example &lt;xforms:textarea&gt;</header> 
	 <example>
&lt;xforms:textarea ref="Example3" width="20" height="3"&gt;
       &lt;xforms:label&gt;Text Area&lt;/xforms:label&gt;
&lt;/xforms:textarea&gt;
</example>

	 </example-grp> 
	 <para role="launch"><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#textarea">Link to
		Example</xlink></para> 
	 <list> 
		<header>Allowed Attribute Types</header> 
		<item>Common</item> 
		<item> UI Common</item> 
		<item>Single Node Binding</item> 
	 </list> 
  </slide> 
  <slide id="slide77065"> 
	 <title>&lt;xforms:output</title> 
	 <para>The <i>output</i> control allow the presentation of information from
		the datamodel to the user. The possibilities are a node in an XML instance, a
		variable, output from function, etc.</para><example-grp> 
	 <header>Example &lt;xforms:output&gt;</header> 
	 <example>

&lt;xforms:output value="now()"&gt;
       &lt;xforms:label&gt;Today's Date &amp;#160;&lt;/xforms:label&gt;
&lt;/xforms:output&gt;</example>

	 </example-grp> 
	 <para role="launch"><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#output">Link to
		Example</xlink></para> 
	 <list> 
		<header>Allowed Attribute Types</header> 
		<item>Common</item> 
		<item>Single Node Binding</item> 
	 </list> 
  </slide> 
  <slide id="slide03"> 
	 <title>&lt;xforms:upload&gt;</title> 
	 <para>The <i>upload</i> control allows the user to upload a local file to
		the process. </para><example-grp> 
	 <header>&lt;xforms:upload&gt;</header> 
	 <example>
&lt;xforms:upload ref="Example5"&gt;
     &lt;xforms:label&gt;Upload a file&lt;/xforms:label&gt;
&lt;/xforms:upload&gt;
</example>

	 </example-grp> 
	 <para role="launch"><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#upload">Link to
		Example</xlink></para> 
	 <list> 
		<header>Allowed Attribute Types</header> 
		<item>Common</item> 
		<item> UI Common</item> 
		<item>Single Node Binding</item> 
	 </list> 
  </slide> 
  <slide id="slide734"> 
	 <title>&lt;xforms:ranges&gt;</title> 
	 <para>The <i>ranges</i> control allow the user to select values from a
		range of values. Most XForms engines will put a UI control to select the
		value.</para><figure id="range-fig"><caption>Range UI Example</caption><graphic
	 name="graphics/range.jpg" width="231" height="48"
	 alt="Picture of range"/></figure><example-grp> 
	 <header>&lt;xforms:range&gt; (Select Number)</header> 
	 <example>
&lt;xforms:range ref="Example6" start="1" end="10" step="1"&gt;
      &lt;xforms:label&gt;Set Ranges&lt;/xforms:label&gt;
&lt;/xforms:range&gt;
</example>

	 </example-grp><example-grp> 
	 <header>&lt;xforms:range&gt; (Select Date)</header> 
	 <example>
&lt;range ref="Example6" start="2009-01-01" end="2009-12-31"&gt;
    &lt;label&gt;Ship Ranges&lt;/label&gt;
&lt;/range&gt;
</example>

	 </example-grp> 
	 <para role="launch"><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#range">Link to
		Example</xlink></para> 
	 <table border="1"> 
		<tbody> 
		  <tr> 
			 <td colspan="2"><b>Specific Range Attribues</b></td> 
		  </tr> 
		  <tr> 
			 <td><b>Attribute</b></td> 
			 <td><b>Description</b></td> 
		  </tr> 
		  <tr> 
			 <td>start</td> 
			 <td> Optional hint for the lexical starting bound for the range—a
				legal value for the underlying data. If provided, this value is used to further
				refine the constraints specified by the underlying model. </td> 
		  </tr> 
		  <tr> 
			 <td>end</td> 
			 <td> Optional hint for the ending bound for the range—a legal value
				for the underlying data. If provided, this value is used to further refine the
				constraints specified by the underlying model. </td> 
		  </tr> 
		  <tr> 
			 <td>step</td> 
			 <td> Optional value to use for incrementing or decrementing the
				value. Must be of a type capable of expressing the difference between two legal
				values of the underlying data. </td> 
		  </tr> 
		  <tr> 
			 <td>incremental </td> 
			 <td>When true, this form control will generate additional
				xforms-value-changed events. The default for this form control is false.</td> 
		  </tr> 
		</tbody> 
	 </table> 
	 <list> 
		<header>Allowed Attribute Types</header> 
		<item>Common</item> 
		<item> UI Common</item> 
		<item>Single Node Binding</item> 
	 </list> 
  </slide> 
  <slide id="slide0599157"> 
	 <title>&lt;xform:trigger&gt;</title> 
	 <para>The <i>trigger</i> element provides the ability to perform
		user-triggered actions. One of the common uses of the <i>trigger</i> control is
		to provide the ability to add multiple element types to the document, for
		example a row in an order form. </para> 
	 <para>The example below shows how to use a trigger to add a new
		element.</para><figure id="trigger-fig"><caption>Trigger Before and
	 After</caption><graphic name="graphics/trigger.jpg" width="279"
	 height="51" alt="Trigger Representation"/><graphic name="graphics/trigger2.jpg"
	 alt="Trigger Representation" width="287" height="93"/></figure> <example-grp> 
	 <header>Example &lt;xforms:trigger&gt; Code</header> 
	 <example>
 &lt;xforms:repeat nodeset="Example7" id="Example7-repeat"&gt;
       &lt;xforms:input ref="."&gt;
               &lt;xforms:label&gt;Repeating Element&lt;/xforms:label&gt;
       &lt;/xforms:input&gt;&lt;br/&gt;
 &lt;/xforms:repeat&gt;

 <b>&lt;xforms:trigger&gt;
      &lt;xforms:label&gt;Add a new Example7&lt;/xforms:label&gt;
      &lt;xforms:insert nodeset="Example7"
           at="index('Example7-repeat')"
           position="after" ev:event="DOMActivate" /&gt;
 &lt;/xforms:trigger&gt;</b>
</example>

	 </example-grp> 
	 <para role="launch"><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#trigger">Link to
		Example</xlink></para> 
	 <list> 
		<header>Allowed Attribute Types</header> 
		<item>Common</item> 
		<item> UI Common</item> 
		<item>Single Node Binding</item> 
	 </list> 
  </slide> 
  <slide id="slide335567891"> 
	 <title>&lt;xforms:select1&gt;</title> 
	 <para>The <i>select1</i> control allows the user to select a single item
		from a list of items.</para><figure id="select1-fig"><caption>Select1
	 Representation After Selection</caption><graphic name="graphics/select1.jpg"
	 width="306" height="291" alt="Presentation of the select1 control"/></figure> 
	 <example-grp> 
	 <header>Example &lt;xforms:select1&gt; Code</header> 
	 <example>
&lt;xforms:select1 ref="Example8" appearance="full"&gt;
    &lt;xforms:item&gt;
         &lt;xforms:label&gt;Yes&lt;/xforms:label&gt;
         &lt;xforms:value&gt;yes&lt;/xforms:value&gt;
    &lt;/xforms:item&gt;
    &lt;xforms:item&gt;
         &lt;xforms:label&gt;No&lt;/xforms:label&gt;
         &lt;xforms:value&gt;No&lt;/xforms:value&gt;
     &lt;/xforms:item&gt;
 &lt;/xforms:select1&gt;       </example>

	 </example-grp> 
	 <para role="launch"><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#select1">Link to
		Example</xlink></para> 
	 <list> 
		<header>Allowed Attribute Types</header> 
		<item>Common</item> 
		<item> UI Common</item> 
		<item>Single Node Binding</item> 
	 </list> 
  </slide> 
  <slide id="slide38982307"> 
	 <title>&lt;xforms:select&gt;</title> 
	 <para>The <i>select</i> control allows the user to select multiple items
		from a single list. </para><figure id="trigger-fig3"><caption>Select
	 Representation After Selection</caption><graphic
	 name="graphics/select.jpg" alt="Trigger Representation" width="306"
	 height="291"/></figure><example-grp> 
	 <header>Example &lt;xforms:select&gt; Code</header> 
	 <example>
&lt;xforms:select ref="Example8"&gt;
   &lt;xforms:item&gt;
        &lt;xforms:label&gt;Red Shoe&lt;/xforms:label&gt;
        &lt;xforms:value&gt;red&lt;/xforms:value&gt;
   &lt;/xforms:item&gt;
   &lt;xforms:item&gt;
        &lt;xforms:label&gt;Blue Shoe&lt;/xforms:label&gt;
        &lt;xforms:value&gt;blue&lt;/xforms:value&gt;
   &lt;/xforms:item&gt;
   &lt;xforms:item&gt;
        &lt;xforms:label&gt;Green Shoe&lt;/xforms:label&gt;
        &lt;xforms:value&gt;green&lt;/xforms:value&gt;
   &lt;/xforms:item&gt;
&lt;/xforms:select&gt;              </example>

	 </example-grp> 
	 <para role="launch"><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#select">Link to
		Example</xlink></para> 
	 <list> 
		<header>Allowed Attribute Types</header> 
		<item>Common</item> 
		<item> UI Common</item> 
		<item>Single Node Binding</item> 
	 </list> 
  </slide> 
  <slide id="slide006"> 
	 <title>&lt;xforms:submit&gt;</title> 
	 <para>The <i>submit</i> control provides the ability to submit the form. It
		is used in conjunction with the &lt;xforms:submission&gt; element which
		provides information about what to do when the submit button is
		selected.</para><figure id="submitfig"><caption>Submit Button</caption><graphic
	 name="graphics/submit.jpg" width="177" height="31"
	 alt="Submit Button"/></figure><example-grp> 
	 <header>&lt;xforms:submit&gt;</header> 
	 <example>
&lt;xforms:submit submission="save-submission"&gt;
        &lt;xforms:label&gt;Save Example Data&lt;/xforms:label&gt;
&lt;/xforms:submit&gt;</example>

	 </example-grp> 
	 <para role="launch"><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/controls#submit">Link to
		Example</xlink></para> 
	 <table border="1" width="50%"> 
		<tbody> 
		  <tr> 
			 <td colspan="2"><b>Specific Submit Attributes</b></td> 
		  </tr> 
		  <tr> 
			 <td><b>Attribute</b></td> 
			 <td><b>Description</b></td> 
		  </tr> 
		  <tr> 
			 <td>submission</td> 
			 <td> Required attribute. The value of the <i>submission</i> attribute
				should be the value of the <i>id</i> attribute on the
				<b>&lt;xforms:submission&gt;</b> element.</td> 
		  </tr> 
		</tbody> 
	 </table> 
	 <list> 
		<header>Allowed Attribute Types</header> 
		<item>Common</item> 
		<item> UI Common</item> 
		<item>Single Node Binding</item> 
	 </list> 
  </slide></section><section id="helpsection"> 
  <title>Hints and Help</title> 
  <introduction id="hh-elements"> 
	 <para>XForms enables the form developer to easily send helpand hint
		messages to a form using the <b>&lt;xforms:help&gt;</b> and
		<b>&lt;xforms:hint&gt;</b> elements. This section will provide an overview of
		the help and hints events in XForms.</para> 
  </introduction> 
  <slide id="slide44752"> 
	 <title>&lt;xforms:help </title> 
	 <list> 
		<item>Mechanism to provide further help to the user</item> 
		<item>Mix vocabularies for presentation purposes.</item> 
		<item>Can be used with and XForms control element</item> 
		<item>Most applications provide a help button</item> 
	 </list><figure id="helpfig"><caption>Input Field with Help
	 Function</caption><graphic name="graphics/help.jpg" width="338" height="154"
	 alt="Help Icon"/></figure><example-grp> 
	 <header>Example of &lt;xforms:help&gt; Element</header> 
	 <example>
  &lt;xforms:input ref="Example1"&gt;
        &lt;xforms:label&gt;Favorite Barnyard Animal&lt;/xforms:label&gt;
             <b>&lt;xforms:help&gt;
                   &lt;p&gt;In this field please type your favorite barnyard animal.&lt;/p&gt;
                   &lt;p&gt;&lt;b&gt;Examples:&lt;/b&gt;&lt;/p&gt;
                   &lt;ul&gt;
                        &lt;li&gt;chicken&lt;/li&gt;
                        &lt;li&gt;cow&lt;/li&gt;
                        &lt;li&gt;goat&lt;/li&gt;
                        &lt;li&gt;etc&lt;/li&gt;
                    &lt;/ul&gt;
              &lt;/xforms:help&gt;</b>
&lt;/xforms:input&gt;
</example>

	 </example-grp> 
	 <para><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/help#help">Link to
		Example</xlink></para> 
  </slide> 
  <slide id="slide25734889"> 
	 <title>&lt;xforms:hint&gt;</title> 
	 <list> 
		<item>Mechanism to provide further help to the user</item> 
		<item>Mix vocabularies for presentation purposes.</item> 
		<item>Can be used with and XForms control element</item> 
		<item>Most applications provide a mouse-over</item> 
	 </list> <figure id="hintref"><caption>Input Field with Hint
	 Mouseover</caption><graphic name="graphics/hint.jpg" width="513" height="131"
	 alt="Input Fiel with Hint Mouseover"/></figure><example-grp> 
	 <header>Example of &lt;xforms:hint&gt; Element</header> 
	 <example>
&lt;xforms:input ref="Example1"&gt;
    &lt;xforms:label&gt;Who was the first President of the US?&lt;/xforms:label&gt;
    &lt;xforms:hint&gt;
         &lt;p&gt;First name is &lt;i&gt;George&lt;/i&gt;&lt;/p&gt;
    &lt;/xforms:hint&gt;
&lt;/xforms:input&gt;
</example>

	 </example-grp> 
	 <para><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/help#hint">Link to
		Example</xlink></para> 
  </slide></section><section id="bind-variables"> 
  <title>Advanced Concepts</title> 
  <slide id="slide634900">
	 <title>Groupings</title>
	 <para>The element &lt;xforms:group&gt; is used for:</para>
	 <list>
		<item>Logical grouping of Xforms Components</item>
		<item>Set XML context</item>
		<item>Recursive model 
		  <list>
			 <item>&lt;xforms:group&gt; elements can contain other
				&lt;xforms:group&gt;</item>
		  </list></item>
		<item>Can be used to control logic with XPath statements</item>
	 </list><example-grp>
	 <header>&lt;xforms:input&gt; single node reference without
		&lt;xforms:group&gt;</header>
	 <example>
 &lt;xforms:input ref="instance('Example-instance')/Example1"&gt;
         &lt;xforms:label&gt;Example 1&lt;/xforms:label&gt;
&lt;/xforms:input&gt;
. . . 
 &lt;xforms:input ref="instance('Example-instance')/Example20"&gt;
         &lt;xforms:label&gt;Example 1&lt;/xforms:label&gt;
&lt;/xforms:input&gt;
</example>

	 </example-grp><example-grp>
	 <header>&lt;forms:group&gt; used for context</header>
	 <example>
 &lt;xforms:group ref="instance('Example-instance')"&gt;
&lt;xforms:input ref="Example1"&gt;
         &lt;xforms:label&gt;Example1&lt;/xforms:label&gt;
&lt;/xforms:input&gt;
. . .
&lt;xforms:input ref="Example20"&gt;
         &lt;xforms:label&gt;Example20&lt;/xforms:label&gt;
&lt;/xforms:input&gt;
&lt;/xforms:group&gt;</example>

	 </example-grp>
  </slide>
  <slide id="slide9250"> 
	 <title>XForms Variables</title> 
	 <list> 
		<item>XPath variables</item> 
		<item>Variables have context. 
		  <list> 
			 <item>XForms Model - global variables</item> 
			 <item>XForms Group - local variables</item> 
		  </list></item> 
	 </list> 
  </slide> 
  <slide id="slide33069"> 
	 <title>Setting XForms Variables</title> 
	 <para>XForms variables are set using the &lt;xforms:variable&gt; element.
		The example below shows setting a variable to be a random number using the
		<i>random</i> function.</para><example-grp> 
	 <header>Example &lt;xforms:variable&gt;</header> 
	 <example>
&lt;xforms:variable name="random" select="random()"/&gt;
</example>

	 </example-grp> 
  </slide> 
  <slide id="slide5717"> 
	 <title>Using a Variable</title> 
	 <para>Using a variable is the same as using a variable in XSLT or XQuery in
		an XPath statement.</para><example-grp> 
	 <header>Using a Variable</header> 
	 <example>
&lt;xforms:submission id="save-submission"
    ref="instance('Example-instance)" action="http://localhost:8080/exist/rest/db/home/MyFile-{$mydoc}-{$random}.xml"
    method="put" replace="none"&gt;

</example>

	 </example-grp> 
	 <para>The example above show a submission that uses 2 variables to set a
		filename during submission of the form.</para><example-grp> 
	 <header>Using a Variable in an Output Statement</header> 
	 <example>
&lt;xforms:output value="$RecordGroupNumber"/&gt;
</example>

	 </example-grp> 
  </slide> 
  <slide> 
	 <title>Binding Values</title> 
	 <para>The &lt;xforms:bind&gt; element is used to set values to a node in
		the XML document. The example below shows that the height of a container is set
		based on information in a container list instance.</para><example-grp> 
	 <header>Example Bind</header> 
	 <example>

&lt;xforms:bind nodeset="descendant::Height"  id="bindHeight"
    calculate="instance('Container-instance')/Row[ContainerDescription = $containerType]/Height"/&gt;
</example>

	 </example-grp> 
  </slide> 
  <slide id="slide1965968"> 
	 <title>Conditional Content</title> 
	 <para>Content can be conditionally shown to individuals based on XPath
		conditions.</para><example-grp> 
	 <header>Asking A Question:</header> 
	 <example>
&lt;p&gt;&lt;b&gt;Will you attend the event?&lt;/b&gt;
        &lt;xforms:select1 ref="Attend" appearance="full"&gt;
        &lt;xforms:item&gt;
          &lt;xforms:label&gt;Yes&lt;/xforms:label&gt;
          &lt;xforms:value&gt;yes&lt;/xforms:value&gt;
        &lt;/xforms:item&gt;
        &lt;xforms:item&gt;
             &lt;xforms:label&gt;No&lt;/xforms:label&gt;
             &lt;xforms:value&gt;no&lt;/xforms:value&gt;
        &lt;/xforms:item&gt;
      &lt;/xforms:select1&gt;&amp;#160;&amp;#160;                           
&lt;/p&gt;
</example>

	 </example-grp><figure id="question-fig"><caption>Presentation of
	 Question</caption><graphic name="graphics/question.jpg" width="281" height="23"
	 alt="Presentation of question"/></figure> 
  </slide> 
  <slide id="slide48987"> 
	 <title>Conditional Content (cont)</title> 
	 <para>Based on the answer different presentations are presented to the
		user:</para><figure id="no-fig"><caption>No Answer
	 Presentation</caption><graphic name="graphics/no.jpg" width="411" height="52"
	 alt="No Answer presentation"/></figure><example-grp> 
	 <header>No Content</header> 
	 <example>
 &lt;xforms:group ref="Attend[contains(., 'no')]"&gt;
     &lt;p&gt;Sorry you won't be able to attend.  Your presence will be missed!&lt;/p&gt;
&lt;/xforms:group&gt;
</example>

	 </example-grp><figure id="yes-fig"><caption>Yes
	 Presentation</caption><graphic name="graphics/yes.jpg" width="912" height="95"
	 alt="Yes Presentation"/></figure><example-grp> 
	 <header>Yes content</header> 
	 <example>
&lt;xforms:repeat id="repeat-Dish" nodeset="Dish"&gt;
   &lt;xforms:input ref="DishName"&gt;
         &lt;xforms:label&gt;Dish Name&lt;/xforms:label&gt;
   &lt;/xforms:input&gt;
   &lt;xforms:input ref="SpecialInstructions"&gt;
       &lt;xforms:label&gt;Any special needs for your dish? Explain.&lt;/xforms:label&gt;
   &lt;/xforms:input&gt;
                                &lt;br/&gt;
&lt;/xforms:repeat&gt;

</example>

	 </example-grp> 
	 <para>Triggers to insert and delete rows</para> 
	 <example>
&lt;xforms:trigger&gt;
      &lt;xforms:label&gt;Add another dish&lt;/xforms:label&gt;
      &lt;xforms:insert nodeset="Dish"
              at="index('repeat-Dish')"
              position="after" ev:event="DOMActivate" /&gt;
&lt;/xforms:trigger&gt;
&lt;xforms:trigger&gt;
      &lt;xforms:label&gt;Delete previous dish&lt;/xforms:label&gt;
      &lt;xforms:delete nodeset="Dish"
                at="index('repeat-Dish')"
                position="after" ev:event="DOMActivate" /&gt;
&lt;/xforms:trigger&gt;
</example>

  </slide>
  <slide id="slide426571071">
	 <title>Switch/Case</title>
	 <list>
		<item>Toggles between logical views of the form</item>
		<item>Can establish XPath context</item>
		<item>&lt;xforms:switch&gt; must be parent</item>
		<item>&lt;xforms:trigger element controls which view is presented to the
		  user</item>
		<item>&lt;xforms:case&gt; maintains single view.</item>
	 </list><example-grp>
	 <header>&lt;xforms:switch&gt; with 3 &lt;xforms:case&gt; Views</header>
	 <example>
 &lt;xforms:switch&gt;
        &lt;xforms:case id="case-1"&gt;
              &lt;h1&gt;View 1&lt;/h1&gt;
              &lt;xforms:input ref="Example1"&gt;
                     &lt;xforms:label&gt;Complete Example 1&lt;/xforms:label&gt;
               &lt;/xforms:input&gt;
         &lt;/xforms:case&gt;
         &lt;xforms:case id="case-2"&gt;
               &lt;h1&gt;&lt;font color="maroon"&gt;View 2&lt;/font&gt;&lt;/h1&gt;
               &lt;xforms:input  ref="Example2"&gt;
                    &lt;xforms:label&gt;Complete Example 2&lt;/xforms:label&gt;                  
               &lt;/xforms:input&gt;
          &lt;/xforms:case&gt;
          &lt;xforms:case id="case-3"&gt;
               &lt;h1 align="center"&gt;&lt;font color="blue"&gt;View 3&lt;/font&gt;&lt;/h1&gt;
               &lt;xforms:input  ref="Example3/Name"&gt;
                  &lt;xforms:label&gt;Name&lt;/xforms:label&gt;
                &lt;/xforms:input&gt;
                &lt;xforms:input  ref="Example3/OrganizationName"&gt;
                        &lt;xforms:label&gt;Organization Name&lt;/xforms:label&gt;
             &lt;/xforms:input&gt;
          &lt;/xforms:case&gt;
&lt;/xforms:switch&gt;
</example>

	 </example-grp>
	 <para><xlink
		href="http://www.eccnet.com:8080/Forms/SimpleForm/switch">Link to
		Example</xlink></para>
  </slide></section><section id="attribute-classes"> 
  <title>Attributes</title> 
  <introduction id="att-sect-intro"> 
	 <para>In this section we will cover the various attributes that can be used
		with Xform control element.</para> 
  </introduction> 
  <slide id="slide8"> 
	 <title>Common Class Attribute</title> 
	 <para>The common class of attributes are attributes that can be used in any
		XForms elements.</para> 
	 <table border="1"> 
		<tbody> 
		  <tr> 
			 <td>Attribute</td> 
			 <td>Definition</td> 
		  </tr> 
		  <tr> 
			 <td>id </td> 
			 <td>The optional id attribute of type xsd:ID assigns an identity to
				the containing element. </td> 
		  </tr> 
		  <tr> 
			 <td>anyAttribute </td> 
			 <td>Foreign attributes are allowed on all XForms elements. Foreign
				attributes are used in specific XForms engines to provide more functionality
				than is provided in the XForms standards.</td> 
		  </tr> 
		</tbody> 
	 </table><example-grp> 
	 <header><i>id</i> Attribute and Foreign Attribute</header> 
	 <example>
&lt;xforms:input id="input5" ref="AgencyName" xxforms:size="100"&gt;
</example>

	 </example-grp><note>The <i>xxforms</i> attribute is a custom attribute that
	 provides the ability to assign a size to an input field.</note> 
  </slide> 
  <slide id="slide214783">
	 <title>Read Only</title>
	 <para>The 'readonly' attribute can be used in the &lt;xforms:bind&gt;
		element to make fields 'read only'.</para>
	 <example>
&lt;xforms:bind nodeset="//Example3/OrganizationName" readonly="true()"/&gt;
</example>
	 <figure id="readonly-fig"><caption>Example Presentation of 'readonly'
	 Attribute</caption><graphic name="graphics/readonly.jpg" width="506"
	 height="64" alt="Presentation of 'readonly' attribute"/></figure>
  </slide>
  <slide id="slide947307"> 
	 <title>The End</title> 
	 <para align="center">QUESTIONS!</para> 
  </slide></section>
</training-material></training>

