XForms At A Glance

T. V. Raman
IBM Research
tvraman@us.ibm.com

May 13, 2003

XForms Implementations



Implementation Description






X-Smiles Open Source XML browser from HUT, Finland.


FormsPlayer XForms plug-in for IE


Novell XForms Stand-alone XForms Java client


IBM AlphaworksXForms on the server and client




XForms Features At A Glance

Declarative
Declarative XForms are easier to maintain.
Strong typing
Submitted data can be checked using off-the-shelf XML tools.
Schema re-use
XForms enables the re-use of business rules.
Schema augmentation
Enables creation of dynamic interaction.
XML submission
Obviates custom server-side logic to marshal data.
Internationalization
Using XML 1.0 makes the submitted data I18N ready.
Accessibility
User interface controls are designed for accessibility.
Device independence
Abstract user interface controls lead to intent-based authoring.
Localization
Labels and help text can be referenced via URIs.
Actions
Declarative actions obviate common uses of scripting.

XForms Components



ComponentDescription






Model
  • Encapsulate all data aspects of a form.
  • Uses XML Schema to define constraints.
  • Uses XPath to define model properties.
  • Captures what, how and where to submit.



Properties
  • Model properties capture application constraints.
  • Enable reactive user interfaces.
  • Encourage declarative authoring in place of scripts.



UI Binding
  • Connects user interface to the model.
  • Uses XPath to address nodes in the instance.



Controls
  • UI controls collect user input.
  • Bind to underlying model.
  • Encapsulate all relevant metadata.
  • Controls are designed for accessibility.
  • Abstract controls encourage device independence.



UI
  • UI constructs aggregate user interface controls.
  • Encourage intent-based authoring.
  • Create dynamic user interaction.



Events
  • Eventing brings a user interface to life.
  • XML Events gives access to DOM2 eventing.
  • Extensible means of attaching dynamic behavior.





Table 1: XForms at a glance.

XML Standards



Standard Role in XForms






XML
  • Encapsulate structured instance data.
  • XML DOM forms underlying model.
  • Serialized instance data is I18N ready.



Namespaces
  • Partition space of element and attribute names.
  • Enable different XML vocabularies to co-exist.
  • Used to create modular XForms applications.
  • Key to integrating XForms into XML host languages.



Schema
  • Enable object-oriented descriptions of XML.
  • Rich set of data types.
  • Enables off-the-shelf validation.
  • Used to capture static constraints in the model.



XPath
  • Locators address portions of an XML instance.
  • Locators used to bind controls to the model.
  • Locators used to bind model properties.
  • XPath is a side-effect free expression language.
  • Express dynamic properties within XForms.



DOM2
  • Cross-platform API for eventing.
  • Used to attach behavior.
  • Enables hosting XForms processors in a browser.



XML Events
  • XML access to DOM2 Events.
  • Defines common XML markup for eventing.
  • Used to attach event handlers in XForms documents.
  • Declarative authoring in place of scripting.





Table 2: XML standards at a glance.

XForms User Interface Controls



Control Description






input Generic input control.


secret Password entry


textarea Multi-line text entry


select Select from a set


select1 Exclusive select from set


range Pick from range of values


upload Upload data


trigger Activate command


submit Trigger submission




Table 3: XForms controls at a glance.

XForms User Interface



ConstructPurpose






group
  • Group related controls to ease refactoring.
  • Enable structured navigation.
  • Factor common parts of binding expressions.



switch
  • Enable conditional user interfaces.
  • Enable interaction-based switching.
  • Create user interface wizards and multi-page tab dialogs.
  • Progressively reveal complex user interfaces.



repeat
  • Iterate over collections.
  • Create user interfaces that grow or shrink as needed.
  • Enable creation and maintenance of hierarchical content.





Table 4: XForms user interface at a glance.

XForms Model Properties



PropertyDescription






relevant
  • Model-based switching for conditional interfaces.
  • Dynamically revealing appropriate portions of an interface.
  • enabling controls based on state of instance data.



required
  • Conditionally make fields required.



readonly
  • Conditional editing of data.
  • Dynamic user interaction based on instance values.



constraint
  • Refine static schema constraints.
  • Constrain values based on previous user interaction.
  • Express cardinality constraints on node-sets.



