 | Level: Intermediate Jonathan Levin , Trainer and consultant, Freelance
09 Oct 2007 Updated 11 Jan 2008 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:
-
OpenOffice, version 2.0 or above. These
examples were created and demonstrated with the latest version of OpenOffice 2.2. Since then, due to an important and recommended security patch for mishandling of the TIFF file format, version 2.3 has come out, and everything in this tutorial was tested and works with version 2.3 as well.
- Your favorite XML editor is required to edit XML and XSLT files. The author uses vim
on UNIX®, and Notepad on Windows®.
System requirements
You will need JavaScript enabled in your browser. All functionality is available online.
Duration
2 hours
Formats html, pdf
|  | |  |