[Solved] Format error discovered in the file in sub-document

Discuss the spreadsheet application

[Solved] Format error discovered in the file in sub-document

Postby nph2011 » Fri Jan 14, 2011 11:21 am

I have an error in an OpenDocument calc spreadsheet that prevents me from opening it:

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

I have tried unzipping to remove the style section of tags in the content.xml file, and re-zipping back to a .ods file to no avail.

Please can anybody help? I have attached the spreadsheet.
Attachments
Guitar_Lessons.ods
(19.25 KiB) Downloaded 891 times
Last edited by Hagar Delest on Fri Jan 14, 2011 1:43 pm, edited 1 time in total.
Reason: tagged [Solved].
nph2011
 
Posts: 4
Joined: Fri Jan 14, 2011 11:13 am

Re: Format error discovered in the file in sub-document

Postby JohnSUN-Pensioner » Fri Jan 14, 2011 1:27 pm

Something like that? There really was a mistake: instead of "type" was "tupe"...
Attachments
Guitar_Lessons_recover.ods
Changed one byte in line 2, in position 141 422
(18.18 KiB) Downloaded 1265 times
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.4, LibreOffice 5.4.2.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
User avatar
JohnSUN-Pensioner
Volunteer
 
Posts: 761
Joined: Fri Jan 14, 2011 1:21 pm
Location: Kyiv, Ukraine

Re: Format error discovered in the file in sub-document

Postby nph2011 » Fri Jan 14, 2011 1:41 pm

That's wonderful! Thankyou ever so much JohnSUN-Pensioner. :bravo: :D

You have saved me an awful lot of work in updating a much older file that I had saved as a backup. After unzipping the faulty spreadsheet and using Microsoft Wordpad as a text editor, I had no easy way of counting 141422 characters along the second line in order to check it.

May I ask, did you use some type of XML parser, or did you have a text editor with line and character numbering available?
OpenOffice.org 3.2.1
Windows XP Pro SP3 5.1.2600 Build 2600
nph2011
 
Posts: 4
Joined: Fri Jan 14, 2011 11:13 am

Re: Format error discovered in the file in sub-document

Postby Hagar Delest » Fri Jan 14, 2011 1:43 pm

AOO 4.1.7 on Xubuntu 19.10 and 4.1.5 on Windows 10 (with winPenPack port).
User avatar
Hagar Delest
Moderator
 
Posts: 28681
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Solved] Format error discovered in the file in sub-docu

Postby nph2011 » Fri Jan 14, 2011 1:50 pm

Thanks for replying Hagar de l'Est. I did actually read that thread and I had tried that method before posting on the forum. Unfortunately a similar error occurred when I rebuilt the .ods file by re-zipping the edited content.xml file together with the other previously extracted files. I'm now on the search for a simple text aditor with line/character numbering, so if it happens in future I can fix it myself.
OpenOffice.org 3.2.1
Windows XP Pro SP3 5.1.2600 Build 2600
nph2011
 
Posts: 4
Joined: Fri Jan 14, 2011 11:13 am

Re: Format error discovered in the file in sub-document

Postby JohnSUN-Pensioner » Fri Jan 14, 2011 1:53 pm

nph2011 wrote:...did you have a text editor with line and character numbering available?

Exactly ;) This time I took EditPad Pro
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.4, LibreOffice 5.4.2.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
User avatar
JohnSUN-Pensioner
Volunteer
 
Posts: 761
Joined: Fri Jan 14, 2011 1:21 pm
Location: Kyiv, Ukraine

Re: [Solved] Format error discovered in the file in sub-docu

Postby nph2011 » Fri Jan 14, 2011 2:02 pm

Now that I think about this, I have a linux operating system on CD-ROM that is bootable lying around the house somewhere. I suppose I can use the native "vi" editor and determine the character location with <number><pipe> using that in future.

Thanks again for your help, you've made what looked like it was going to be a miserable day, very bright (even though it's cold and rainly).
OpenOffice.org 3.2.1
Windows XP Pro SP3 5.1.2600 Build 2600
nph2011
 
Posts: 4
Joined: Fri Jan 14, 2011 11:13 am

Re: [Solved] Format error discovered in the file in sub-docu

Postby Hagar Delest » Fri Jan 14, 2011 2:54 pm

XMLCopy Editor is quite good under GNU/Linux IIRC.
AOO 4.1.7 on Xubuntu 19.10 and 4.1.5 on Windows 10 (with winPenPack port).
User avatar
Hagar Delest
Moderator
 
Posts: 28681
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Solved] Format error discovered in the file in sub-docu

Postby fst » Fri Jan 14, 2011 9:32 pm

Hi,

for future use just untag 'Size Optimization for ODF Format'.
This will make the xml files in the container pretty printed and not only a single long line.
The size will not increase so much and the advantage of a readable IMHO is better than the difference of a few bytes.

The setting can be found under Tools-Options-Load/Save-General

Frank
Frank

If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
fst
Volunteer
 
Posts: 152
Joined: Wed Nov 28, 2007 2:31 pm

Re: [Solved] Format error discovered in the file in sub-docu

Postby aspsak » Thu Sep 18, 2014 3:19 pm

I have faced the same problem and I solved below ways.
Step 1: open file_name.ods file in notepad++ then save as file_name.zip
Step 2: open the file_name.zip using winrar (not extract) , from this I can seeing the content.xml file.
Step 3: open the content.xml (by default xml file using in notepad++ app) in notepad++ and copy the whole data.
Step 4: Validate that xml content and rectify the errors. Then save it.
Step 5: now open the file_name.zip using notepad++ and save it as file_name.ods

Now it solved!
OpenOffice 3.1 on Windows Vista
aspsak
 
Posts: 1
Joined: Thu Sep 18, 2014 3:09 pm

Re: [Solved] Format error discovered in the file in sub-docu

Postby bluebilly » Thu Aug 06, 2015 1:43 pm

I have the same problem. Please help. Tks
Attachments
Untitled 1.ods
(20.66 KiB) Downloaded 206 times
LibreOffice 4.2.5.2 Win 7
bluebilly
 
Posts: 2
Joined: Thu Aug 06, 2015 1:40 pm

Re: [Solved] Format error discovered in the file in sub-docu

Postby bluebilly » Thu Aug 06, 2015 3:17 pm

I tried a little, but i resolve the problem with the aspsak solution.
LibreOffice 4.2.5.2 Win 7
bluebilly
 
Posts: 2
Joined: Thu Aug 06, 2015 1:40 pm

Re: [Solved] Format error discovered in the file in sub-docu

Postby stianx » Fri Oct 09, 2015 10:02 pm

I have an odt document, when I open it in writer it says: Format error discovered in the file in sub-document etc. I tried apsaks solution above but when I tried to open the content.xml file it was blank. I really want this file back. Anyone who can walk me through an alternative recovery solution?
Windows 7
OpenOffice 4.1.1.
stianx
 
Posts: 3
Joined: Fri Oct 09, 2015 9:53 pm

Re: [Solved] Format error discovered in the file in sub-docu

Postby RoryOF » Fri Oct 09, 2015 10:12 pm

If there is nothing in the content.xml file (and its size is 0) then forget the document file. You might have a backup or a temporary file in the OpenOffice backup or temporary directories. I'd run an undelete utility such as Photorec or Recuva to see can that find a deleted old copy.
Apache OpenOffice 4.1.7 on Xubuntu 18.04.4 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 30437
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Format error discovered in the file in sub-docu

Postby stianx » Fri Oct 09, 2015 11:21 pm

Thanks. Turns out there was content. I don't know why it showed up blank at first. I ran a validation using this: http://www.xmlvalidation.com/ and it detected a couple of errors. However, I have no idea where to go from there, how to fix the errors. Not too familiar with code ...

2: 1708 cvc-elt.1: Cannot find the declaration of element 'office:document-content'.
2: 4527 Attribute "name" bound to namespace "urn:oasis:names:tc:opendocument:xmlns:office:1.0" was already specified for element "style:style".
Windows 7
OpenOffice 4.1.1.
stianx
 
Posts: 3
Joined: Fri Oct 09, 2015 9:53 pm

Re: [Solved] Format error discovered in the file in sub-docu

Postby RoryOF » Fri Oct 09, 2015 11:28 pm

I have not sufficient knowledge of XML to advise - or indeed, to correct - those errors. I normally use XML copy editor. All I can suggest is that you try different XML editors until you find one that highlights the error(s) in some clear way, delete the erroneous text then reinsert the repaired file into the OO archive.
Apache OpenOffice 4.1.7 on Xubuntu 18.04.4 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 30437
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Format error discovered in the file in sub-docu

Postby stianx » Mon Oct 12, 2015 10:42 am

Thanks for your tip RoryOF. It seems pretty straightforward. However, I did not succeed in manually fixing my XML, my validator just kept finding new errors, probably as a result of my clumsy handling of the editing process, dunno. Eventually I found a link to this handy little piece of online software in another forum which did the job for me: https://online.officerecovery.com/writer/

It's free if you share. Took 30 seconds, and now I can read my file again.
Windows 7
OpenOffice 4.1.1.
stianx
 
Posts: 3
Joined: Fri Oct 09, 2015 9:53 pm

Re: [Solved] Format error discovered in the file in sub-docu

Postby huymoto » Tue Dec 17, 2019 9:37 am

I have an error in an OpenDocument calc spreadsheet that prevents me from opening it:

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

pls help me !
Attachments
CUM_TRUNG.ods
(45.32 KiB) Downloaded 9 times
I LIVE VIETNAM, OpenOffice 4.1.6
huymoto
 
Posts: 1
Joined: Tue Dec 17, 2019 9:23 am

Re: [Solved] Format error discovered in the file in sub-docu

Postby John_Ha » Tue Dec 17, 2019 4:25 pm

Try this file.

There were about 20 occurrences where table:content-validation-name="xxxx" was repeated. The repeated values were different (as below, val3 and val2) and I do not know whether I should have deleted the first occurrence or the second. I guessed and I deleted the second occurrence each time so, while the file now opens, it may be corrupted. Check it carefully!!

Clipboard01.gif

See [Tutorial] How to find and un-delete AOO temporary files for detailed instructions on how to

a) use Previous Versions (W7 and later) to recover previous versions of the file (is there something similar on MacOS and Linux?);

b) recover your file as it was when you last opened or saved it, or as it was when it was last saved with AutoRecovery;

c) find previous versions of the file in the folder it is located in, but which have since been deleted;

d) un-delete the temporary files AOO 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.

See [Tutorial] Format error discovered in sub-document for the method.

CUM_TRUNG_second occurrences deleted.ods
(34.12 KiB) Downloaded 4 times

 Edit: I also created another repaired file where I deleted the first occurrences.

I will be very interested to know if one file is better than the other or if you cannot see any differences between the two files.

CUM_TRUNG_first occurrences deleted.ods
(34.09 KiB) Downloaded 4 times
 
LO 6.3.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.
John_Ha
Volunteer
 
Posts: 7269
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK


Return to Calc

Who is online

Users browsing this forum: MSN [Bot] and 7 guests