calculate
  • Computational dependency among instance nodes.
  • Automatically compute fields based on user input.
  • Enable spread-sheet like functionality within XForms.



type
  • Extend schema type definitions.
  • Useful when schema cannot be modified.



p3ptype
  • Hold P3P type information.
  • Enables users manage their personal data.





Table 5: XForms model properties at a glance.

XForms Functions





Function Arguments Returns Description












avg node-set number Average




boolean-from-string string boolean Type conversion




count-non-empty node-set number count non-empty




days-from-date string number Days in epoch




if boolean, string, string string conditional




index string number Repeat index




instance string node-set Locate instance




max node-set number Maximum




min node-set number Minimum




months string number Months in period




now string Current time




property string string Feature value




seconds string number Seconds in period




seconds-from-dateTime string number Seconds in epoch








Table 6: XForms functions at a glance.

XForms Actions



Action Description






setfocus Move focus


setvalue Assign value


load Load URI


send Initiate submission


reset Clear form


message Display message


action Group handlers


dispatch Send event


rebuild Rebuild dependencies


recalculate Recompute values


revalidate Revalidate all values


refresh Update user interface


insert Insert node


delete Delete node


setindex Scroll repeat




Table 7: XForms actions at a glance.

XForms Events

Initialization Events
Processing Events
Interaction Events
Notification Events
Error Notifications




Event CancelBubbles Target
















xforms-model-construct N Y model




xforms-model-construct-done N Y model




xforms-ready N Y model




xforms-model-destruct N N model








xforms-rebuild Y Y model




xforms-recalculate Y Y model




xforms-revalidate Y Y model




xforms-refresh Y Y model








xforms-previous Y N control




xforms-next Y N control




xforms-focus Y N control




xforms-help Y Y control




xforms-hint Y Y control




xforms-reset Y Y model




xforms-submit Y Y submission




DOMActivate Y Y control








DOMFocusIn N Y control




DOMFocusOut N Y control




xforms-value-changing N Y control




xforms-value-changed N Y control




xforms-select N Y item or case




xforms-deselect N Y item or case




xforms-scroll-first N Y repeat




xforms-scroll-last N Y repeat




xforms-insert N Y instance




xforms-delete N Y instance




xforms-valid N Y control




xforms-invalid N Y control




xforms-in-range N Y control




xforms-out-of-range N Y control




xforms-readonly N Y control




xforms-readwrite N Y control




xforms-required N Y control




xforms-optional N Y control




xforms-enabled N Y control




xforms-disabled N Y control




xforms-submit-done N Y submission




xforms-submit-error N Y model








xforms-binding-exception N Y bind




xforms-link-exception N Y model




xforms-link-error N Y model




xforms-compute-exception N Y model








Table 8: XForms events at a glance.

Web Services



XFormsWeb Services






model
  • Collect data as XML.
  • Serialize request as XML.
  • Receive response as structured XML.



Bind
  • Connect distributed services.
  • Connect user interfaces to actual data.
  • Enable aggregation of information services.



UI
  • Connect users to their information.
  • Enable ubiquitous information access.
  • Enable delivery to multiple devices.
  • Enable multimodal, mobile Web services.



submit
  • Serialize data as valid SOAP messages.
  • Smart forms enable automatic data import and export.





Table 9: Web services at a glance.

Multimodal Interaction



XFormsMultimodal Interaction






model
  • Hold interaction state.
  • Support multi-device access.
  • Enable synchronized views.



Bind
  • Connect multiple interaction modalities.
  • Connect user interfaces to data.



UI
  • Enable late binding of user interaction.
  • Enable ubiquitous information access.
  • Enable delivery to multiple devices.
  • Enable multimodal, mobile user experience.





Table 10: XForms and multimodal interaction.

Accessibility



XFormsAccessibility






Model
  • Factors non-presentational aspects.
  • Central point for hooking custom behavior.



Controls
  • Designed for accessibility.
  • Encapsulate all relevant metadata.
  • Exhibit predictable behavior.
  • Enable consistent navigation.



UI
  • Aggregation constructs encourage intent-based authoring.
  • Create content that enables refactoring.
  • Complex interfaces can be progressively revealed.



Events
  • Flexible eventing framework.
  • Can attach custom behaviors.





Table 11: XForms accessibility at a glance.