11Form Content
A form is a container for user interface controls which a
user interacts with. For example, buttons, text boxes, check boxes, and
drop-down lists are user interface controls that can be contained in a form. In
the XML file format, the following basic rules apply to user interface controls
and forms:
�
All controls must be located in a form.
�
All controls that are not hidden have to be associated with an absolute or relative
position. These visual aspects of the control are represented by drawing shapes
that contain a reference to the control. See section 9.2.12 for details.
�
Forms may be nested.
�
Forms are not connected with the text flow and
layout of a document. This does not apply to controls.
�
Forms can be data-aware. The controls reflect
the content of a database.
Forms define rules for the following form behavior:
�
Submitting the form, which is similar to
[HTML4].
Note: Form submission is
only supported for non nested forms that contain only controls that can be
converted to HTML.
�
Connecting to a data source. When this happens,
the controls in a form become data-aware.
�
Submitting and binding according to the [XForms]
data model.
Forms are contained in the <office:forms> section
of an XML document. This element may contain an arbitrary sequence of <form:form> or <xforms:model>
elements. Note that controls are always declared inside a <form:form>
element, while an <xforms:model> element
contains only the XForms data model. Thus, the <office:forms>
element may contain only <form:form> elements
but no <xforms:model> element, while an <xforms:model> would typically be accompanied by an
additional <form:form> element.
<define name="office-forms">
<optional>
<element
name="office:forms">
<ref
name="office-forms-attlist"/>
<zeroOrMore>
<choice>
<ref
name="form-form"/>
<ref
name="xforms-model"/>
</choice>
</zeroOrMore>
</element>
</optional>
</define>
For ease of use when using (filling out) forms, applications
may focus controls initially so that the user can immediately type into the
first form control. To achieve this behavior, the form:automatic-focus
flag may be set to true.
<define name="office-forms-attlist"
combine="interleave">
<optional>
<attribute
name="form:automatic-focus" a:defaultValue="false">
<ref
name="boolean"/>
</attribute>
</optional>
</define>
Application which support both creation and usage (filling
out) of forms, the form:apply-design-mode flag
determines whether the application is supposed to present the forms in this
document in editable or fill-out state.
<define name="office-forms-attlist"
combine="interleave">
<optional>
<attribute
name="form:apply-design-mode" a:defaultValue="true">
<ref
name="boolean"/>
</attribute>
</optional>
</define>