A Cautionary Tale

One way to try to fix a broken OpenOffice (Beta) presentation file

An OpenOffice.org user initially running a copy of OO.org 2.0 Beta, and then reverting to OO.org 1.4, was working on an Impress presentation. After a substantial amount of work had been done, our user had saved the newly modified file one evening as usual - no problems. System was shut down and the next day he started the computer to continue -

Big problem - file would not load into Impress! Instead, an error message was displayed which read something like this -

	Error Loading Document /home/fred/Documents/presentation.sxi
	Read Error
	Format error discovered in the file subdocument content.xml at
	2,83125(row,col)

This is how we tackled the problem - there are probably better ways to proceed but we were able to rescue the file intact using commonly available Linux software.

Now, OpenOffice.org (OOo) files are essentially zip archives, and thus we can use the KDE archiver, ark, to extract content.xml from the OOo file, and then rename it as content-bad.xml. It's a good idea to work on a copy of the original faulty OOo file, as you can start again if you really mess it up!

We can now use Firefox to try to read content-bad.xml - and it comes up with an error message which gives a little more information on the problem. In this case, the error message was "duplicate attributes", with the same row and column numbers as before.

As an XML file is basically plain text, we can use a text editor (for example, nedit) to read content-bad.xml - and put the cursor at row,col suggested by the previous error messages to see if we can spot the problem. This can be the tricky bit, especially if you are not especially literate in XML. However, by trying various edits and checking the result in Firefox, we were eventually able to get Firefox to read the modified content-bad.xml

At this point, Firefox displayed a whole heap of XML code, with a heading that read


This XML file does not appear to have any style information associated with it. The document tree is shown below.

If you get this displayed, the probability is that you have at least partially fixed the problem.

Now make a copy of content-bad.xml, and rename it content.xml. Use ark to delete the original content.xml within the OOo file, and replace it by the newly edited version. Now, with a little luck, you should be able to read the modified OOo file using OpenOffice.org Impress.

The various tools used here, namely ark, firefox and nedit, can be replaced by other similar tools which will give usefull results. For example, someone with good XML knowledge will probably choose to use a specialist XML editor, which may well be more reliable and/or accurate in pinpointing any XML errors.

The caution that this little episode suggests, particularly when using beta software, is -


© David T. Hatton 2006 Last Modified: 10-Mar-2006
This page may be reproduced unchanged provided this copyright notice is included.