XForms - Extensions


Most of the documentation relative to Orbeon Forms XForms extensions is available on these pages:

Using XForms extensions

  • We love standards – At Orbeon, we recommend you use standards, like XForms, whenever it is possible and reasonable to do so. This is the approach we took (and still take today) designing Orbeon Forms, and implementing XForms. Basing your code on standards has many benefits, including:

    • Standards are more stable; what happens to your code built on the hot technology of the day if that technology isn't hot anymore 5 or 10 years from now?
    • Standards like XForms are well-thought; they are based on the input from many companies who bring their experience to the table; they have been reviewed by many eyes.
    • Standards are implemented by multiple organizations, in particular there are several implementation of XForms, and basing your code on a standard leaves the door open for you to switch to another implementation in the future.
    • Standards, in particular from the W3C, build on each other, so the XForms you learn can be useful to you in future projects, even if they don't directly use XForms. For instance, XForms uses elements of XPath, XML events, and XML Schema.

  • Extension are clearly indicated in Orbeon Forms – Because we think it is important for you to know when you are using a feature which is standard vs. an extension, we do our best to clearly indicate what is an extension.

    • XForms extensions – You will often see the prefix xxforms used for XPath functions, events, elements, and attributes that are not defined in the XForms specification, but are implemented as extensions in the Orbeon Forms XForms engine.
    • "Library" code – You will often see the prefix fr used for events, elements, and attributes that are built on top of the platform and shipped in Orbeon Forms. Those constructs are not extensions, but rather more like a library built using standard technologies like XForms, XSLT, and XBL.

  • Making extensions part of the standard – Orbeon is active at the W3C XForms working group (WG). Having an extensions that are implemented in a shipping XForms implementations helps us make the case that the extension is worthwhile, that it is being used, and that it should be included in the specification. What is considered to be an extension today, might become part of the standard tomorrow.

  • When to use extensions – In our experience, it is not possible to create a full-fledged form application of some complexity without using extensions. However we recommend you use extensions as sporadically as possible: consider the alternatives, and only use the extension when it provides a clear benefit. When considering alternatives, ask yourself if the alternative is based on a standard, or if it is just another product (in which case it isn't any more standard-compliant than an extension). For instance:

    • When to use the Page Flow Controller (PFC)? In its simplest form, the PFC provides a way to map a path on the URL to a given XForms file. Doing this is outside the scope of the XForms specification. You can do much more in the PFC, such as implementing page flow logic (e.g. where to go next after users submit information for a form depending on the information they entered). The PFC does not implement a standard. And the situation is the same for alternatives to the PFC such as Struts or Spring. We recommend you keep as much of the page flow logic in the XForms code, and use the PFC (or its alternatives) solely as a way to map paths to XForms files.
    • XForms does not yet provide a standard way to implement dialogs. Orbeon Forms offers the xxforms:dialog component. If your application calls for a dialog, you could choose not to use the xxforms:dialog, and instead to use a dialog such as those provided in libraries such as YUI or Dojo. But those libraries do not implement a standard, so you wouldn't be gaining anything by using such a JavaScript library instead of the xxforms:dialog. Rather, it would be a loss, as JavaScript code is harder to code, maintain, and needs to be tested and ported for different browsers. We recommend you use an xxforms:dialog instead of writing your own JavaScript calling a JavaScript library.