[Solved] Read-error .ods (sub-document context.xml)

Discuss setup / installation issues - Add a spell checker, Language pack?
Post Reply
gaknutson
Posts: 4
Joined: Fri Nov 04, 2016 10:05 pm

[Solved] Read-error .ods (sub-document context.xml)

Post by gaknutson »

I came back from a weekend to find my computer had crashed. OO was able to recover four other .ods files, but not one. I get the error message, "Read-error Format error discovered in the sub-document context.xml at 2,8751519

Interestingly, perhaps not pertinent, is that when I right click the file for Properties, then Details, under Description, I see a title was added to the file (no other .ods files that loaded have a title). Weirdly, the title added was the title from an email. Also... despite the fact that I save every file to a second hard drive every week, the saved file also will not load up (same error message).

The file is 512Kb, and contains info that is pretty important to my business. I would appreciate any help!

Thanks -

DrK
Last edited by Hagar Delest on Wed Nov 09, 2016 2:32 pm, edited 1 time in total.
Reason: tagged [Solved].
Open Office V4.1.3
Win7
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Read-error .ods

Post by RoryOF »

Open the file using an archive utility (7-zip, winzip?) and examine the internal xml files using an xml editor. You will need to remove any xml tokens flagged as being in error and then rebuild the archive that is the .ods file. Such tokens are usually in content.xml; you can ignore the other .xml files.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
gaknutson
Posts: 4
Joined: Fri Nov 04, 2016 10:05 pm

Re: Read-error .ods

Post by gaknutson »

Thanks -

I didn't have an xml editor, so downloaded xmlNotepad. When I tried to open the content.xml file, I got this message:

Error loading C:... content.xml '<' [the < looks like a backward arrowhead] hexadecimal value 0x11, is an invalid character. Line 2, position 8751520. Would you like to open it using Notepad?

I don't know what this means... again, in the message, the '<' is a solid triangle.

Thanks
Open Office V4.1.3
Win7
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Read-error .ods

Post by RoryOF »

As XMLNotepad does not run on my computers I cannot tell what the left black triangle means. I normally use XML CopyEditor; you have to go to Line 2, position 8751520, analyse what you see near there, then (praying fervently) delete what you think is the incorrect character or token. After this you rebuild the file archive.
 Edit: If worse comes to worst, this method may extract the text for you
Simply follow these steps:

Open your XML file with Notepad++
Select all text
Use this menu: TextFX -> TextFX Convert -> Strip HTLM tags table tabs/nontabs
I haven't tried it; if you must use it, please use on a copy file. 
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Read-error .ods

Post by acknak »

If you need help, we'll need to see a copy of the file: either upload it to a file-sharing site and leave a link here, or send it privately by email (icon/button at right).
AOO4/LO5 • Linux • Fedora 23
gaknutson
Posts: 4
Joined: Fri Nov 04, 2016 10:05 pm

Re: Read-error .ods

Post by gaknutson »

Found the problem using XLM copy editor. Fixed with minimal loss of data (the error probably happened when the file was being saved as the electricity went down). Thanks so much for the help.

DrK
Open Office V4.1.3
Win7
Post Reply