[Hint] How did I fix my ODT file

Discuss the word processor
Post Reply
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Hint] How did I fix my ODT file

Post by acknak »

apaj wrote:...Could you please try and help me out save the remaining parts of the file? ...
Please find attached two files:
- the original odt file with no modifications ...
Sorry, I think this one is a lost cause: the zip archive is badly damaged and only part of the content.xml file can be recovered. Unfortunately, that part contains only style information and no actual document content. As far as I can see, there's no document data left in the damaged file to be recovered.

Some of the images appear to be intact, but I assume you probably have them as separate files.

If you re-create the document, I suggest linking in the images instead of embedding them, and using a consistent set of styles instead of direct formatting. The images and style information greatly inflate the size of the document and make it that much more susceptible to unrecoverable damage.
AOO4/LO5 • Linux • Fedora 23
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Hint] How did I fix my ODT file

Post by John_Ha »

apaj wrote:when I try to open the partly repaired file in writer (made it by: zip -r seminarski_partly_repaired.odt * - correct way, right?
You will find it much easier to use something like 7-Zip (http://www.7-zip.org/) which has a Windows interface. You can 'drag and drop' files into and out of it, test individual files, delete files etc. Another good ZIP utility is WinZip for Windows (http://www.winzip.com/win/en/index.htm).
Attachments
View of ODT file using 7-Zip
View of ODT file using 7-Zip
Last edited by John_Ha on Fri Apr 03, 2015 5:30 pm, edited 1 time in total.
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.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Hint] How did I fix my ODT file

Post by John_Ha »

apaj wrote:

Code: Select all

Expected name, but got <EOE> for attribute in unnamed entity at line 2 char 65509 of file
65,509 might be giving a clue. 64k in binary is 65,536 so this is very, very close.

I read in another post that one reason for using Styles instead of direct formatting is that the files containing the formatting data get very big if you do direct formatting.

Two questions come to mind.

1 Could there be a 64k limit built into AOO at some stage which is causing formatting data to be truncated, giving rise to these strange "empty files"?

2 Could apaj's experience be due to AOO putting an EOF marker at 64kB in content.xml which then causes problems when the ODT file ZIPped / unZIPped?
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.
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Hint] How did I fix my ODT file

Post by RoryOF »

The only 64K limit we know in OO is for characters in a paragraph. This crops up regularly with new users, who (from earlier word processor habits) press Shift Enter instead of Enter. It manifests itself often with a complaint that they cannot add any characters after (approx) page 15. There are some zip repair utils for Windows - I haven't used them in 20 years, so cannot even remember their names. I think a better chance of recovery is with an undelete utility (Recuva or PhotoRec, or similar), but the sooner this is applied after the file loss is discovered, the better chance of success.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
makarand
Posts: 1
Joined: Mon Mar 24, 2014 12:15 pm

Re: [Hint] How did I fix my ODT file

Post by makarand »

Hi,

I followed method described by Ajut. and finally zipped file but again getting following error " The file '$(ARG1)' could not be repaired and therefore cannot be opened.'

This is an .ods file and need the data in that badly. Can you please help.

regards
Open Office 3 on Windows 7
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Hint] How did I fix my ODT file

Post by John_Ha »

makarand

It sounds like you have a broken file among the files you were trying to ZIP. You could find out which by removing all files, and replacing them one by one until you get the message again.

Or if you send me a PM (Private Message) - use the PM icon to the right - with your email ID, I will reply with mine and you can send me the file so I can have a look at it.

If it has confidential matter in it, just remove the content.xml file (which contains all the text) and send me the rest of them.
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.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Hint] How did I fix my ODT file

Post by John_Ha »

Makarand
I am sorry, but I think your file is damaged beyond repair. I have corrected what must amount to hundreds of errors in the XML coding (I don't know exactly because I use Find / Replace all when I could). What concerns me is the following

1 I don't understand XML so I don't know what I am doing. I am going to the error, and looking for similar expression in the file, and changing the error to look like what else I have found. This may work, but I may be changing the data or formulae in your spreadsheet without realising.
 Edit: It is easier to see what the XML is doing if you format the XML with a so called "Pretty Printer" which "aligns the tags" and breaks the XML into separate, indented lines. There are utilities available (fee and free) or you can use a website such as http://xmlprettyprint.com/ which allows you to paste the XML, and it formats it neatly. Copy it back into an editor like Notepad etc to view it easily. 
2 I am only searching for XML format errors. What happens if there is corruption in a cell value which changes the number or formula but does not cause an XML error? Your spreadsheet would be wrong, but I would not spot it.

If you want to continue, here is how I am doing it. But I would not trust the file even if you manage to fix it.

1 Extract content.xml out of Revenue...ods. (You can double click on it and it opens in Internet Explorer which displays it in "readable fashion" now I have corrected a lot of errors. You might be able to extract cell values out of this view. Note how the view of the damaged content.xml file is different from doing the same with content.xml from the working backup file)

2 Try to open content.xml with an XML editor. I used the freebie XML Notepad. It gives an error message "Error loading ... Line 2, position 797991 ..." saying it does not understand the XML at Column 797991 in line 2. This is the same error number (+ / - 1) you get if you put content.xml back into the odt file and open it with AOO - it's quicker using XML Notepad each change!).

3 Open content.xml with an editor like Notepad++ which has position information. The broken file consists of just two lines, the first with 39 characters, the second with 1,128,432 characters. All the errors seem to be after 793,000 so there are about 500,000 characters to check!
Position the cursor at the start of line 2. Choose Offset. Type in 797991 and go to it. Check with the counter at the bottom you are actually there - arrow left / right to get to 797991. When the counter shows 797991 you are at the error. You now see table:formula="of:5000"5" and you have to work out what is wrong with it and how to correct it.

4 When you have corrected it, save.

5 Now go to step 2. Repeat until no more errors.

6 Put content.xml back into the odt file and see if it opens in AOO.

In the file you sent I got the following typical errors: (Note I have copied the whole phrases between < ... >)

<office:forms form:automatic-focus="false"000"><tdly-design-modes="false"/>

which I thought should be

<office:forms form:automatic-focus="false" form:apply-design-mode="false"/>

at 793604
<table:table-column table:style-name="co7" table:number-columns-repeated=28" table:default-cell-style-name="Default"/>

Which I thought should be ( "28", not 28" )

<table:table-column table:style-name="co7" table:number-columns-repeated="28" table:default-cell-style-name="Default"/>

At 793921
<table:table-row table:style-name="ro1" table:number-rows-repeated=51">

which I thought should be ( "51" not 51" )

At 794395
<table:table-cell table:formula="of:(38000000*0.01)-4000]" office:value-type="float" office:value=""30000">

which I thought should be ( "30000, not ""30000)

<table:table-cell table:formula="of:(38000000*0.01)-4000]" office:value-type="float" office:value="30000">

At 794408
<text:p""30000</text:p>

which I thought should be

<text:p><30000</text:p>

I also corrected errors at 794672, 794927 and 796259.

Why has this happened? No-one seems to know. What we need is a good file just before this happens, the bad file which won't open, and a good description of exactly what you did to save and open it. The developers should then have something to test. But the file isn't corrupted in the normal sense of random corruption - it seems quite systematic and does the same corruption in multiple places in the file, so it does repeat so it should be able to be debugged. I guess it could be when AOO writes to the content.XML file; it could be when AOO compresses (ZIPs) the content.XML file; or it could be when AOO decompresses the content.XML file.
Last edited by John_Ha on Mon Apr 07, 2014 12:56 am, edited 1 time in total.
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.
Esmu Igors
Posts: 4
Joined: Fri Apr 04, 2014 5:10 pm

Re: [Hint] How did I fix my ODT file

Post by Esmu Igors »

Hello everyone.

LibreOffice 4.1.3.2 on LMDE (I agree, maybe this is not the right forum...)
I am trying to repair a file that I saved as .odt after opening it as .doc in a read-only archive and editing it. It shows an error "Read error. Error reading file" and closes. If I extract unedited version of this file from archive and then save it, all goes fine. But I would like to recover my changes... I tried deleting <office:automatic-styles> section, then I tried also deleting <office:font-face-decls> section as a desperate try of layman. I also tried to just copy the <office:body> section to the content.xml of previous version of document (which I obtained from .doc extracted from the archive and which is read by LO fine). As several Math objects were added in then-.doc-file-in-read-only-archive while editing, I also copied "ObjectN" directories (which as I understand correspond to these Math objects) in the unzipped previous version of file, and style.xml document as well. Every time there were LO popups about damaged file and when decided to repair, "The file '$(ARG1)' could not be repaired and therefore cannot be opened" popup. I can see all my edits in content.xml, but how can I at least incorporate them in the previous version? Please help. :?

I also tried rxp -N as suggested in this thread and it changed some phrase sequence inside tags (as diff showed), but when I opened it with LO, it opened... in LO Math with nothing on the screen.

On the other hand, Google Docs preview feature CAN read the file almost correctly (some pictures are shifted and float over the text), but I cannot copy information back to LO keeping the formatting.
Files are here, I hope this way they are accessible.
Initial .doc, as extracted later from archive:
https://drive.google.com/file/d/0B51x-v ... sp=sharing
Saved as .odt:
https://drive.google.com/file/d/0B51x-v ... sp=sharing
File I have edited as .doc when open from read-only archive and saved as .odt (and got lots of issues with it):
https://drive.google.com/file/d/0B51x-v ... sp=sharing

Please help.
 Edit: OK, now I have given rights for these files for everybody :) 
Libre Office 4.1.3.2 on Linux Mint Debian Edition (MATE)
Esmu Igors
Posts: 4
Joined: Fri Apr 04, 2014 5:10 pm

Re: [Hint] How did I fix my ODT file

Post by Esmu Igors »

Just checked with another file from the same archive, and the situation is the same – when opening a .doc from archive and saving as .odt, then closing LO and trying to open saved .odt, "Read error. Error reading file" appears. If it is relevant, the archive is .rar archive containing two .zip archives, which in their turn contain the .doc files.
Libre Office 4.1.3.2 on Linux Mint Debian Edition (MATE)
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Hint] How did I fix my ODT file

Post by John_Ha »

Esmu
I downloaded both your files and both opened OK with AOO 4.0.1. I compared the one you are having problems with - 4_9_2nd.odt - with the version on googledocs 4_9_2nd.doc and it looked much better - the images seemed to be in the correct place. Can I suggest you download AOO and try - it may be a problem with Libre Office.

Your 'black and orange table' images on pages 9 and 11 are blurred because they do not have enough pixels - the first (Fig 4.6) is only 450 pixels wide and you have magnified it to 6" wide, which is only 75 dpi. It needs to be at least 150dpi.
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.
Esmu Igors
Posts: 4
Joined: Fri Apr 04, 2014 5:10 pm

Re: [Hint] How did I fix my ODT file

Post by Esmu Igors »

John_Ha,
Thank You for Your attention. It's no matter with "black an orange table", the file is a students' conspect and nobody really cares about such details :)
The file I actually have problems with is, however, not 4_9_2nd.doc, but rather 4_9.odt. Howvere, I will try installing AOO. Fortunately, I have also Debian 7 on another partition, so I can keep my LO on LMDE. Although I am not sure if there all dependencies would be satisfied...
Libre Office 4.1.3.2 on Linux Mint Debian Edition (MATE)
Esmu Igors
Posts: 4
Joined: Fri Apr 04, 2014 5:10 pm

Re: [Hint] How did I fix my ODT file

Post by Esmu Igors »

John_Ha,
It is definetly an issue of LO. I opened 4_9.odt in LO 3.5.4.2 on Debian 7.0 and all was fine. I feel quite ashamed that I did not check this option before and wasted your time :knock: So thank You and sorry for another time :)
 Edit: And after I saved this file in old version of LO (mentioned), I can open and work with it in LO 4.1. So, the problem is solved for me :) Maybe I should report this bug via their bugzilla. 
Libre Office 4.1.3.2 on Linux Mint Debian Edition (MATE)
fscosta
Posts: 2
Joined: Mon Apr 07, 2014 9:31 pm

Re: [Hint] How did I fix my ODT file

Post by fscosta »

Hello,

Last friday I was in a meeting and did a lot of changes in a simple calc file. The only thing that I did was the usual edition in a dropbox folder (maybe this could be the cause of files being corrupted?).

Erro de leitura.
Foi encontrado um erro de formato no arquivo do subdocumento content.xml em 2,109867(linha,col).


Now I need some help to recovery this file. I did everything as instructed, but when I repack the file and tried to open it, I receive the import message.
Attachments
mq.ods
(33.25 KiB) Downloaded 4071 times
Windows 7 / Ubuntu 13.10 / LibreOffice 4.2
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Hint] How did I fix my ODT file

Post by acknak »

Try this one:
Attachments
mq_recovered.ods
(33.57 KiB) Downloaded 4111 times
AOO4/LO5 • Linux • Fedora 23
fscosta
Posts: 2
Joined: Mon Apr 07, 2014 9:31 pm

Re: [Hint] How did I fix my ODT file

Post by fscosta »

Thank you! What you did? I removed the duplicated entries, saved the file (Notepad++) and repack with 7zip. Then when opening the file, show up the message to import file with all caracters esclambed. But did everything in Windows, no in Linux.

Just wanna know what I did wrong (for the future).

And, again, thank you!
Windows 7 / Ubuntu 13.10 / LibreOffice 4.2
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Hint] How did I fix my ODT file

Post by acknak »

That's all I did except I use the zip/unzip utility. Maybe 7zip archives are different somehow? Different compression algorithm, maybe? I don't know.
AOO4/LO5 • Linux • Fedora 23
Mackie
Posts: 1
Joined: Wed May 07, 2014 12:25 pm

Re: [Hint] How did I fix my ODT file

Post by Mackie »

Hi,
I wanted to edit my ODT file, but I couldn't open it. I think when I edited it the last time I left it open and the pc went off.
can you please help me restore this file
Attachments
Dépense 2014.ods
(6 Bytes) Downloaded 3927 times
OpenOffice 4.0.1 on Windows 7
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Hint] How did I fix my ODT file

Post by acknak »

Look at the file size: six bytes (six characters). Sorry, there's nothing there to recover.
AOO4/LO5 • Linux • Fedora 23
Lumenovus
Posts: 2
Joined: Fri Jun 20, 2014 5:12 pm

Re: [Hint] How did I fix my ODT file

Post by Lumenovus »

Hello, I've tried extracting this as a .zip file, but get the message that it is a corrupted archive. It started as a general input/output error when I tried saving it as I was working on it. I had openoffice try to repair the file, and hopefully it didn't do even more damage.
If it's truly unrecoverable I'll have lost several months of work, so I have to ask for help. It's a second draft of a book, so even if the content only could be saved, or some of it, it would mean a lot.

The file is here:
http://www.mediafire.com/download/50n35 ... ed_2nd.odt
Open Office 3.4.0
Mac OSX 10.8.4
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Hint] How did I fix my ODT file

Post by RoryOF »

I got nothing from it, but then I only did the obvious things you did. Look in the OpenOffice temp and backup directories pointed to by
Preferences /Options /Openoffice.org Paths

If there is a bak file rename it to .odt. If in tenp directory there are files with arbitrary names (dfhyt.ghf sort of thing) rename them to .odt and see if they open; have you not an unformatted version?
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: [Hint] How did I fix my ODT file

Post by acknak »

Ouch. Here's all I could get out of it. I hope you have (or find) a backup copy somewhere.
Attachments
Lavender 2 Formatted 2nd_recovered.odt
(150 KiB) Downloaded 3910 times
AOO4/LO5 • Linux • Fedora 23
Lumenovus
Posts: 2
Joined: Fri Jun 20, 2014 5:12 pm

Re: [Hint] How did I fix my ODT file

Post by Lumenovus »

Fantastic! That was far more than I hoped for! Thank you so much. What did you use to extract it? I was trying it with 7zip.
Always create a backup copy is checked now, of course. I didn't know that was an option, I guess I assumed it did that by default.
Open Office 3.4.0
Mac OSX 10.8.4
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Hint] How did I fix my ODT file

Post by acknak »

The zip archive was/is badly damaged; the only software repair tool I have (it's built in to the command line zip/unzip) wouldn't fix/repair it.

Fortunately, part of the content.xml was still there and could be extracted/uncompressed manually by "funzip" (also comes with INFO-zip). Patch up the xml tags to close them all properly and put the content.xml back into an otherwise empty .odt

Not difficult at all and I think that's about the best that can be done with it. The other parts are simply not in the damaged file.
AOO4/LO5 • Linux • Fedora 23
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Hint] How did I fix my ODT file

Post by RoryOF »

Follow my suggestions, just in case. Also, try Recuva or PhotoRec. Either of these will be slow (overnight?) but may recover an erased temporary file.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Hint] How did I fix my ODT file

Post by John_Ha »

This is what an ODT file looks like when opened in 7-zip - a freebie unzipping utility. The ODT file was a fairly big one with about 15 A4 pages and about 30 or 40 images. WinZip for Windows is another good ZIP utility.
ODT file unzipped.png
This is the content.xml for a simple ODT file containing just the single sentence (see bottom) "The quick brown fox jumped over the lazy dog." with one image anchored to a paragraph. Note that content.xml contains one blank line, followed by a single line with all 4,366 characters - to get it into readable form, it needs to be "pretty printed", when it becomes 37 lines.

Code: Select all

.. blank line at top ...
<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:textooo="http://openoffice.org/2013/office" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" office:version="1.2"><office:scripts/><office:font-face-decls><style:font-face style:name="Mangal1" svg:font-family="Mangal"/><style:font-face style:name="Times New Roman" svg:font-family="&apos;Times New Roman&apos;" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="Mangal" svg:font-family="Mangal" style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="Microsoft YaHei" svg:font-family="&apos;Microsoft YaHei&apos;" style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="SimSun" svg:font-family="SimSun" style:font-family-generic="system" style:font-pitch="variable"/></office:font-face-decls><office:automatic-styles><style:style style:name="T1" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/></style:style><style:style style:name="T2" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/></style:style><style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics"><style:graphic-properties style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0mm, 0mm, 0mm, 0mm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/></style:style></office:automatic-styles><office:body><office:text><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/></text:sequence-decls><text:p text:style-name="Standard"><draw:frame draw:style-name="fr1" draw:name="graphics1" text:anchor-type="paragraph" svg:x="94.56mm" svg:y="1.76mm" svg:width="48.05mm" svg:height="36.04mm" draw:z-index="0"><draw:image xlink:href="Pictures/1000000000000280000001E05FDD7131.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>The <text:span text:style-name="T1">quick</text:span> brown fox <text:span text:style-name="T2">jumped</text:span> over the lazy dog.</text:p></office:text></office:body></office:document-content>
The same content.xml "pretty printed" by opening it in Notepad++ with the XML Tools plug-in and selecting Plugins > XML Tools > Pretty printing with line breaks. Alternatively google for on-line Pretty printers.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:textooo="http://openoffice.org/2013/office" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" office:version="1.2">
	<office:scripts/>
	<office:font-face-decls>
		<style:font-face style:name="Mangal1" svg:font-family="Mangal"/>
		<style:font-face style:name="Times New Roman" svg:font-family="&apos;Times New Roman&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
		<style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/>
		<style:font-face style:name="Mangal" svg:font-family="Mangal" style:font-family-generic="system" style:font-pitch="variable"/>
		<style:font-face style:name="Microsoft YaHei" svg:font-family="&apos;Microsoft YaHei&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
		<style:font-face style:name="SimSun" svg:font-family="SimSun" style:font-family-generic="system" style:font-pitch="variable"/>
	</office:font-face-decls>
	<office:automatic-styles>
		<style:style style:name="T1" style:family="text">
			<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
		</style:style>
		<style:style style:name="T2" style:family="text">
			<style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/>
		</style:style>
		<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics">
			<style:graphic-properties style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0mm, 0mm, 0mm, 0mm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/>
		</style:style>
	</office:automatic-styles>
	<office:body>
		<office:text>
			<text:sequence-decls>
				<text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
				<text:sequence-decl text:display-outline-level="0" text:name="Table"/>
				<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
				<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
			</text:sequence-decls>
			<text:p text:style-name="Standard">
				<draw:frame draw:style-name="fr1" draw:name="graphics1" text:anchor-type="paragraph" svg:x="94.56mm" svg:y="1.76mm" svg:width="48.05mm" svg:height="36.04mm" draw:z-index="0">
					<draw:image xlink:href="Pictures/1000000000000280000001E05FDD7131.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
				</draw:frame>The <text:span text:style-name="T1">quick</text:span> brown fox <text:span text:style-name="T2">jumped</text:span> over the lazy dog.</text:p>
		</office:text>
	</office:body>
</office:document-content>
 Edit: Edited to clarify things 
Last edited by John_Ha on Thu Apr 30, 2015 5:18 pm, edited 4 times in total.
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.
anilrao71
Posts: 11
Joined: Tue Jun 24, 2014 8:15 am

Re: [Hint] How did I fix my ODT file

Post by anilrao71 »

getting this error "format error discovered in the file in sub-document content.xml at 2,813573"
openoffice 4.1.0 & windows XP
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Hint] How did I fix my ODT file

Post by RoryOF »

So, it's in your file. How can we diagnose other than to say that there is an error in the internal code of the file?
Unzip the file, extract content.xml and pass it through an xml verifier.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
anilrao71
Posts: 11
Joined: Tue Jun 24, 2014 8:15 am

Re: [Hint] How did I fix my ODT file

Post by anilrao71 »

cannot extract the content.xml file from the zip file.
openoffice 4.1.0 & windows XP
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Hint] How did I fix my ODT file

Post by John_Ha »

anilrao71 wrote:cannot extract the content.xml file from the zip file.
If you read the posts in this thread it will tell you precisely how to unzip the file and which software to use.

The error is in line 2 at character 813573.

If you pretty print the file after finding where the error is, you will be able to understand the XML better - see my previous post which describes the contents.XML file and how to pretty print it.
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.
anilrao71
Posts: 11
Joined: Tue Jun 24, 2014 8:15 am

Re: [Hint] How did I fix my ODT file

Post by anilrao71 »

Please help, extracted the content.xml. But do not understand anything it.
openoffice 4.1.0 & windows XP
Post Reply