<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns="http://xml.fiforms.org/FiForms/" 
    xmlns:app="http://xml.fiforms.org/FiFormsApplication/"
    xmlns:html="http://www.w3.org/1999/xhtml" 
    targetNamespace="http://xml.fiforms.org/FiForms/" 
    version="1.1" xml:lang="en">
<xs:annotation>
<xs:documentation source="http://xml.fiforms.org/FiForms/">
This is the XML Schema for XML FiForm definitions. Please use this namespace for fiform elements: http://xml.fiforms.org/FiForms/
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation>
This Schema is distributed with FiForms, a collection of PHP 
classes designed to facilitate rapid development of 
web-database software
</xs:documentation>
<xs:documentation>
Copyright (C) 2003-2007 Daniel McFeeters
</xs:documentation>
<xs:documentation>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
</xs:documentation>
<xs:documentation>
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
</xs:documentation>
<xs:documentation source="http://www.gnu.org/copyleft/lesser.html">
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
</xs:documentation>
<xs:documentation>
The original author of this library can be contacted at the following 
address:
</xs:documentation>
<xs:documentation>
Daniel McFeeters
</xs:documentation>
<xs:documentation>
182 Baker Rd.
</xs:documentation>
<xs:documentation>
Faubush, KY 42544-6526
</xs:documentation>
<xs:documentation>
email:databases at alltel dot net
</xs:documentation>
</xs:annotation>
<xs:annotation>
<xs:documentation source="http://www.fiforms.org">
You can find out more about FiForms Solutions and download the open-source (LGPL) collection of FiForms PHP Classes from www.fiforms.org
</xs:documentation>
</xs:annotation>

<xs:import namespace="http://xml.fiforms.org/FiFormsApplication/" schemaLocation="FiFormsApplication.xsd">
<xs:annotation>
<xs:documentation>
Included so that metadata described in the FiForms Application schema can be included in FiForms.
</xs:documentation>

<xs:documentation source="http://xml.fiforms.org/schema/11/FiFormsApplication.xsd">
</xs:documentation>
</xs:annotation>
</xs:import>

<xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="xhtml/xhtml-basic10.xsd">
<xs:annotation>
<xs:documentation>
This imports the XHTML namespace, so that XHTML elements
can be embedded in FiForms.
</xs:documentation>
<xs:documentation source="http://www.w3.org/MarkUp/SCHEMA/xhtml-basic10.xsd">
</xs:documentation>
</xs:annotation>
</xs:import>

<xs:element name="reportdef">
<xs:annotation>
<xs:documentation>
This is the root element of a FiForm Report definition. Attributes of this element affect the behaviour of the report and define permissions.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" ref="title">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="summary">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="security">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="confidentiality">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="1" ref="connect">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="generator">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="param">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="stylesheet">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="1" ref="query">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="stylesheet">
<xs:complexType>
<xs:attribute name="href" type="xs:anyURI" use="required">
<xs:annotation>
<xs:documentation>
File name of an XSLT stylesheet that should be used to transform the resulting XML. 
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="caption" use="optional">
<xs:annotation>
<xs:documentation>
Description of stylesheet displayed in selection box.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute fixed="default" name="default" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Mark this as the default selected stylesheet.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name="security">
<xs:annotation>
<xs:documentation>
Security descriptor. Only the mentioned user or group will be allowed to view the report.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="user" type="xs:string" use="optional">
</xs:attribute>
<xs:attribute name="group" type="xs:string" use="optional">
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="confidentiality">
<xs:complexType>
<xs:attribute name="level" type="low_medium_high" use="required">
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:simpleType name="low_medium_high">
<xs:restriction base="xs:string">
<xs:enumeration value="low"/>
<xs:enumeration value="medium"/>
<xs:enumeration value="high"/>
</xs:restriction>
</xs:simpleType>

<xs:element name="generator">
<xs:complexType>
<xs:attribute name="href" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
URI of server where FiForm generate.php script resides. Used only for user-defined reports where the report definition is submitted to the server from the parameter page. (This configuration is not recommended for production servers where security is a concern.)
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="fiform">
<xs:annotation>
<xs:documentation>
This is the root element of a FiForm definition. Attributes of this element affect the behaviour and appearance of the form and define permissions.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="title">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="summary">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="security">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="connect">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="param">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="query">
</xs:element>
<xs:sequence maxOccurs="unbounded" minOccurs="0">
<xs:group ref="controls">
</xs:group>
</xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" ref="wrapper">
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="windowattributes">
</xs:attributeGroup>
<xs:attribute default="bottom" name="ctlPosition" type="navlink_positions">
<xs:annotation>
<xs:documentation>
Specifies where the navigation links appear on the form in form view
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="right" name="svctlPosition" type="svlink_positions">
<xs:annotation>
<xs:documentation>
Specifies where the navigation links appear on the form in sheet view
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="both" name="viewsAllowed" type="allowed_view">
<xs:annotation>
<xs:documentation>
Specifies which view modes are allowed for this form. A value of "none" disables the form.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="sheet" name="defaultView" type="default_vew" use="optional">
<xs:annotation>
<xs:documentation>
Suggests the preferred view mode for the form when it is opened from a menu.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="yes" name="allowView" type="yes_no" use="optional">
<xs:annotation>
<xs:documentation>
If this is "no", viewing existing data in any mode is not allowed.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="yes" name="allowInsert" type="yes_no" use="optional">
<xs:annotation>
<xs:documentation>
If this is "no", inserting new records is not allowed.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="yes" name="allowUpdate" type="yes_no" use="optional">
<xs:annotation>
<xs:documentation>
If this is "no", updating records is not allowed.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="new" name="insert" type="insert_type">
<xs:annotation>
<xs:documentation>
Action after a record is inserted. "new" moves to a new record. "current" saves the record and returns to editing the same record. "sheet" returns to sheet mode after insert. If this is "none", inserting records is not allowed.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute default="all" name="whichControls" type="availablecontrols">
<xs:annotation>
<xs:documentation>
Specifies which navigation links are shown.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="20" name="recordLimit" type="xs:integer">
<xs:annotation>
<xs:documentation>
The maximum number of records per page in sheet view.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:simpleType name="insert_type">
<xs:restriction base="xs:string">
<xs:enumeration value="new"/>
<xs:enumeration value="current"/>
<xs:enumeration value="sheet"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>


<xs:simpleType name="transform_type">
<xs:restriction base="xs:string">
<xs:enumeration value="uppercase"/>
<xs:enumeration value="lowercase"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>

<xs:element name="title" type="xs:string">
<xs:annotation>
<xs:documentation>
The title above the form.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="summary" type="xs:string">
<xs:annotation>
<xs:documentation>
A description of the form, often displayed in verbose menu screens.
</xs:documentation>
</xs:annotation>
</xs:element>

<xs:simpleType name="availablecontrols">
<xs:annotation>
<xs:documentation>
Possible combinations of controls allowed in whichControls attribute of fiform element
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="all"/>
<xs:enumeration value="nav"/>
<xs:enumeration value="delete"/>
<xs:enumeration value="new"/>
<xs:enumeration value="nav,new"/>
<xs:enumeration value="new,delete"/>
<xs:enumeration value="nav,delete"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>

<xs:element name="code" type="xs:string">
<xs:annotation>
<xs:documentation>
PHP code executed when the form is viewed. The code does not need to be enclosed in XML processing instructions (i.e. ?php tags)
</xs:documentation>
</xs:annotation>
</xs:element>

<xs:complexType mixed="true" name="auto_load">
<xs:attribute default="auto" type="autoorno" name="auto">

</xs:attribute>
</xs:complexType>

<xs:simpleType name="autoorno">
<xs:restriction base="xs:string">
<xs:enumeration value="auto"/>
<xs:enumeration value="noauto"/>
<xs:enumeration value="onlynew"/>
</xs:restriction>
</xs:simpleType>

<xs:element name="loaddata" type="auto_load">
<xs:annotation>
<xs:documentation>
File name of XML query (report) definition to load row data from
</xs:documentation>
</xs:annotation>
</xs:element>

<xs:element name="expression" type="auto_load">
<xs:annotation>
<xs:documentation>
Javascript expression which evaluates to calculate a single value on a form, instead of loading an 
external datasource.
</xs:documentation>
</xs:annotation>
</xs:element>

<xs:element name="depends" type="xs:string">
<xs:annotation>
<xs:documentation>
The field names of controls on form that trigger this control to refresh from the loaddata query.
</xs:documentation>
</xs:annotation>
</xs:element>

<xs:element name="iText">
<xs:annotation>
<xs:documentation>
iText (data-bound text box) FiForm object.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>

<xs:element maxOccurs="1" minOccurs="0" ref="loaddata">
<xs:annotation>
<xs:documentation>
Name of XML report definition to use to load data.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="expression">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="depends">
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="inputfields">
</xs:attributeGroup>
<xs:attribute name="size" type="xs:integer">
<xs:annotation>
<xs:documentation>
Size of the input box (characters)
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="formatexpr" type="xs:string">
<xs:annotation>
<xs:documentation>
Regular Expression defining a custom format restriction.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="transform" type="transform_type">
<xs:annotation>
<xs:documentation>
Transform text to uppercase or lowercase.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name="iNumber">
<xs:annotation>
<xs:documentation>
iNumber FiForm object for input of numerical data
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" ref="loaddata">
<xs:annotation>
<xs:documentation>
Name of XML report definition to use to load data.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="expression">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="depends">
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="inputfields">
</xs:attributeGroup>

<xs:attribute name="size" type="xs:integer">
<xs:annotation>
<xs:documentation>
Size of the input box (characters)
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="decimals" type="xs:integer">
<xs:annotation>
<xs:documentation>
Number of decimal places for fixed-decimal values.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="digits" type="xs:integer">
<xs:annotation>
<xs:documentation>
The total number of digits allowed in the field (including decimals)
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="prefix" type="xs:string">
<xs:annotation>
<xs:documentation>
Character prefix appearing before the numeric field (i.e. $)
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="suffix" type="xs:string">
<xs:annotation>
<xs:documentation>

</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="thseperator" type="xs:string">
<xs:annotation>
<xs:documentation>
Thousands seperator. Default is comma (,)
</xs:documentation>
</xs:annotation>
</xs:attribute>


<xs:attribute name="decpoint" type="xs:string">
<xs:annotation>
<xs:documentation>
Decimal Point character. Default is period (.)
</xs:documentation>
</xs:annotation>
</xs:attribute>


</xs:complexType>
</xs:element>


<xs:element name="iUUID">
<xs:annotation>
<xs:documentation>
iUUID data bound globally unique ID FiForm object.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="inputfields">
</xs:attributeGroup>
</xs:complexType>
</xs:element>

<xs:element name="iHidden">
<xs:annotation>
<xs:documentation>
iHidden (hidden data-bound text box) FiForm object.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="inputfields">
</xs:attributeGroup>
</xs:complexType>
</xs:element>

<xs:element name="iTextArea">
<xs:annotation>
<xs:documentation>
iTextArea (data-bound text area) FiForm object. Equivalant to iText, but uses textarea instead of input
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="inputfields">
</xs:attributeGroup>
<xs:attribute name="rows" type="xs:integer">
<xs:annotation>
<xs:documentation>
Number of rows (height) of text area
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="cols" type="xs:integer">
<xs:annotation>
<xs:documentation>
Number of columns (width) of text area
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name="iROText">
<xs:annotation>
<xs:documentation>
iROText (read-only database field) FiForm object. 
</xs:documentation>
<xs:documentation>
Note that this does not actually create a form object that will be submitted, it simply prints the value of the field in text on the HTML page. This should be combined with iHidden if you want the value submitted on the form, or use iText disabled="disabled" to display the field in a disabled text box.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="inputfields">
</xs:attributeGroup>
</xs:complexType>
</xs:element>

