Table of Contents | Prev | Next | Bottom |
Quick Table of Contents |
---|
10 Document Structure 10.1 The XForms Namespace 10.2 XForms Elements 10.2.1 xform 10.2.2 model 10.2.3 instance 10.2.4 submitInfo 10.2.5 bindings 10.2.6 privacy 10.2.7 action 10.2.8 extension 10.3 Integration with XLink 10.3.1 XLink role for XForms 10.3.2 XLink role for the XForms Model 10.3.3 XLink role for the Instance Data 10.3.4 XLink role for the XForms User Interface |
The XForms specification is an application of XML [XML 1.0], and has been designed for use within other XML vocabularies, in particular XHTML [XHTML 1.0]. This chapter discusses the structure and high-level features of XForms that allow this specification to be used with other document types.
The XForms namespace has the URI: http://www.w3.org/2001/08/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. Except where specifically allowed by the Schema for XForms, foreign-namespaced elements are not allowed as content of elements in the XForms namespace. Foreign-namespaced attributes are, however, allowed on any XForms element. The XForms Processor must ignore any foreign-namespaced elements or attributes that are unrecognized.
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.
Editorial note | |
under discussion are XLink attributes on the xform
element. These are: xlink:type="extended" and
xlink:role="http://www.w3.org/2001/08/xforms" - and they should be
defaulted or even fixed in the Schema/DTD.
|
xform
>
<xform id = xsd:ID > <!-- Content: unordered (submitInfo?, privacy?, bindings?, model?, instance?) --> </xform>
id = xsd:ID - Optional unique identifier used to refer to this particular
xform
element.
For example:
<xform xmlns="http://www.w3.org/2001/08/xforms" id="Person"> <model xlink:href="Schema-Questionnaire.xform" /> <instance xlink:href="http://example.com/cgi-bin/get-instance" /> ... </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.
model
>
<model id = xsd:ID xlink:href = xsd:anyURI > <!-- Content: ( schema subset syntax ) --> </model>
id = xsd:ID - Optional unique identifier.
xlink:href = xsd:anyURI - Optional link to an externally defined XForms Model.
Editorial note | |
As above, we need to find a place to discuss the defaulted
attributes. Here they are
xlink:role="http://www.w3.org/2001/08/xforms-model"
xlink:type="locator"
|
The instance
element is used to define initial instance data.
The instance data may be defined inline or obtained from a external URI.
instance
>
<instance id = xsd:ID xlink:href = xsd:anyURI > <!-- Content: (##other) --> </instance>
id = xsd:ID - Optional unique identifier.
xlink:href = xsd:anyURI - 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.
Editorial note | |
As above, we need to find a place to discuss the defaulted
attributes. Here they are
xlink:role="http://www.w3.org/2001/08/xforms-instance"
xlink:type="locator"
|
The submitInfo
element provides information on how and where to
submit the instance data.
submitInfo
>
<submitInfo id = xsd:ID action = xsd:anyURI encType = "xml" | "urlencoded" | "form-data" | qname-but-not-ncname : "xml" method = "post" | qname-but-not-ncname : "post" version = xsd:NMTOKEN indent = xsd:boolean encoding = xsd:string mediaType = xsd:string omitXMLDeclaration = xsd:boolean standalone = xsd:boolean CDATASectionElements = list of xsd:QName > <!-- Content: (##empty) --> </submitInfo>
id = xsd:ID - Optional unique identifier.
action = xsd:anyURI - Required destination for submitted instance data.
encType = "xml" | "urlencoded" | "form-data" | qname-but-not-ncname : "xml" - Optional indicator as to the method used to serialize the instance data for submission.
method = "post" | qname-but-not-ncname : "post" - Optional indicator as to the protocol to be used to deliver the serialized instance data.
version = xsd:NMTOKEN - corresponds to theversion
attribute ofxsl:output
indent = xsd:boolean - corresponds to theindent
attribute ofxsl:output
encoding = xsd:string - corresponds to theencoding
attribute ofxsl:output
mediaType = xsd:string - corresponds to themedia-type
attribute ofxsl:output
omitXMLDeclaration = xsd:boolean - corresponds to theomit-xml-declration
attribute ofxsl:output
standalone = xsd:boolean - corresponds to thestandalone
attribute ofxsl:output
CDATASectionElements = list of xsd:QName - corresponds to thecdata-section-elements
attribute ofxsl:output
Note:
Note that the XSLT attributes doctype-system
and doctype-public
are not
supported in XForms.
The bindings
element is a container for bind
elements.
bindings
>
<bindings id = xsd:ID > <!-- Content: (bind+) --> </bindings>
id = xsd:ID - Optional unique identifier.
Additional details, including the definition of the <bind> element are found in the chapter 5 The XForms Model.
Editorial note | |
As above, we need to find a place to discuss the defaulted XLink attributes. |
The privacy
element is used to associate a P3P
[P3P 1.0] policy reference with a particular form.
privacy
>
<privacy id = xsd:ID xlink:href = xsd:anyURI > <!-- Content: (##empty) --> </privacy>
id = xsd:ID - Optional unique identifier.
xlink:href = xsd:anyURI - Optional link to an externally defined P3P policyref file (not an actual policy).
Editorial note | |
As above, we need to find a place to discuss the defaulted XLink attributes. |
The action
element serves a a location to attach a listener to
events targeting the xform
element.
action
>
Defined at 7.14.4.5 action.
Editorial note | |
As above, we need to find a place to discuss the defaulted XLink attributes. |
The extension
element serves as a location to attach arbitrary
non-XForms element content, for instance RDF information associated with a
form.
extension
>
Defined at 7.14.4.6 extension.
Editorial note | |
As above, we need to find a place to discuss the defaulted XLink attributes. |
XForms make good use of XLink [XLink] features. To that end, the XLink namespace is integrated in the DTD/Schema, the majority of the attributes have sensible defaults, including those based on XLink roles defined below.
This document uses the convention of an xlink:
prefix for the XLink namespace http://www.w3.org/1999/xlink
[XLink].
Note that the XLink support uses a well-defined XLink failure mode: If an
XLink attribute is not provided, the element looses its XLink specific meaning.
We use this feature in order to allow application developers to either provide
the model and instance via an external reference (via an xlink:href
attribute) or to provide the data inline without the attribute. In the latter
case, the XLink-specific meaning of the element is lost and the inline content
used. If both inline content and external reference is provided, a processor
must use the external reference and ignore the inline content.
For the purposes of XForms, we suggest that XLink aware processors switch
from the xlink:type="locator"
mode to the xlink:type="resource"
mode. This should be specified in the document by setting xlink:type="resource"
, though a processing agent may not depend on it. In other words, the
first two of the following examples must be treated identically:
xlink:type
<model> <!-- Content: ( schema subset syntax ) --> </model>
xlink:type
<model xlink:type="resource"> <!-- Content: ( schema subset syntax ) --> </model>
<model xlink:href="URI" />
XLink allows users to
provide arc-type elements to specify traversal rules. The integration of
arc-type elements in XForms would require additional elements in the
xform
element that are otherwise not necessary for XForms. Hence, for
children of the xform
element, the traversal rule is to traverse xlink:from
the current document xlink:to
the document pointed to by the external resource. The processor should
behave as if xlink:actuate="onLoad"
was specified. The xlink:show
attribute is meaningless in
this context, anyway.
An XForms processor is not required to implement full XLink--correct
behavior of the xlink:href
attribute (as defined above) is
sufficient. It is permissible to construct the additional information from the
semantics of the elements. An XForms Processor can not be XForms compliant,
however, if it attempts to implement XLink and the implementation does not
conform to XLink specification with respect to the attributes used by
XForms.
The following definition of the XLink roles defines the relationship between the various resources participating in a XForms-based form, not properties that are inherent to the resources. It is perfectly permissible for the same resource to participate in various XForms-based forms in different roles.
The xlink-role for XForms is http://www.w3.org/2001/08/xforms
. This means that XLink processors encountering a link with a xlink:role="http://www.w3.org/2001/08/xforms"
must assume that the arcs associated with the other XLink roles for
XForms (see below) behave as above. In other words, this XLink role is an
additional hint beyond the element names for an XLink processor to identify the
arcs. For all roles, if element names and XLink behavior conflict, XLink role
behavior prevails.
The xlink-role for XForms Models is http://www.w3.org/2001/08/xforms-model
. This means that XLink processors encountering a link with a xlink:role="http://www.w3.org/2001/08/xforms-model"
must assume that the referenced resource relates to the other resources
as XForms Model as defined in 5 The XForms Model.
The xlink-role for XForms Instances is http://www.w3.org/2001/08/xforms-instance
. This means that XLink processors encountering a link with a xlink:role="http://www.w3.org/2001/08/xforms-instance"
must assume that the referenced resource is the initialization data of
a form.
The xlink-role for XForms User Interfaces is http://www.w3.org/2001/08/xforms-ui
. This means that XLink processors encountering a link with a xlink:role="http://www.w3.org/2001/08/xforms-ui"
must assume that the referenced resource is the user interface of a
form. Note that this role does not make an assertion about the content type of
the referenced resource other than that it is an XML format. For example, it
can be XHTML+XForms, pure XForms, SVG+XForms or pure SVG any other combination.
This role does not correspond to any element defined in XForms; it is defined
so that XLink linkbases [XLink] can be established containing
all the information about a XForms document.
Table of Contents | Top |