Page 1 of 1

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

Posted: Thu Oct 13, 2016 1:28 pm
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?

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

Posted: Thu Oct 13, 2016 1:46 pm
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.

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

Posted: Thu Oct 13, 2016 1:58 pm
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?

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

Posted: Thu Oct 13, 2016 2:11 pm
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.

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

Posted: Thu Oct 13, 2016 2:12 pm
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.

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

Posted: Thu Oct 13, 2016 2:35 pm
by laulas
I don't really know how to thank you, IT WORKED!!!

Thanks a lot!!