<xs:element name="iCheck">
<xs:annotation>
<xs:documentation>
iCheck (data-bound check box) FiForm object.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="inputfields">
</xs:attributeGroup>
</xs:complexType>
</xs:element>

<xs:element name="iFile">
<xs:annotation>
<xs:documentation>
iFile FiForm object, to enable upload of pictures and files stored in a database BLOB field.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="inputfields">
</xs:attributeGroup>
<xs:attribute name="viewmode" type="ifileviewmodes">
<xs:annotation>
<xs:documentation>
The way in which the data is displayed.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name="iDBSelect">
<xs:annotation>
<xs:documentation>
iDBSelect (data bound selection, drop-down box, or radio button group) FiForm object.
</xs:documentation>
<xs:documentation>
Options can be queried from the database by specifing a query in the rowQuery attribute or they can be specified here manually with option elements inside the iDBSelect element.
</xs:documentation>
</xs:annotation>
<xs:complexType>

<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" ref="loaddata">
<xs:annotation>
<xs:documentation>
Name of XML report definition to use to load data.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="depends">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="option">
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="inputfields">
</xs:attributeGroup>
<xs:attribute name="rowQuery">
<xs:annotation>
<xs:documentation>
SQL query for row options. This query should return either 1 or 2 columns. If 1 column is returned, the values are used for the values and text in the select box. If 2 columns are returned, the first is used as the values stored in the field and the second is used as the display text.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ftable">
<xs:annotation>
<xs:documentation>
Foreign table linked to by this field
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="fkey">
<xs:annotation>
<xs:documentation>
Foreign Key field name in foreign table (ftable)
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="fvalue">
<xs:annotation>
<xs:documentation>
Field name or SQL expression to obtain display value from. If (fkey) is specified but not fvalue, then fvalue defaults to fkey.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="linkedform">
<xs:annotation>
<xs:documentation>
Name of XML form to edit records in linked table (ftable)
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="style" type="styletype">
<xs:annotation>
<xs:documentation>
Presentation of select box (select, radio, or dynamic)
</xs:documentation>
</xs:annotation>
</xs:attribute>

</xs:complexType>
</xs:element>

<xs:element name="option" type="optionType">
<xs:annotation>
<xs:documentation>
Option listing under iDBSelect. Although similar in syntax and function, this is not to be confused with the option element in the XHTML namespace.
</xs:documentation>
</xs:annotation>
</xs:element>

<xs:complexType name="optionType">
<xs:annotation>
<xs:documentation>
Type definition for option under iDBSelect.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="value" use="optional">
<xs:annotation>
<xs:documentation>
"Key" value. If not specified, the value of the option is used.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element name="iDateText">
<xs:annotation>
<xs:documentation>
iDateText (data-bound date input box) FiForm object.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="inputfields">
</xs:attributeGroup>
</xs:complexType>
</xs:element>

<xs:element name="iLink">
<xs:annotation>
<xs:documentation>
Link to a page (iLink FiForm object)
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="href" type="xs:anyURI" use="optional">
<xs:annotation>
<xs:documentation>
URI of page
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="linktext" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Text of the link (contents of anchor element in HTML)
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="caption" type="xs:string">
<xs:annotation>
<xs:documentation>
Column heading or text beside the link.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="link" name="type" type="link_button" use="optional">
</xs:attribute>
<xs:attributeGroup ref="windowattributes">
</xs:attributeGroup>
</xs:complexType>
</xs:element>

<xs:simpleType name="ifileviewmodes">
<xs:annotation>
<xs:documentation>
Possible viewmode values for ifile
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="image"/>
<xs:enumeration value="download"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="link_button">
<xs:annotation>
<xs:documentation>
Possible types for iLink
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="link"/>
<xs:enumeration value="button"/>
</xs:restriction>
</xs:simpleType>

<xs:element name="if" type="ifType">
<xs:annotation>
<xs:documentation>
Construct for conditional definitions. Elements inside this element will be present only if the condition is true. 
</xs:documentation>
<xs:documentation>
Note: This schema technically allows elements under "if" that belong in the "connection", "fiforms", or "wrapper" elements. Although this may be technically allowed by the schema, no element is allowed under "if" that would not be allowed if it were outside the "if" element.
</xs:documentation>
</xs:annotation>
</xs:element>

<xs:complexType name="ifType">
<xs:choice>
<xs:group maxOccurs="unbounded" ref="controls">
</xs:group>
<xs:element maxOccurs="1" minOccurs="1" ref="connect">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="1" ref="query">
</xs:element>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" ref="headerTags">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="pageHeader">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="pageFooter">
</xs:element>
</xs:sequence>
</xs:choice>
<xs:attribute name="param" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
Name of any GET variable passed to the form. (i.e. sheetView)
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="exists" name="test" type="testvalues" use="optional">
<xs:annotation>
<xs:documentation>
Any one of the comparison operators allowed in testValues
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="value" type="xs:string">
<xs:annotation>
<xs:documentation>
The value to compare "param" to, if necessary (depending of test)
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>

<xs:simpleType name="testvalues">
<xs:annotation>
<xs:documentation>
Possible comparison operators for "if"
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="exists"/>
<xs:enumeration value="equals"/>
<xs:enumeration value="does not exist"/>
<xs:enumeration value="does not equal"/>
<xs:enumeration value="is greater than"/>
<xs:enumeration value="is less than"/>
<xs:enumeration value="is greater than or equal to"/>
<xs:enumeration value="is less than or equal to"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="subviewtype">
<xs:annotation>
<xs:documentation>
Possible views for a subform.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="normal"/>
<xs:enumeration value="sheet"/>
<xs:enumeration value="new"/>
</xs:restriction>
</xs:simpleType><xs:group name="controls">
<xs:annotation>
<xs:documentation>
Group of controls and elements that can be found under "fiform" or "if" elements
</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element ref="code"/>
<xs:element ref="iText"/>
<xs:element ref="iROText"/>
<xs:element ref="iHidden"/>
<xs:element ref="iTextArea"/>
<xs:element ref="iDateText"/>
<xs:element ref="iCheck"/>
<xs:element ref="iDBSelect"/>
<xs:element ref="iLink"/>
<xs:element ref="iSubform"/>
<xs:element ref="iCustomInput"/>
<xs:element ref="iUUID"/>
<xs:element ref="input"/>
<xs:element ref="if"/>
</xs:choice>
</xs:group>

<xs:attributeGroup name="windowattributes">
<xs:attribute name="window" use="optional">
<xs:annotation>
<xs:documentation>
Name of the window to open in.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="yes" name="menubar" type="yes_no" use="optional">
<xs:annotation>
<xs:documentation>
Display the menu bar?
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="yes" name="toolbar" type="yes_no" use="optional">
<xs:annotation>
<xs:documentation>
Display the tool bar?
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="yes" name="scrollbars" type="yes_no" use="optional">
<xs:annotation>
<xs:documentation>
Display scroll bars?
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="yes" name="resizable" type="yes_no" use="optional">
<xs:annotation>
<xs:documentation>
Window is resizable?
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="yes" name="location" type="yes_no" use="optional">
<xs:annotation>
<xs:documentation>
Display the location bar?
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="width" type="xs:integer" use="optional">
<xs:annotation>
<xs:documentation>
Width of the window (in pixels)
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="height" type="xs:integer" use="optional">
<xs:annotation>
<xs:documentation>
Height of the window (in pixels)
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>


<xs:element name="iSubform">
<xs:annotation>
<xs:documentation>
iSubform FiForm object. This displays a separate form in an iframe to show/edit related records.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="caption">
<xs:annotation>
<xs:documentation>
Caption text displayed for this field.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="href" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
File name of linked form. 
</xs:documentation>

