%ents; ]>
Data Forms Layout This specification defines a backwards-compatible extension to the XMPP Data Forms protocol that enables an application to specify form layouts, including the layout of form fields, sections within pages, and subsections within sections. &LEGALNOTICE; 0141 Draft Standards Track Standards Council XMPP Core XEP-0004 xdata-layout http://www.xmpp.org/schemas/xdata-layout.xsd &linuxwolf; 1.0 2005-05-12 psa Per a vote of the Jabber Council, advanced status to Draft. 0.3 2005-05-03 psa Renamed <desc/> element to <text/> to avoid confusion with XEP-0004 element names; clarified formal definition of <text/> element; added <text/> elements to examples. 0.2 2005-03-28 psa Editorial review: cleanup of text, examples, and schema. 0.1 2004-08-10 lw Initial version.

&xep0004; ("x:data") provides a simple and interoperable way to request and present information for both applications and humans. However, the simple nature of "x:data" requires the form renderer to use a generic "key/value" format. This document builds upon "x:data" to enable applications to specify additional layout information.

The requirements for this document are:

This document defines a new namespace, "http://jabber.org/protocol/xdata-layout". All layout is defined by "pages" and "sections".

All of the use cases refer to the following form:

XSF Application Please fill out this form ]]>

Note: Any newlines in the following examples are provided for the purpose of legibility only.

One of the simplest layout usages is to partition fields into pages. This is done by including one or more <page/> elements within the x:data form. Each <page/> element SHOULD possess a "label" attribute to label the page, MAY contain a <text/> child element for additional information, and SHOULD contain a <fieldref/> element for each field to be included in the page. To reference an x:data field, the <fieldref/> element's "var" attribute MUST be the same as the intended <field/> element's "var" attribute.

XSF Application Please fill out this form This is page one of three. Note: In accordance with the XSF privacy policy, your personal information will never be shared outside the organization in any way for any purpose; however, your name and JID may be published in the XSF membership directory. This is page two of three. We use this page to gather information about any XEPs you've worked on, as well as your mailing list activity. You do post to the mailing lists, don't you? This is page three of three. You're almost done! This is where you describe your future plans and why you think you deserve to be a member of the XMPP Standards Foundation. ]]>

Note: The preceding example partitions the fields into three pages, labeled "Personal Information", "Community Activity", and "Plans and Reasonings".

The next usage of layout is to partition pages into sections. This is done by including one or more <section/> elements within each <page/> element. Each <section/> element SHOULD possess a "label" attribute to identify the section, MAY contain a <text/> child element for additional information, and SHOULD contain a <fieldref/> element for each field to be included in the section. A <section/> element MUST contain at least one <fieldref/> element or <reportedref/> element. To reference an x:data field, the <fieldref/> element's "var" attribute MUST be the same as the intended <field/> element's "var" attribute.

XSF Application Please fill out this form
Note: In accordance with the XSF privacy policy, your personal information will never be shared outside the organization in any way for any purpose; however, your name and JID may be published in the XSF membership directory.
We use this page to gather information about any XEPs you've worked on, as well as your mailing list activity. You do post to the mailing lists, don't you?
You're almost done! This is where you describe your future plans and why you think you deserve to be a member of the XMPP Standards Foundation.
]]>

Note: The preceding example demonstrates a layout similar to the previous example, but using three sections within one page instead of three pages.

As shown in the following example, sections may be nested to produce a more granular partitioning of fields.

...
Note: In accordance with the XSF privacy policy, your personal information will never be shared outside the organization in any way for any purpose; however, your name and JID may be published in the XSF membership directory.
Who are you?
How can we contact you?
We use this page to gather information about any XEPs you've worked on, as well as your mailing list activity. You do post to the mailing lists, don't you?
This is where you describe your future plans and why you think you deserve to be a member of the XMPP Standards Foundation.
... ]]>

Note: The preceding example partitions the fields into one page and three sections, with the first section being further partitioned into two sub-sections and one free-standing field reference.

