[Solved] Format error not allowing me to open .odt file

Discuss setup / installation issues - Add a spell checker, Language pack?
Post Reply
ACW100
Posts: 3
Joined: Mon Feb 18, 2019 3:28 pm

[Solved] Format error not allowing me to open .odt file

Post by ACW100 »

Hello,

I recently sent my manuscript to an editor who did comments and track changes on it. She was using word so sent the doc back in both word and .odt. I opened her .odt document and saw all the comments perfectly. I saved the document as a save as and new name.odt and then made my changes whilst still leaving the editor's comments.

I also made a backup of the same nesly named file.

Now that I come to reopen the file to continue working on it I get the following message:

Format error discovered in the file in sub-document content.xml at 2,3737(row,col)


I have read the forums and it seems I need to open the .xml file but I can't find this. Can anyone help with a step by step solution.


Many thanks in advance!

Amanda
Last edited by Hagar Delest on Tue Feb 19, 2019 9:33 am, edited 1 time in total.
Reason: tagged solved
Apache Open Office 4.1.3
Windows 7
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Format error not allowing me to open .odt file

Post by RoryOF »

You should open the .odt file with an archiver application. If you rename (at Windows system level) to .zip, double clicking this will cause the system archiver to open it for you.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Format error not allowing me to open .odt file

Post by FJCC »

There is a tutorial here: Format Error in Sub-Document
If you get stuck, you can post the document here or email it to a volunteer.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
ACW100
Posts: 3
Joined: Mon Feb 18, 2019 3:28 pm

Re: Format error not allowing me to open .odt file

Post by ACW100 »

Thank you very much. I'll look at that this evening when my son is in bed. :-) I did try to attach my doc but it said it was too big. If I have problems do you know if it's possible to put a drop box link instead?
Apache Open Office 4.1.3
Windows 7
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Format error not allowing me to open .odt file

Post by FJCC »

Yes, you can use dropbox. Be sure to set the permission so we can download it.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Format error not allowing me to open .odt file

Post by John_Ha »

I have undertaken some analysis of errors of this kind and some time ago created a bug report for it, namely Issue 127745 - Read Error: Format error discovered ... at n,nnnn (row,col).

I have conducted some more tests and I have now come to the following conclusions:

1. The error arises when an AOO user sends a .odt file to a person who uses MS Word to add edits and comments to the file using Edit > Changes.

2. I am not sure how the corruption happens. Does MS Word corrupt the original .odt file and return a corrupted file to the AOO user? Or does MS Word not corrupt the file, but AOO cannot handle what MS Word sends back, and AOO corrupts the file?

3. If I correct a corrupted file by deleting the repeated attributes I then get different behaviours with AOO and LO:

When AOO saves the corrected file under another name, AOO corrupts the corrected file. Hence the corruption is now introduced by AOO.

When LO saves the corrected file under another name, LO does not corrupt the file.

@ACW100

It would be a great help if you could send me the file exactly as you received from the reviewer and before you opened it. I expect you received the file by email so would it be possible for you to forward that email to me? Or ask the reviewer to send the file to me? I need to see the file after it has been edited and saved by MS Word but before you open it with AOO. I have sent you an email and a Message with my email ID.

After I analyse the file I hope to be in a position to give a recommendation for how to avoid errors of this kind in the future.

Many thanks.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
ACW100
Posts: 3
Joined: Mon Feb 18, 2019 3:28 pm

Re: Format error not allowing me to open .odt file

Post by ACW100 »

Thank you so much. I have just been through the guide to fix the problem and it looks like most of my work is back - Thanks again :-) :D

John, I have sent you the files.
All the very best, Amanda
Apache Open Office 4.1.3
Windows 7
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Format error not allowing me to open .odt file

Post by John_Ha »

Amanda sent me the files and I am now somewhat more confused than I was before :crazy: as this is not the usual "Format error" problem I am used to seeing.

Amanda sent a .odt file to her reviewer who used MS Word to add comments to the document, saved the result as a .odt file, and sent the .odt file back to Amanda. Amanda opened the file, did some edits and the file then failed causing Amanda to open this thread.

I first extracted content.xml from the original file file and examined it. I checked the XML syntax with NotePad ++ and it flagged a syntax error at line 57,973 saying "xml:id : attribute value 537240310 is not an NCName".
Syntax error message
Syntax error message
I cannot see what is wrong with it. It is the 115th annotation in the file which is also the last annotation in the file. It is a comment which is attached to a range of text although, in this case, the range is a single full stop. The two images below are annotation 114, which is valid; and annotation 115, which throws up the error.
Annotation 114 - does not throw up error message
Annotation 114 - does not throw up error message
Annotation 115 - throws up error message
Annotation 115 - throws up error message
The actual XML for the two annotations is as below.

Code: Select all

					<office:annotation office:name="114" xml:id="537240082">
						<dc:creator>Victoria Cleave</dc:creator>
						<dc:date>2019-02-06T18:12:00</dc:date>
						<text:p text:style-name="CommentText">When did Lennie start wearing the ring – she’d kept it in the box as she said he hadn’t officially asked her.</text:p>
					</office:annotation>Lennie now wore</text:span>
				<text:span text:style-name="T12673">
					<office:annotation-end office:name="114"/>
					
.....					

					<office:annotation office:name="115" xml:id="537240310">
						<dc:creator>Victoria Cleave</dc:creator>
						<dc:date>2019-02-06T18:16:00</dc:date>
						<text:p text:style-name="CommentText">Is this framed as a question?</text:p>
					</office:annotation>.</text:span>
				<text:span text:style-name="T12710">
					<office:annotation-end office:name="115"/>					
My knowledge of XML is minimal. Any ideas anyone? It does not look a 2^n problem as the two numbers, in binary, are

Code: Select all

10 0000 0000 0101 1010 0010 0001 0010 >>> 537240082
10 0000 0000 0101 1010 0010 1111 0110 >>> 537240310
The .odt file opened happily with both AOO and LO.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Post Reply