</xs:annotation>
</xs:attribute>
<xs:attribute default="normal" name="view" type="subviewtype">
<xs:annotation>
<xs:documentation>
The default view of the subform. Normal is data entry view, starting on first record. Sheet is sheet view. New is data entry view starting with a new record.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="params" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Parameters passed to subform. Name=value pairs delimited with ampersand (&amp;) signs. Variable substitutions will be made for all field names enclosed in percent (%) signs. 
</xs:documentation>
<xs:documentation>
eg. params="fk1=%pk%&amp;fk2=%pk2%" 
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="width">
<xs:annotation>
<xs:documentation>
Width of the iframe, in pixels.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="height">
<xs:annotation>
<xs:documentation>
Height of the iframe, in pixels. 
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="fkey">
<xs:annotation>
<xs:documentation>
Foreign Key in the table linked in the subform.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="iCustomInput">
<xs:annotation>
<xs:documentation>
FiForm iCustomInput Object. A fully customizable control. The contents of this control will simply be copied into the form, with variable substitutions made in between percent (%) signs.
</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
<xs:sequence maxOccurs="unbounded" minOccurs="0">
<xs:any namespace="http://www.w3.org/1999/xhtml" processContents="skip"/>
</xs:sequence>
<xs:attribute name="caption">
<xs:annotation>
<xs:documentation>
Caption text displayed for this field.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="expression">
<xs:annotation>
<xs:documentation>
Expression evaluated to create the control. Field names enclosed in %% signs will be expanded to field values.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name="input">
<xs:annotation>
<xs:documentation>
Deprecated input element. If possible, specific elements such as iText, iTextArea, iDateText, etc. should be used as they are more expressive.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="type" use="required">
<xs:annotation>
<xs:documentation>
Type of input. (i.e. "iText", "iTextArea")
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup ref="inputfields">
</xs:attributeGroup>
<xs:attribute name="p1">
<xs:annotation>
<xs:documentation>
First Parameter passed to constructor (after field name)
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="p2">
<xs:annotation>
<xs:documentation>
Second Parameter
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="p3">
<xs:annotation>
<xs:documentation>
Third Parameter, etc.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="p4">
</xs:attribute>
<xs:attribute name="p5">
</xs:attribute>
<xs:attribute name="p6">
</xs:attribute>
<xs:attribute name="p7">
</xs:attribute>
<xs:attribute name="p8">
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:attributeGroup name="inputfields">
<xs:attribute name="field" type="xs:token" use="required">
<xs:annotation>
<xs:documentation>
The name of the database field to which this input is bound, and also the name of the field in the HTML form. If this name does not match any field in the database, the input will simply not be bound to any field, but the value will be submitted with this name.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="caption" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Second Parameter
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="default" use="optional">
<xs:annotation>
<xs:documentation>
Default value for this field in new records. If this is an iDateText value, the special default value of &quot;today&quot; will always default to today's date.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="datatype" use="optional">
<xs:annotation>
<xs:documentation>
MySQL database datatype to use for field (not including length of field). If not specified, this will default to a sensible values based on the type of input. Default datatypes are as follows:
	
	iHidden: VARCHAR;
	iText: VARCHAR;
	iTextArea: TEXT;
	iDateText: DATE;
	iDBSelect: VARCHAR;
	iCheck: TINYINT;
	iUUID: VARCHAR;
	
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="maxlength" use="optional">
<xs:annotation>
<xs:documentation>
    Maximum number of characters in field. For iText and iHidden elements, this defaults to 100 if size is not specified, 
	or to size * 2 if size is specified.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="display" type="sheetform" use="optional">
<xs:annotation>
<xs:documentation>
Display element on sheet, form, both, or none
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="onchange">
<xs:annotation>
<xs:documentation>
Javascript executed when the field is changed.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="onblur">
<xs:annotation>
<xs:documentation>
Javascript executed when the field has lost the focus.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="onfocus">
<xs:annotation>
<xs:documentation>
Javascript executed when the field gains the focus.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="onkeypress">
<xs:annotation>
<xs:documentation>
Javascript executed on key press
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="onkeydown">
<xs:annotation>
<xs:documentation>
Javascript executed on key down
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="yes" name="enabled" type="yes_no">
<xs:annotation>
<xs:documentation>
Set to "no" to disable this iInput
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="readonly" use="optional" type="readonly">
<xs:annotation>
<xs:documentation>
If set, this element will be read only on the form.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>

