[Solved] Format error discovered in sub-doc. styles.xml

Discuss the presentation application
Post Reply
laulas
Posts: 3
Joined: Thu Oct 13, 2016 12:16 pm

[Solved] Format error discovered in sub-doc. styles.xml

Post by laulas »

Hello,

I am new in this forum, thank you all for providing your help!

I have a problem with an .ODP file: yesterday I copied and pasted an .OTP template file,
so I created the content and saved it as .ODP.

I closed and opened the file and I had this message:

"Format error discovered in the file in sub-document styles.xml, line 2...."

Here is the link to my style.xml file:
https://gist.github.com/anonymous/c3cb6 ... 60f515d97e

I tried many of the solutions from this forum and over the web, nothing works!
I don't really know what to do!!

Do you have any suggestion?
Last edited by RoryOF on Thu Oct 13, 2016 2:50 pm, edited 1 time in total.
Reason: Added [Solved] and green tick [RoryOF, Moderator]
OpenOffice 4.1.2 - Windows 10 and Ubuntu 16.04
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Format error discovered in the file in sub-doc. styles.x

Post by acknak »

Try this one (attached).

Note that the correct name for the file is styles.xml not style.xml.

There are three elements that have repeated draw:mirror-vertical attributes. I removed the ="true" instances and left the ="false" ones.
Attachments
styles_repaired.zip
(8.75 KiB) Downloaded 298 times
AOO4/LO5 • Linux • Fedora 23
laulas
Posts: 3
Joined: Thu Oct 13, 2016 12:16 pm

Re: Format error discovered in the file in sub-doc. styles.x

Post by laulas »

Thank you acknak!

I still can't open the document.

I'm now working on Windows: I replaced your code in the styles.xml file
and compressed all with 7zip as a zip file, extended odp.
When I open the odp file, OpenOffice says:

"The file xxx.odp could not be repaired and therefore cannot be opened."

Am I zipping the file in the wrong way maybe?
OpenOffice 4.1.2 - Windows 10 and Ubuntu 16.04
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Format error discovered in the file in sub-doc. styles.x

Post by RoryOF »

I found a surer way to do this is to use an archive manager to open the main .odp file, then to edit the internal .xml file with a plain text editor. When I save that file the archive manager prompts to allow replacement of the .xml file within the archive and then rebuilds the archive. Other ways of replacing an .xml file in an archive seemed to give an incorrect checksum for the archive, resulting in a "could not be repaired" message.
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: Format error discovered in the file in sub-doc. styles.x

Post by acknak »

The way I do it is, rather than zipping all the sub-files together to make a new document, instead take a working ODF file and use command-line zip to update the "styles.xml" component. That seems to work consistently.

If you're still having trouble, attach your document here and I can update it.
AOO4/LO5 • Linux • Fedora 23
laulas
Posts: 3
Joined: Thu Oct 13, 2016 12:16 pm

Re: Format error discovered in the file in sub-doc. styles.x

Post by laulas »

I don't really know how to thank you, IT WORKED!!!

Thanks a lot!!
OpenOffice 4.1.2 - Windows 10 and Ubuntu 16.04
Post Reply