Data forms tables (the <reported/> and <item/> elements) can also be included in the layout, using the <reportedref/> element. This element MAY be included anywhere that the <fieldref/> element is allowed, but MUST NOT appear more than once.

If a <reportedref/> element is specified when no <reported/> element is included, then the reference MUST be ignored.

Form providers MAY attempt to discover if the recipient of a form supports the data forms layout protocol extension, although implementations are not required to do so. If implemented, Discovery MUST be implemened as defined in &xep0030;, using the namespace "http://jabber.org/protocol/xdata-layout" as a feature.

In order to prevent the processing from becoming too complex, there are some restrictions in how fields are distributed within the layout.

First, all displayable, modifiable fields (e.g. all except fields of type "FIXED" or "HIDDEN") SHOULD be referenced by a page or section. Any that are not referenced MAY remain unrendered, although implementations MAY provide some support for this. To include a "FIXED" field in the layout, it MUST possess a "var" attribute.

Second, the same field SHOULD NOT be referenced by more than one page or section. Additionally, a field SHOULD NOT be referenced by the same page or section more than once.

Finally, the order of layout elements SHOULD be maintained. Pages SHOULD be rendered in the order they are defined within the x:data form, and sections and fields SHOULD be rendered in the order they are defined or referenced within a page or section.

The "label" attribute of the <page/> element is RECOMMENDED (although not required). If it is missing, the renderer MAY display whatever it deems appropriate (including nothing or character data of the containing form's <title/> element).

The <text/> child element of the <page/> element is OPTIONAL. If it is missing, the renderer MAY display whatever it deems appropriate (including nothing or character data of the containing form's <instructions/> element).

The "label" attribute of the <section/> element RECOMMENDED (but not required). If it is missing, the renderer MAY use whatever it deems appropriate (including nothing).

The <text/> child element of the <section/> element is OPTIONAL. If it is missing, the renderer MAY use whatever it deems appropriate (including nothing).

This document relies on the internationalization/localization mechanisms provided by &xmppcore;. Specifically, labels and descriptions MUST be appropriate for the locale indicated by the containing stanza or <form/> element.

There are no security considerations introduced by this document.

This document requires no interaction with &IANA;.

The ®ISTRAR; includes 'http://jabber.org/protocol/xdata-layout' in its registry of protocol namespaces.

The <page/> element is the root layout element for "http://jabber.org/protocol/xdata-layout" namespace. One <page/> elements is contained within the <x xmlns='jabber:x:data'/> element for each page to be rendered. The <page/> element MAY possess an attribute that specifies a natural-language label for the page, and MAY contain child elements specifying a description, sections of the page, and field and table references.

The 'label' attribute specifies the label for this page. This attribute is OPTIONAL. Its value is any string.

The <section/> element is used to further partition the layout within a page. The <section/> element MAY possess an attribute that specifies a natural-language label for the section, and MAY contain child elements specifying a description, subsections, and field and table references.

The 'label' attribute specifies the label for this section. This attribute is OPTIONAL. Its value is any string.

The <fieldref/> element is used to situate a form field within the layout. The <fieldref/> element MUST possess a single attribute to identify the field it references, and is otherwise empty.

If a <fieldref/> element within a <page/> or <section/> references a non-existent field, then that reference MUST be ignored.

The 'var' attribute specifies the form field being referenced. This attribute is REQUIRED, and its value SHOULD be the same as the "var" attribute of one of the <field/> elements in the containing form.

The <reportedref/> element is used to situate a form "table" (as described by the <reported/< and <item/> elements) within the layout. The <reportedref/> element has no attributes or children.

The <text/> element is used to provide natural-language text that describes a page or section, provides instructions or notes about the page or section, and the like. A <page/> or <section/> element MAY contain an unbounded number of <text/> child elements. The XML character data of this element SHOULD NOT contain newlines (the \n and \r characters), and any handling of newlines (e.g., presentation in a user interface) is unspecified herein.

The protocol documented by this schema is defined in XEP-0141: http://www.xmpp.org/extensions/xep-0141.html ]]>