<xs:simpleType name="yes_no">
<xs:restriction base="xs:string">
<xs:enumeration value="yes"/>
<xs:enumeration value="no"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="styletype">
<xs:restriction base="xs:string">
<xs:enumeration value="select"/>
<xs:enumeration value="radio"/>
<xs:enumeration value="dynamic"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="readonly">
<xs:restriction base="xs:string">
<xs:enumeration value="readonly"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="sheetform">
<xs:restriction base="xs:string">
<xs:enumeration value="sheet"/>
<xs:enumeration value="form"/>
<xs:enumeration value="both"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="selected">
<xs:restriction base="xs:string">
<xs:enumeration value="selected"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="navlink_positions">
<xs:restriction base="xs:string">
<xs:enumeration value="bottom"/>
<xs:enumeration value="top"/>
<xs:enumeration value="both"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="svlink_positions">
<xs:restriction base="xs:string">
<xs:enumeration value="right"/>
<xs:enumeration value="left"/>
<xs:enumeration value="both"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="allowed_view">
<xs:restriction base="xs:string">
<xs:enumeration value="both"/>
<xs:enumeration value="form"/>
<xs:enumeration value="sheet"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="default_vew">
<xs:restriction base="xs:string">
<xs:enumeration value="form"/>
<xs:enumeration value="sheet"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="database">
<xs:annotation>
<xs:documentation>
Database types for which support may be added. Currently, only MySQL is supported.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="MySQL"/>
<xs:enumeration value="Oracle"/>
<xs:enumeration value="PostgreSQL"/>
<xs:enumeration value="ODBC"/>
<xs:enumeration value="XML"/>
</xs:restriction>
</xs:simpleType>

<xs:element name="connect">
<xs:annotation>
<xs:documentation>
Information needed to connect with the database.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="primaryKey">
<xs:annotation>
<xs:documentation>
Primary Key(s) of table, used to update.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute default="MySQL" name="type" type="database" use="optional">
<xs:annotation>
<xs:documentation>
Type of database to connect to. Currently only MySQL is supported.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="1" name="id" type="xs:integer" use="optional">
<xs:annotation>
<xs:documentation>
Numerical ID of connection. Usually 1.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="localhost" name="server" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Hostname or IP address of server. Leave blank for default (localhost)
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="db" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
Database to select after connecting.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="update" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Information about the table that will be updated by this form.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="user" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Optional. Username to use in connecting to database.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="passwd" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Optional. Password to use in connecting to database.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>



<xs:element name="update">

<xs:complexType>

<xs:attribute name="table" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
Name of the primary table this form updates. Although a query can be specified to retreive rows from any table, only this will be updated.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="query">
<xs:annotation>
<xs:documentation>
Optional specification of an SQL query to retreive data for the form. Note that only the table specified in "update" will be updated. Also, column names from the query must match the names of the fields in the underlying table on all fields that are to be updated. The dataQuery should not contain a GROUP BY or HAVING clause. 
</xs:documentation>
<xs:documentation>
If grouped results are desired, you can use a sub-query in MySQL 4.1 or later. eg. "SELECT * FROM (SELECT a, SUM(b) FROM table1 GROUP BY a) as t". Note, however, that such an arrangement may yield unpredictable results if updates are allowed, as aggregate queries do not necessarily have a 1 to 1 relationship with underlying data.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" ref="sql">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="f">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="query">
</xs:element>
</xs:sequence>
<xs:attribute name="connectid" type="xs:integer" use="optional" default="1">
</xs:attribute>
<xs:attribute name="output" type="yes_no" use="optional" default="yes">
</xs:attribute>
<xs:attribute name="resultname" type="xs:string" use="optional">
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name="f">
<xs:annotation>
<xs:documentation>
Field Listing and Formating Information. If this element is present,
only the listed fields will be present. The content of this element
should match the name of the field returned by the SQL query.
A column header alias (a element) should be supplied for each field,
and optionally summary and formatting information.
</xs:documentation>
<xs:documentation>
Currently this element is only implemented in FiReports. Including
it in a query in a FiForm has no effect at this time.
</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
<xs:attribute name="a" type="xs:string" use="required">
<xs:documentation>
Field Alias or Column Heading. Should be a short description of the field.
</xs:documentation>
</xs:attribute>
<xs:attribute name="summary" type="fsummarytype" use="optional">
<xs:documentation>
Summary options for totalling the field.
</xs:documentation>
</xs:attribute>
<xs:attribute name="format" type="fformattype" use="optional">
<xs:documentation>
Field Format. 
</xs:documentation>
</xs:attribute>
<xs:attribute name="formatopts" type="xs:string" use="optional">
<xs:documentation>
Decimal format for numbers. This is a string passed to the xslt format-number function. For example, a currency field could have a format of "$#,##0.00"
</xs:documentation>
</xs:attribute>
</xs:complexType>
</xs:element>


