EMC Documentum XForms engine overview


XForms is an XML format for the specification of user interfaces and data processing models for XML data. It was designed to be the next generation of web based forms.


The EMC Documentum XForms Engine (codenamed Formula) started out as an implementation of the XForms 1.0 specification, which is a W3C recommendation since 14 October 2003.  However, because the XForms 1.1 specification is much more detailed and specific, the decision was made to focus more on that set of requirements instead.


Software developers who need to support robust client-side forms handling in their products can download the latest version of the XForms Engine from this community. A version of this engine is included in EMC Documentum Dynamic Delivery Services (DDS).



The Formula XForms engine is a pure client-side implementation that runs from within a web browser. It is a Google Web Toolkit (GWT) application, which means that the program code is written completely in Java and this code is converted into JavaScript by the GWT compiler so it can run inside a browser.


Why this approach? With a generic web browser as a target platform, client-side components must be based on HTML and JavaScript. So either the engine needs to be split up into a client-side and a server-side part, or the engine needs to be entirely written in JavaScript. The Google Web Toolkit enables developers to create and maintain relatively large applications easily using Java and common development tools. Although there is a penalty to emulating the Java in JavaScript, GWT also offers speed advantages as a result of compiler optimizations.


Another reason for choosing this architecture is the fact that the resulting application is completely self contained. This application can be offered both as a pure JavaScript solution and as a component for integration into other GWT based applications. Also, scalability is improved because the complete processing is done on the client side. In addition, network latency is reduced to a minimum, which improves overall responsiveness of dynamic forms.



The resulting JavaScript which needs to be downloaded to the web browser is about 600 KB in size. However, almost all modern browsers and server platforms support compression of HTTP responses. This means that the (compressed) script that actually needs to be sent to the client will be only about 175 KB. Also, because of the GWT caching mechanism, the JavaScript file can be cached permanently by the browser, as long as there are no updates to the code.


While there is a bigger initial cost when starting the XForms engine for the first time, it can then render any (compliant) XForms document without modification. This means that only the XForms documents need to be sent over to the client.



Because XForms makes extensive use of XPath expressions to define behavior, performance of this evaluation is important. For example, if a new XML element is inserted into the data, all expressions need to be re-evaluated to ensure that the form is displayed correctly. These statements can rely on a specific context XML node within the data and therefore often need to be evaluated for each node that is referenced.


Performance of the XForms Engine will not become an issue when using a web browser with a fast JavaScript engine, such as Mozilla Firefox, Google Chrome or Safari. These JavaScript engines use advanced techniques like compiling JavaScript to native machine code before running it. However, Internet Explorer, the most commonly used browser, contains a significantly slower JavaScript engine. This is why optimization of large, dynamic forms may be required to achieve the desired responsiveness in Internet Explorer. For example, XPath expressions that locate XML nodes by id can be evaluated much more quickly than those that need to traverse all of the nodes and do a name comparison on each of them.



The XForms engine aims to be fully compliant with XForms 1.1 while supporting as many constructions of the XForms 1.0 specification as possible. Support for Documentum-specific extensions is built on top of the standards compliant engine. This optional functionality is implemented completely separately, so as not to interfere when standards compliant behavior is desired. The Documentum-specific extensions include the addition of a document that specifies the layout and property files which provide internationalized texts.


Free download


The XForms engine is now available for free download for developers: XForms Engine.  That page also contains a link to a great demo site containing multiple form examples with code that you can copy.  You're also invited to post your own samples to the site.