<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://echo.nasa.gov/v9/echoforms" 
elementFormDefault="qualified" 
xmlns="http://echo.nasa.gov/v9/echoforms" xmlns:mstns="http://echo.nasa.gov/v9/echoforms" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="Form">
  	<xs:annotation>
      <xs:documentation>
      The form element is the root element of any ECHO Forms document.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="import" type="Import" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="model" type="Model" minOccurs="1" maxOccurs="1" />
      <xs:element name="ui" type="UI" minOccurs="1" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="targetNamespace" type="StringMinLength1">
    	<xs:annotation>
      		<xs:documentation>
      		This attribute defines the target namespace of the form which is the namespace that all the user interface controls are in. 
      		This namespace is important when referring to controls imported from other ECHO Forms documents. 
      		See Reference Controls for more information on importing controls.
      		</xs:documentation>
    	</xs:annotation>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="Model">
  	<xs:annotation>
      <xs:documentation>
      The model element contains the instance and allows for extensibility to ECHO Forms.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="instance" type="Instance" />
      <xs:element name="extension" type="Extension" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Instance">
  	<xs:annotation>
      <xs:documentation>
      The instance represents both a model of the data that is the result of an ECHO Form as well as initial values for the model. 
      There should be only one element inside the instance. 
      The element in the instance should be valid such that if it were copied into its own document it would represent 
      a valid XML document. 
      This means that the element should define all namespaces and prefixes required for it and its sub elements. 
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:any namespace="##other" processContents="lax" minOccurs="1" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Extension">
  	<xs:annotation>
      <xs:documentation>
      ECHO Forms is created such that it is extensible. 
      Extensions are things that may be processed by a client or different parts of ECHO but may not apply to every use of ECHO Forms. 
      An extension has a QName to identify it and can contain any XML not in the ECHO Forms namespace.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:any namespace="##other" processContents="lax" minOccurs="1" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="name" type="xs:QName" />
  </xs:complexType>
  <xs:complexType name="UI">
  	<xs:annotation>
      <xs:documentation>
      The user interface (UI) of ECHO Forms is described in the form using controls. 
      Control types vary to support the collection of various types of information.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:choice minOccurs="1" maxOccurs="unbounded">
        <xs:element name="group" type="Group" />
        <xs:element name="input" type="Input" />
        <xs:element name="repeat" type="Repeat" />
        <xs:element name="textarea" type="TextArea" />
        <xs:element name="output" type="Output" />
        <xs:element name="secret" type="Secret" />
        <xs:element name="select" type="Select" />
        <xs:element name="selectref" type="SelectRef" />
        <xs:element name="range" type="Range" />
        <xs:element name="controlref" type="ControlRef" />
      </xs:choice>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Import">
  	<xs:annotation>
      <xs:documentation>
      ECHO Forms Documents can import other ECHO Forms documents registered in ECHO.
	  Import statements have two parts, a name and owner guid.  
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
    </xs:sequence>
    <xs:attribute name="ownerGuid" type="xs:string" use="optional">
    	<xs:annotation>
      		<xs:documentation>
      		The owner guid indicates the owner of the ECHO Forms document.
      		</xs:documentation>
    	</xs:annotation>
    </xs:attribute>
    <xs:attribute name="name" type="xs:string" use="required">
    	<xs:annotation>
      		<xs:documentation>
      		The name indicates the file name of the ECHO Forms document.
      		</xs:documentation>
    	</xs:annotation>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="Group">
  	<xs:annotation>
      <xs:documentation>
      	<p>
      	A group combines together other controls to show they belong together. 
      	A group is often displayed as a bounding box with a label. 
      	This shows the user that the elements of the group are part of a single unit.
      	</p>
      	<em>Common Component Variations</em>
      	<p>
      	The ref attribute is optional for a group. It can not reference an attribute. 
      	</p>
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Control">
        <xs:sequence>
          <xs:choice minOccurs="1" maxOccurs="unbounded">
            <xs:element name="group" type="Group" />
            <xs:element name="input" type="Input" />
            <xs:element name="repeat" type="Repeat" />
            <xs:element name="textarea" type="TextArea" />
            <xs:element name="output" type="Output" />
            <xs:element name="secret" type="Secret" />
            <xs:element name="select" type="Select" />
            <xs:element name="selectref" type="SelectRef" />
            <xs:element name="range" type="Range" />
            <xs:element name="controlref" type="ControlRef" />
          </xs:choice>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Input">
  	<xs:annotation>
      <xs:documentation>
      	<p>
      	Types Supported: string, double, dateTime, long, int, short, boolean
      	</p>
      	<p>
      	The input control allows free-form input from the user. 
      	The client should attempt to provide an accurate rendering of the control for the given data type. 
      	For example, for a boolean type a checkbox should be used. For a dateTime type, a date picker should be used.
      	</p>
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="TypedControl">
        <xs:sequence>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Select">
  	<xs:annotation>
      <xs:documentation>
      	<p>
      	Types Supported: string, double, dateTime, long, int, short
      	</p>
      	<p>
      	This form control allows the user to make one or multiple selections from a set of choices. 
      	A select control uses an attribute to indicate if it is a single or multiple select. 
      	A select may also be open, which means that a user may type in a value and select it. 
      	In the case of an open select, the items in the instance which indicate selection may not be limited to the 
      	items in the original list of choices.
      	</p>
      	<em>Common Component Variations</em>
      	<p>
      		<ul>
      			<li>The ref attribute will refer to the root element which will hold the selected value elements. 
      			The name of the selected value elements is indicated with a specific attribute.</li>
      			<li>The required attribute indicates that at least one item must be selected. If the required attribute is false, 
      			an instance document with no selected items is valid. A constraint may be used to enforce a minimum number of 
      			selected items (for example, enforcing the selection of at least three items in a selection).</li>
      		</ul>
      	</p>
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="TypedControl">
        <xs:sequence>
          <xs:element name="item" type="SelectItem" minOccurs="1" maxOccurs="unbounded">
          	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
					</ul>
					<p>
					The item child element defines the valid items that may occur in the selection. 
					Each item element contains a value and label child elements. 
					The label will be displayed to the user by the client application for each item. 
					The value is the value that will occur in the model instance if the item is selected. Value must be of length 
					greater than or equal to 1.
					</p>
      			</xs:documentation>
    		</xs:annotation>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="multiple" type="xs:boolean" use="optional" default="false">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: â€˜trueâ€™ or â€˜falseâ€™</li>
						<li>Default Value: false</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					The multiple attribute contains a Boolean value which indicates if the selection allows multiple items to be selected. 
					If multiple selections are supported, the client must allow the user to select more than one item in the list of 
					choices.
					</p>
      			</xs:documentation>
    		</xs:annotation>
        </xs:attribute>
        <xs:attribute name="valueElementName" type="xs:NCName">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: any valid XML Schema NCName</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					The valueelementname attribute contains an NCName which is the name of the child element of the ref element 
					that will contain the selected values. 
					This element should only occur in the instance document to provide default selections. 
					If there is no default value for the select then the select element in the instance should not contain any children. 
					The client application will add and remove instances of this element as the selection changes. 
					The element will contain the value text of the selected item or items.
					</p>
      			</xs:documentation>
    		</xs:annotation>
        </xs:attribute>
        <xs:attribute name="open" type="xs:boolean" default="false" use="optional">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: â€˜trueâ€™ or â€˜falseâ€™</li>
						<li>Default Value: false</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					The value attribute contains a Boolean value which indicates if the selection is open to user input. 
					If the selection is open, the client must allow the user to enter values into the selection 
					and select those new values. 
					The editor for the value input should be type specific (for example, a date picker for the dateTime type). 
					If the selection is not open, the client must ensure that only items in the list of choices are selected. 
					If the user does not enter or select a value then there should be no value elements in the instance 
					document for this select.
					</p>
      			</xs:documentation>
    		</xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Secret">
  	<xs:annotation>
      <xs:documentation>
      	<p>
      	Types Supported: string, double, long, int, short
      	</p>
      	<p>
      	The secret control allows free-form input from the user. 
      	This control is identical to the input control with the following exceptions: it does not support the boolean or date types, 
      	user input must be obscured using an echo character such as a â€˜*â€™. 
      	The secret control is normally used like an input control but for sensitive data such as user names or passwords.
      	</p>
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="TypedControl">
        <xs:sequence />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TextArea">
  	<xs:annotation>
      <xs:documentation>
      	<p>
      	Types Supported: string
      	</p>
      	<p>
      	The textarea control allows free-form input from the user. 
      	This control is similar to the input control, except that it allows for multi-line input. 
      	The textarea control only supports the string type.
      	</p>
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="TypedControl">
        <xs:sequence />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Range">
  	<xs:annotation>
      <xs:documentation>
      	<p>
      	Types Supported: double, dateTime, long, int, short
      	</p>
      	<p>
      	This form control allows selection from a sequential range of values. 
      	A range control has a minimum value, maximum value, and a step size. 
      	The selected value must be between the minimum and maximum and occur on a valid step increment. 
      	A client will normally render a range control as a slider, spinner, or up-down box. 
      	The client must use the type information in the range control to render the proper controls to the user. 
      	The user should be told of the minimum, maximum, and step size.
      	</p>
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="TypedControl">
        <xs:sequence>
        </xs:sequence>
        <xs:attribute name="start" type="StringMinLength1" use="required">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: any valid value in the type of the range</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					The start attribute contains the minimum value of the range. 
					This value is inclusive and must be the same type as the range control.
					</p>
      			</xs:documentation>
    		</xs:annotation>
        </xs:attribute>
        <xs:attribute name="step" type="StringMinLength1" use="required">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: any valid positive value in the type of the range except in the case of a
						dateTime, in which case the valid value is any positive integer</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					The step attribute contains the amount that the range will move as the value is adjusted. 
					The user is required to pick a value which occurs on a step based on the start value of the range.
					The client should attempt to force the user onto the step values to limit user error. 
					The step value must be smaller than (end â€“ start). 
					In the case of a dateTime range type, the step value indicates the number of seconds.
					</p>
      			</xs:documentation>
    		</xs:annotation>
        </xs:attribute>
        <xs:attribute name="end" type="StringMinLength1" use="required">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: any valid value in the type of the range</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					The end attribute contains the maximum value of the range. 
					This value is inclusive and must be the same type as the range control.
					</p>
      			</xs:documentation>
    		</xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Output">
  	<xs:annotation>
      <xs:documentation>
      	<p>
      	Types Supported: string, double, dateTime, long, int, short, boolean, anyURI
      	</p>
      	<p>
      	Renders a value from the instance data, but provides no means for entering or changing data. 
      	It is used to display values from the instance. 
      	The output control can be used to display the value at a particular location in the instance by using a binding expression;
		it can also be used to display the result of evaluating an XPath expression by specifying the XPath expression to be evaluated 
		via attribute value instead of ref. 
		Note that attributes ref and value on element output are mutually exclusive. 
		It is recommended when the type of â€œanyURIâ€ is used that the client display the component as a clickable link.
      	</p>
      	<em>Common Component Variations</em>
      	<p>
      		<ul>
      			<li>The ref attribute is mutually exclusive with the value attribute.</li>
      			<li>The readonly attribute is ignored.</li>
      			<li>The required attribute is ignored.</li>
      		</ul>
      	</p>
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="TypedControl">
        <xs:sequence>
        </xs:sequence>
        <xs:attribute name="value" type="xs:string" use="optional">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: Yes</li>
						<li>Legal Values: any XPath expression that returns a string value</li>
						<li>Default Value: false</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					The value attribute contains an XPath expression that will be evaluated. 
					The resulting string of the evaluation will be displayed. 
					This attribute is mutually exclusive with the ref attribute. 
					If the value attribute is used, the type attribute must be type string.
					</p>
      			</xs:documentation>
    		</xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Repeat">
  	<xs:annotation>
      <xs:documentation>      	
      	<p>
      	A repeat allows the definition of repeating structures such as points within a polygon. 
      	As grouping controls repeats can be nested to define multiple levels of repetition such as many polygons being entered 
      	each with many points.
      	Repeat may be the most complex control for clients to handle. 
      	Clients must be able to allow the user to add or remove the repeated items.
      	</p>
      	<em>Common Component Variations</em>
      	<p>
      	The ref attribute is can not reference an attribute for a repeat. 
      	Ref in a repeat should reference the element to which the elements in the template should be added.
      	</p>
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Control">
        <xs:sequence>
          <xs:element name="template" type="Instance">
          	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: Any XML in namespace other than ECHO Forms namespace</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					Template is an element in repeat that is similar to instance in the model in that it can contain 
					any XML and defines a model for the controls in the repeat. 
					The template is used as a template for creating new elements to add as children to the node that ref points to. 
					Template can contain only one root element. 
					All of the children of a repeat reference a node in the repeats template.
					</p>
      			</xs:documentation>
    		</xs:annotation>
          </xs:element>
          <xs:choice minOccurs="1" maxOccurs="unbounded">
            <xs:element name="group" type="Group" />
            <xs:element name="repeat" type="Repeat" />
            <xs:element name="input" type="Input" />
            <xs:element name="textarea" type="TextArea" />
            <xs:element name="output" type="Output" />
            <xs:element name="secret" type="Secret" />
            <xs:element name="select" type="Select" />
            <xs:element name="selectref" type="SelectRef" />
            <xs:element name="range" type="Range" />
            <xs:element name="controlref" type="ControlRef" />
          </xs:choice>
        </xs:sequence>
        <xs:attribute name="minItems" type="xs:nonNegativeInteger" use="optional" default="0">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: Any valid XML Schema int</li>
						<li>Default Value: 0</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					The minItems attribute contains the minimum number of items that may appear in the repeat.
					The items refer to the instances of the template. The minItems attribute can be used to force a
					lower limit number of instances in the repeat before it is considered valid. 
					It is recommended that if the repeat contains the minimum number of items, 
					a client should not allow the user to remove any more items. 
					Setting the minItems and maxItems to the same value creates a closed repeat where items cannot be added or removed, 
					but simply edited. The model instance in the form must have enough items in the repeat to satisfy this constraint.
					</p>
      			</xs:documentation>
    		</xs:annotation>
        </xs:attribute>
        <xs:attribute name="maxItems" type="xs:nonNegativeInteger" use="optional">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: Any valid XML Schema int</li>
						<li>Default Value: Max integer</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					The maxItems attribute contains the maximum number of items that may appear in the repeat.
					The items refer to the instances of the template. 
					The maxItems attribute can be used to force an upper limit number of instances in the repeat before it is 
					considered invalid. It is recommended that if the repeat contains the maximum number of items, 
					a client should not allow the user to add any more items. 
					Setting the minItems and maxItems to the same value creates a closed repeat where items cannot be added or removed, 
					but simply edited. The model instance in the form must have fewer items in the repeat to satisfy this constraint.
					</p>
      			</xs:documentation>
    		</xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TypedControl">
  	<xs:annotation>
      <xs:documentation>
      	Typed controls are strongly typed using XML Schema types. 
      	These types indicate the format as well as the valid values that may occur in the instance document.
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="Control">
        <xs:sequence>
        </xs:sequence>
        <xs:attribute name="type" type="xs:QName" use="required">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      				<li>Computed Expression: No</li>
					<li>Legal Values: a QName of any supported XML Schema type</li>
					<li>Default Value: None</li>
				</ul>
				<p>
				The type attribute indicates the type of the data in the instance document. 
				Clients can also use the type information to customize the control by rendering it differently for 
				each supported type. 
				The type attribute is required on all typed controls unless otherwise noted by the control.
				</p>
      			</xs:documentation>
    		</xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Constraint">
  	<xs:annotation>
      <xs:documentation>
      A constraint child element specifies a predicate that needs to be satisfied for the associated 
      instance data node to be considered valid. 
      A control can have any number of constraints which are evaluated in the order that they appear.
      Because all the constraints must be satisfied, multiple constraints are â€˜and-edâ€™ together. 
      A constraint contains either a regular expression pattern or an XPath expression and an alert message.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:choice>
        <xs:element name="xpath" type="StringMinLength1">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: Yes</li>
						<li>Legal Values: any XPath expression that returns a boolean value</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					A xpath child element is a an XPath expression that must evaluate to true to satisfy the constraint. 
					The XPath may contain new line and tab characters to support readability. 
					New line and tab characters should be replaces with a space character before evaluating the XPath.
					</p>
      			</xs:documentation>
      		</xs:annotation>
        </xs:element>
        <xs:element name="pattern" type="StringMinLength1">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: any regular expression compatible with Perl 5</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					A pattern child element is a regular expression that must match the node data to satisfy the constraint. 
					The pattern will be applied to the un-encoded string value of the data node.
					Therefore XML elements in the value will be un-escaped, 
					however if a pattern is applied to a xsd:dateTime for example, the string will represent the schema encoded dateTime.
					</p>
      			</xs:documentation>
      		</xs:annotation>
        </xs:element>
      </xs:choice>
      <xs:element name="alert" type="StringMinLength1">
      	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: any xsd:string. It is recommended that a single, short sentence be used.</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: None</li>
					</ul>
					<p>
					A alert child element is a message that will be displayed to the user if the constraint is not satisfied. 
					This message should contain a description of how the user can satisfy the constraint.
					For example, a password constraint alert may say, â€œYour password must be at least 8 characters and contain numbers 
					and letter.â€ 
					It is recommended that the client display this message in a noticeable means such as using bright colors or a 
					notification dialog.
					</p>
      			</xs:documentation>
      		</xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="SelectRef">
  	<xs:annotation>
      <xs:documentation>
      	<p>
      	The selectref reference control indicates that the control referenced should replace this reference control in the form. 
      	The selectref element behaves identically to controlref except that it can only refer to select controls. 
      	A selectref element can limit the number of items available for selection in the referenced select control. 
      	Therefore, using a selectref, it is possible to share common selections even if all the users of the select control 
      	do not support all the items in the original select.
      	</p>
      	<p>
		If a selectref is required to contain all the items in the referenced select control, it is recommended that a controlref be 
		used instead of repeating all the items in the referenced select.
      	</p>
      	<em>Common Component Variations</em>
      	<p>Selectref has the same variations as controlref</p>    	
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="ControlRef">
        <xs:sequence>
          <xs:element name="item" type="SelectItem" minOccurs="1" maxOccurs="unbounded">
          	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
					</ul>
					<p>
					The item child element defines the valid items that may occur in the selection. 
					Each item element contains a value and label child elements. 
					The label will be displayed to the user by the client application for each item. 
					The value is the value that will occur in the model instance if the item is selected. 
					All of the values specified must occur in the selection referenced. 
					Therefore it is possible to only restrict a selection, but not to add new values to a referenced selection. 
					If an item does not have a label, the label defined in the referenced select control item should be used.
					</p>
      			</xs:documentation>
    		</xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SelectItem">
  	<xs:annotation>
      <xs:documentation>
      	The select item child element defines the valid items that may occur in the selection. 
      	Each item element contains a value and label child elements. 
      	The label will be displayed to the user by the client application for each item. 
      	The value is the value that will occur in the model instance if the item is selected. 
      	Value must be of length greater than or equal to 1.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
    </xs:sequence>
    <xs:attribute name="label" type="xs:string" use="optional">
    	<xs:annotation>
      		<xs:documentation>
      			The label will be displayed to the user by the client application for each item. 
      		</xs:documentation>
    	</xs:annotation>
    </xs:attribute>
    <xs:attribute name="value" type="StringMinLength1" use="required">
    	<xs:annotation>
      		<xs:documentation>
	      	The value is the value that will occur in the model instance if the item is selected. 
	      	Value must be of length greater than or equal to 1.
      		</xs:documentation>
    	</xs:annotation>
    </xs:attribute>
  </xs:complexType>
  <xs:simpleType name="StringMinLength1">
    <xs:restriction base="xs:string">
      <xs:minLength value="1" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="form" type="Form">
  </xs:element>
  <xs:simpleType name="ImportScope">
    <xs:restriction base="xs:string">
      <xs:enumeration value="SYSTEM" />
      <xs:enumeration value="PROVIDER" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ConstraintList">
  	<xs:annotation>
    	<xs:documentation>
      		A list of constraints.
      	</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="constraint" type="Constraint" minOccurs="1" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="UIComponent">
  	<xs:annotation>
      <xs:documentation>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="constraints" type="ConstraintList" minOccurs="0"/>
      <xs:element name="help" type="xs:string" minOccurs="0">
      	<xs:annotation>
      		<xs:documentation>
      			<ul>
      				<li>Computed Expression: No</li>
					<li>Legal Values: any xsd:string. It is recommended that a single, short sentence be used.</li>
					<li>Default Value: None</li>
					<li>Inheritance rules: Not inherited.</li>
				</ul>
				<p>
				A help child element is a simple text element that contains a string that will be used as the help of the control. 
				Although the client can choose the best way to associate the help with the control, 
				the help should be a single, short sentence and is normally rendered as a tool tip or status bar message for the 
				data portion of the control.
				</p>
      		</xs:documentation>
    	</xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="relevant" type="xs:string" use="optional">
    	<xs:annotation>
      		<xs:documentation>
      			<ul>
      				<li>Computed Expression: Yes</li>
					<li>Legal Values: any XPath expression that returns a boolean value</li>
					<li>Default Value: true()</li>
					<li>Inheritance rules: If the parent is not relevant then the children are not relevant as well.</li>
				</ul>
				<p>
				The relevant attribute is used to indicate the relevance of a given control. 
				If the control is relevant, the control should be displayed by the client and all other attributes should be
				evaluated (such as required and read only). 
				If a control is not relevant, it should be hidden by the client but the instance should not be modified. 
				When an instance document is submitted, any non-relevant nodes (the relevant XPath evaluates to false) must be 
				removed from the instance. 
				Due to a limitation in the specification, it is important to express all dependencies for a control when 
				using a ref attribute. 
				</p>
      		</xs:documentation>
    	</xs:annotation>
    </xs:attribute>
    <xs:attribute name="required" type="xs:string" use="optional">
    	<xs:annotation>
      		<xs:documentation>
      			<ul>
      				<li>Computed Expression: Yes</li>
					<li>Legal Values: any XPath expression that returns a boolean value</li>
					<li>Default Value: false()</li>
					<li>Inheritance rules: Not inherited.</li>
				</ul>
				<p>
				The required attribute indicates that the instance document must contain a value for the control before the form 
				may be submitted. 
				A value of false indicates that the instance may or may not contain a value for the control. 
				Required is only evaluated if the control is relevant.
				</p>
      		</xs:documentation>
    	</xs:annotation>
    </xs:attribute>
    <xs:attribute name="readonly" type="xs:string" use="optional">
    	<xs:annotation>
      		<xs:documentation>
      			<ul>
      				<li>Computed Expression: Yes</li>
					<li>Legal Values: any XPath expression that returns a boolean value</li>
					<li>Default Value: false()</li>
					<li>Inheritance rules: If a parent is read only then the children are read only as well.</li>
				</ul>
				<p>
				The readonly attribute indicates if the instance data is read only or mutable. 
				If the attribute evaluates to true, the client must prevent the user from modifying the instance data. 
				Note that because readonly is a computed expression, it may evaluate to true at one time and false another time. 
				Therefore depending on the XPath used, one cannot guarantee that the instance data may not have change at some point 
				in its lifespan. Obviously this would not be the case with a consistent XPath such as â€˜true()â€™.
				</p>
				<p>
				Unlike relevant, readonly controls should be displayed to the user, 
				however the user must not be able to edit the data.
				</p>
				<p>
					<em><b>Hint</b>To prevent a user from ever modifying part of the instance do not create a control that
					references that node. 
					Use the Output control if the data needs to be displayed to the user but never modified. 
					ReadOnly is best used if a controlâ€™s read only status should change based on other values within the instance.
					</em>
				</p>
      		</xs:documentation>
    	</xs:annotation>
    </xs:attribute>
    <xs:attribute name="ref" type="xs:string" use="optional">
    	<xs:annotation>
      		<xs:documentation>
      			<ul>
      				<li>Computed Expression: Yes</li>
					<li>Legal Values: any XPath expression that returns an element or attribute node</li>
					<li>Default Value: None</li>
					<li>Inheritance rules: See ECHO Forms Specification, section 4.5 XPath Context</li>
				</ul>
				<p>
				The ref attribute is used to bind a control to a node in the instance document. 
				If a control has a ref attribute, the XPath must be valid for the instance document in the form model. 
				Therefore, all controls that have a ref in the form must have a node in the default model instance. 
				The ref attribute is the key in linking the UI with the model in an ECHO Forms form.
				</p>
      		</xs:documentation>
    	</xs:annotation>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="Control">
  	<xs:annotation>
      <xs:documentation>
      	<p>
      	Controls are described in XML and rendered by a client application. 
      	Different clients may need to render the controls in different ways. 
      	For example, in an HTML based application, multiple HTML controls may need to be used to render a single ECHO Forms 
      	control such as a date input.
	  	For more interactive clients, such as a thick client .NET application, a complex date picker may be used.
	  	</p>
	  	<p>
		The controls are associated to the instance document using XPath. The controls will be populated with the values in the 
		default instance, and will update the instance as the data is modified in the control. 
		Many of the controls support strictly typed data and may be rendered differently by the client based on the data type.
		</p>
		<p>
		The controls in the user interface section are listed linearly with no layout information. 
		A client must keep the order of the controls when rendering the form in order to maintain the semantic meaning behind the 
		position of the controls. A client may decide to split the controls into multiple columns in a table, or in multiple dialogs. 
		This behavior is acceptable, as long as related elements are visually associated.
		</p>
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="UIComponent">
        <xs:sequence>
        </xs:sequence>
        <xs:attribute name="id" type="xs:NCName" use="optional">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: anything of type xs:NCNAME</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: Not inherited</li>
					</ul>
					<p>
					The id attribute allows a control to have a specific name that it can be referenced by. 
					This is useful for error messages or creating control references. 
					The whole identifier for a control consists of its id and the targetNamespace of the form itâ€™s in.
					</p>
      		</xs:documentation>
    	</xs:annotation>
        </xs:attribute>
        <xs:attribute name="label" type="xs:string" use="required">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: any xsd:string value. 
						It is recommended that only a few words be used. 
						New line characters are not permitted.</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: Not inherited</li>
					</ul>
					<p>
					A label attribute contains a string that will be used as the label of the control. 
					Although the client can choose the best way to associate the label with the control, 
					the label should be a limited number of words and is normally placed on the left or top of the data 
					portion of the control.
					</p>
      			</xs:documentation>
      		</xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ControlRef">
  	<xs:annotation>
      <xs:documentation>
      <p>
      The controlref reference control indicates that the control referenced should replace this reference control in the form. 
      Any attributes defined in the controlref element will replace those defined in the referenced control. 
      All constraints defined in a controlref element will be appended to those of the referenced control. 
      A controlref element may reference any control with an id attribute. 
      If the control referenced is in a separate form, the other form must be imported using the standard ECHO Forms import element.
      </p>
      <em>Common Component Variations</em>
      <p>
      Common component attributes used in a controlref will replace those of the control referenced. 
      In this way, it is possible to replace the relevant, required, label, and ref components of the referenced control. 
      If a controlref does not define one of the common control attributes, the value defined on the referenced control should be used.
      </p>
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="UIComponent">
        <xs:sequence>
        </xs:sequence>
        <xs:attribute name="idref" type="xs:QName" use="required">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: any QName which refers to a defined control id</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: Not inherited</li>
					</ul>
					<p>
					The idref attribute is a QName which indicates the control to reference. 
					The control referenced must be defined with the given id.
					</p>
      			</xs:documentation>
      		</xs:annotation>
        </xs:attribute>
        <xs:attribute name="label" type="xs:string" use="optional">
        	<xs:annotation>
      			<xs:documentation>
      				<ul>
      					<li>Computed Expression: No</li>
						<li>Legal Values: any xsd:string value. 
						It is recommended that only a few words be used. 
						New line characters are not permitted.</li>
						<li>Default Value: None</li>
						<li>Inheritance rules: Not inherited</li>
					</ul>
					<p>
					A label attribute contains a string that will be used as the label of the control. 
					Although the client can choose the best way to associate the label with the control, 
					the label should be a limited number of words and is normally placed on the left or top of the data 
					portion of the control.
					</p>
      			</xs:documentation>
      		</xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>