<xs:simpleType name="fformattype">
<xs:restriction base="xs:string">
<xs:enumeration value="number"/>
<xs:enumeration value="text"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="fsummarytype">
<xs:restriction base="xs:string">
<xs:enumeration value="count"/>
<xs:enumeration value="sum"/>
<xs:enumeration value="running sum"/>
</xs:restriction>
</xs:simpleType>


<xs:element name="sql" type="varMixed">
<xs:annotation>
<xs:documentation>
SQL query with "var" substitutions mixed in. Note for forms that
</xs:documentation>
</xs:annotation>
</xs:element>

<xs:complexType mixed="true" name="varMixed">
<xs:annotation>
<xs:documentation>
Text content with param elements mixed in.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="var">
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:element name="var">
<xs:annotation>
<xs:documentation>
Parameter substitution element
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="ref" type="xs:token" use="required">
<xs:annotation>
<xs:documentation>
Name of parameter to substitute
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name="param">
<xs:annotation>
<xs:documentation>
Parameter retreived either from GET or from a parent query.
</xs:documentation>
</xs:annotation>
<xs:complexType>

<xs:sequence>
<xs:element minOccurs="0" ref="rowsource">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="rowparam">
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="option">
</xs:element>
</xs:sequence>

<xs:attribute name="name" type="xs:token" use="required">
</xs:attribute>
<xs:attribute name="caption" type="xs:string" use="optional">
</xs:attribute>
<xs:attribute name="value" type="xs:string" use="optional">
</xs:attribute>
<xs:attribute name="type" type="xs:string" use="optional">
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name="rowsource">
<xs:complexType>
<xs:attribute name="href" type="xs:string" use="required">
</xs:attribute>
<xs:attribute name="app" type="xs:string" use="optional">
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name="rowparam">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required">
</xs:attribute>
<xs:attribute name="link" type="xs:string" use="required">
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name="primaryKey">
<xs:complexType>
<xs:attribute name="field" type="xs:token" use="required">
</xs:attribute>
</xs:complexType>
</xs:element>

<xs:element name="wrapper">
<xs:annotation>
<xs:documentation>
Pieces of HTML code substituted at various places in the resulting HTML document to create a custom page header, page footer, and/or javascript tags or links in the HTML header.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice>
<xs:sequence>
<xs:element ref="if">
</xs:element>
</xs:sequence>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" ref="headerTags">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="pageHeader">
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" ref="pageFooter">
</xs:element>
</xs:sequence>
</xs:choice>
</xs:complexType>
</xs:element>

<xs:element name="headerTags">
<xs:annotation>
<xs:documentation>

</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:any namespace="http://www.w3.org/1999/xhtml" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="pageHeader">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:any namespace="http://www.w3.org/1999/xhtml" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="pageFooter">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:any namespace="http://www.w3.org/1999/xhtml" processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>
