This chapter is normative.
XForms have been designed for use within other XML vocabularies, in particular XHTML. This chapter discusses some of the high-level features of XForms that allow it to be used with other document types.
The XForms namespace has the URI: http://www.w3.org/2001/02/xforms.
Future revisions are expected to use a different identifier. This document uses
the convention of an xform: prefix to represent elements and attributes
that are part of the XForms Namespace.
XForms Processors must use the XML namespaces mechanism [XML Names] to recognize elements and attributes from this namespace.
The <xform> element is used as a container for other XForms
elements, and can serve as the root element of a standalone document or be embedded
in other document types such as XHTML. A single containing document
may contain any number of <xform> elements.
XML Representation : <xform> <xform xmlns = namespace-identifier id = xsd:ID > <!-- Content: (submit | bind)*, model, instance --> </xform>Attribute Definitions:
xmlns = namespace-identifier- Optional standard XML attribute for identifying an XML namespace. It is frequently useful to include this standard attribute at this point.
id= xsd:ID- Optional unique identifier used to refer to this particular
<xform>element.
For example:
<xform xmlns="http://www.w3.org/2001/02/xforms" id="Person"> <model href="Schema-Questionnaire.xform" /> <instance href="URL-to-retrieve-defaults" /> ... </xform>
The <model> element is used to define the XForms
Model. The content of the XForms Model
may be defined inline or obtained from a external URI.
Editor's Note: The Working Group is actively investigating the potential of using XLink simple links within XForms.
XML Representation : <model> <model id = xsd:ID href = xsd:uriReference > <!-- Content: (xsd:schema | simple) --> </model>Attribute Definitions:
id= xsd:ID- Optional unique identifier.
href= xsd:uriReference- Optional link to an externally defined XForms Model.
The content of the <model> element is restricted to either
XML Schema content, or XForms simple syntax. The content of <simple>
is defined in the XForms Model chapter.
Editor's Note: We still need to define behavior if both an inline XForms Model and an external XForms Model are used together.
The <instance> element is used to define initial instance
data. The instance data may be
defined inline or obtained from a external URI.
XML Representation : <instance> <instance id = xsd:ID href = xsd:uriReference > <!-- Content: (##other) --> </instance>Attribute Definitions:
id= xsd:ID- Optional unique identifier.
href= xsd:uriReference- Optional link to externally defined instance data.
The content of the <instance> element is arbitrary XML in
any namespace other than the XForms namespace. Authors must ensure that proper
namespace declarations are used for content within the <instance>
element.
[Editor's Feedback Request 9.2.2.schemalocation: Should
a schemaLocation attribute, linking the instance data with a schema
definition, be present here?]
The <submitInfo> element provides information on how and
where to submit the instance data.
XML Representation : <submit> <submitInfo id = xsd:ID target = xsd:uriReference method = xsd:string > <!-- Content: (##empty) --> </submitInfo>Attribute Definitions:
id= xsd:ID- Optional unique identifier.
href= xsd:uriReference- Required destination for submitted instance data.
method = xsd:string- Optional indicator to provide details on the submit protocol. With HTTP, the default is "
POST".
The <bind> element represents a connection between the different
parts of XForms.
XML Representation : <bind> <bind id = xsd:ID ref = XForms binding expression > <!-- Content: (##empty) --> </bind>Attribute Definitions:
id= xsd:ID- Required unique identifier.
ref= XForms binding expression- A link to an externally defined XForms Model.
Additional details are found in the Binding chapter.