Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Getting Started with XForms in OpenOffice

Discover how to design and customize XForms in OpenOffice.


advertisement
ost developers have heard of XForms as an XML-based forms language meant to replace traditional HTML Forms. This is essentially correct; XForms was created as the next generation version of HTML forms—but the design goals are such that they can be implemented as forms in environments other than the web browser. One such environment is your typical office application. XForms is implemented as one possible method of doing forms-based applications in OpenOffice or Sun's StarOffice.

The XForm discussed in this article has been tested on both a Microsoft Windows XP installation, and a Xandros Linux installation. Note that the file URI for output submission was adapted for each operating system's specific file paths.

What You Need
This article gives a quick overview of how to design an OpenOffice form as an end-user, and provides the syntax for making an OpenOffice XForm match a required XML output format. The article assumes that readers have at least a simple knowledge of XML, XPath, and XML Schema. To follow along or use the downloadable code, you should have OpenOffice version 2.4 or higher installed.

Choosing an XML Format
You need an XML format for the form. The example discussed here uses a Danish governmental format that represents the data for a single postal address (only the address, not such extraneous information as the identity of whoever resides there) with additional constructs specific to Denmark. This format makes a decent example because it is simple enough to be comprehensible, yet real-world enough to be potentially useful.

The XKOM (for XML Kommittee) AddressPostal format defines a single complex element named AddressPostal that holds a sequence of 11 simple elements, only some of which are required. An instance document has up to four possible namespaces. Here's an example used throughout this article that contains three of those namespaces and the five required elements:

<xkom:AddressPostal xmlns:xkom= "http://rep.oio.dk/xkom.dk/xml/schemas/2006/01/06/" xmlns:dkcc= "http://rep.oio.dk/ebxml/xml/schemas/dkcc/2003/02/13/" xmlns:dkcc2005= "http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/" > <dkcc2005:StreetName> Nærum Hovedgade</dkcc2005:StreetName> <dkcc:StreetBuildingIdentifier> 10</dkcc:StreetBuildingIdentifier> <dkcc2005:PostCodeIdentifier> 2850</dkcc2005:PostCodeIdentifier> <dkcc2005:DistrictName> Nærum</dkcc2005:DistrictName> </xkom:AddressPostal>



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap