Create import and output filters to edit your XML as rich text
Level: Intermediate
Jonathan Levin , Trainer and consultant, Freelance
09 Oct 2007
Updated 11 Jan 2008
Register now or sign in using your IBM ID and password.
You might know that you can pull XML data into OpenOffice's spreadsheet program, Calc, but did you know that you can create a filter to make word-processing documents out of data stored as XML? This tutorial shows you how to use OpenOffice's import/export filters to open your XML data as though it's just a plain document. From there, users can edit the document much more naturally and then save it back to its native format. You can also use this feature to easily turn your documents into XML data.
In this tutorial
This tutorial is for users of OpenOffice, with a penchant for XML. If you're comfortable with the rigid syntax of the XML file format, and have dabbled with XML Style Language Transformations (XSLT), a world of possibilities opens up when you use OpenOffice as a custom editor for any type of XML-based data. This tutorial demonstrates the power of XSLT harnessed for the automatic manipulation and transformation of any XML-based data to and from the OpenDocument format, thereby bridging the divide between machine-readable XML and human-friendly hypertext.
OpenOffice evolved from yet another open source product to a full fledged suite of efficient and secure office applications—free and highly extensible—gaining more clout along the way from industry giants such as Sun Microsystems and, recently, IBM.
This tutorial focuses on a single facet of OpenOffice's extensibility, working with XML and XSLT filter files to allow plugin support for any data in the XML form. You can store data as machine-friendly XML and still edit it in a human-friendly, custom manner. The former allows easy searches, semantic context and information retrieval, whereas the latter enables efficient editing in an advanced hypertext environment.
The tutorial explains how OpenOffice interacts with XML, through the OpenDocument format. It then walks through building an import filter (required for input file loading) and export filter (required for output file saving).
Objectives
- Review a brief primer of the XML document format in OpenDocument.
- Create and install an import filter based on XSLT stylesheets.
- Create and install an export filter based on XSLT stylesheets
Prerequisites
You'll need the following tools to follow along with this tutorial: