Page 1 of 1

[Solved] LibreOffice File format error found at SAXParse

PostPosted: Fri Jan 05, 2018 4:45 pm
by bem
Please help!

I spent the past two days working on a non-profit collaborative proposal for funding, and suddenly I've lost the last two-thirds of the document. The following error comes up:

SAXException: [word/document.xml line 2]: Namespace prefix pic on bodyPr is not defined

I am using LibreOffice Version: 5.4.3.2 (x64) and Windows 10.

I have tried to attach it, but it looks to be bigger than the 128 KiB limit.

Any help would be GREATLY appreciated.

Betsy

Re: [Solved] LibreOffice File format error found at SAXParse

PostPosted: Fri Jan 05, 2018 6:19 pm
by RoryOF
If you upload the file to a file-sharing site and post the URL here, someone will have a look and see if they can help. I remark that I have not seen that error before in a SAXException message.

Re: LibreOffice File format error found at SAXParse

PostPosted: Mon Jan 08, 2018 3:11 pm
by bem
Thank you much. I've tried a few things, including changing the file extension name, adding pic to the name of the document, etc but all without luck.

https://drive.google.com/drive/folders/ ... sp=sharing

Re: LibreOffice File format error found at SAXParse

PostPosted: Mon Jan 08, 2018 3:21 pm
by RoryOF
Both of the included documents open for me using OpenOffice 4.1.5; I've checked out the internal content and my tools indicate that their internal XML is well formed.

Re: LibreOffice File format error found at SAXParse

PostPosted: Tue Jan 09, 2018 1:36 pm
by bem
As I mentioned, I had tried various things to get the document to reopen correctly, including converting it back to ods format. The document currently has 8 pages, whereas I previously had 17 or so, so I lost a huge amount of work. On the xml document, I still get an error - see attached screen shot.

Thanks

Re: LibreOffice File format error found at SAXParse

PostPosted: Tue Jan 09, 2018 3:49 pm
by Jan_J
The screenshot is poor jpeg. I'm not able to recognize type characters.
Much better idea is to use looseless image format for shots, like png.
Second good idea is to attach images directly to the post, instead of embedding them into odt (or doc, rtf, pdf) container.

Re: LibreOffice File format error found at SAXParse

PostPosted: Tue Jan 09, 2018 4:22 pm
by bem
Sorry about that. I've attached the error screen as a png instead now.

Any hope of getting the missing pages back?

Betsy

Re: LibreOffice File format error found at SAXParse

PostPosted: Tue Jan 09, 2018 6:00 pm
by John_Ha
Try these. I opened both with AOO and saved as .odt files. AOO seems to be able to cope with the error, and presumably does not write the error back in the saved .odt.

 Edit: AOO does not "cope with the error".

Experience with this and similar files has shown that all the user content before the error is displayed OK.

However, all the user content following the error, even well formed content, is not displayed even though it is still present in the document.xml file. If the corrupted .docx file is then saved, all the non-displayed user text is deleted and can never be recovered.

I think that LO used not to be able to open files with these errors but recent versions of LO do what AOO does, namely open the file, report the error, and display everything up to the error. 

Re: LibreOffice File format error found at SAXParse

PostPosted: Tue Jan 09, 2018 9:29 pm
by bem
Your assistance is greatly appreciated. However, I am still missing a big chunk of the second half (plus) of the document. The docx document you resent does show almost another page that was otherwise gone. There are nearly 10 more pages missing still however. Is that the best that can be done, or is there still any hope of recovery?

Thanks,
Betsy

Re: LibreOffice File format error found at SAXParse

PostPosted: Tue Jan 09, 2018 9:33 pm
by RoryOF
I don'y know if this has happened, but I post it as a general warning to others with a similar problem: if you get a SaxParse or other error when trying to open a file, You must not save over the damaged file. Doing so will overwrite the original file with (perhaps) a truncated version of the file. The damaged original file is the file we need to inspect, and hopefully, will be able to repair.

Re: LibreOffice File format error found at SAXParse

PostPosted: Tue Jan 09, 2018 9:50 pm
by acknak
See if this one works for you; it has 23 pages when I load it in LibO.

Re: LibreOffice File format error found at SAXParse

PostPosted: Wed Jan 10, 2018 12:57 am
by John_Ha
All the document text and all the comment text from the 186 kB file you uploaded.

If that still doesn't work see [Tutorial] How to find and un-delete Writer temporary files for

a) detailed instructions on how to recover your file as it was when you last opened or saved it, or as it was when it was last saved with AutoRecovery.
b) how to find previous versions of the file in the folder it is located in, but which have since been deleted.
c) how to un-delete the temporary files Writer wrote while you were editing the file, and then deleted. This will recover your file as it was when you last opened or you last saved it and is probably your best hope.

Re: LibreOffice File format error found at SAXParse

PostPosted: Wed Jan 10, 2018 6:58 am
by bem
You're a star - the document is back in its entirety!

Many many thanks. I'll be much more careful with saving as odt unless absolutely necessary.

Betsy

Re: LibreOffice File format error found at SAXParse

PostPosted: Wed Jan 10, 2018 1:24 pm
by John_Ha
bem wrote:Many many thanks. I'll be much more careful with saving as odt unless absolutely necessary.

You are almost there :-)

Always save as a .odt file. If you need to send someone a .doc create a separate copy. That way, if the .doc is corrupted you still have the good, correct .odt file.