[Solved] Need help to fix content.xml

Discuss the word processor
Post Reply
marta-s
Posts: 1
Joined: Fri Feb 08, 2019 2:52 pm

[Solved] Need help to fix content.xml

Post by marta-s »

Hello everyone!

I was working on a report in OpenOffice 4.1.2 on Windows 10 with text, pictures and comments when it crashed. File recovery doesn't work. I followed this tutorial: viewtopic.php?f=71&t=87180 However, I haven't been able to fix the problem as I don't know what exactly should be deleted. XML Copy Editors shows "Error at line 2, column 3547: duplicate attribute". I've pasted the part where the error should be below, it's right after the first "office:name=..." command.

I'd appreciate any help with this issue!

Marta

Code: Select all

<style:font-face style:name="Andale Sans UI" svg:font-family="&apos;Andale Sans UI&apos;" style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable"/></office:font-face-decls><office:automatic-styles><style:style office:name="__Annotation__755_3150985601111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"HERE office:name="__Annotation__877_315098560111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" office:name="__Annotation__1007_3150985601111111111111111111111111111111111111111111111111111111111111" office:name="__Annotation__1015_3150985601111111111111111111111111111111111111111111111111111" office:name="__Annotation__1439_31509856011" office:name="__Annotation__1440_3150985601" office:name="__Annotation__1441_315098560111111111111111111111111111111" office:name="__Annotation__1452_315098560111111111111111111111111111111111111111111111111111111111111111111111111111" office:name="__Annotation__1457_3150985601111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" style:name="Tabelle1" style:family="table"><style:table-properties style:width="16.999cm" table:align="margins"/></style:style>
Last edited by robleyd on Sat Feb 09, 2019 1:52 pm, edited 2 times in total.
Reason: Add green tick
OpenOffice 4.1.2 on Windows 10
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Need help to fix content.xml

Post by John_Ha »

It is a well known problem when a reviewer uses MS Word.

Upload the file and I will look at it. Or see my email - send me the file.

It looks very much like Case 1 in the Tutorial you mention at [Tutorial] Format error discovered in sub-document where the first style definition has been corrupted by multiple office:name definitions being added to it. Try deleting

Code: Select all

office:name="__Annotation__755_3150985601111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"HERE office:name="__Annotation__877_315098560111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" office:name="__Annotation__1007_3150985601111111111111111111111111111111111111111111111111111111111111" office:name="__Annotation__1015_3150985601111111111111111111111111111111111111111111111111111" office:name="__Annotation__1439_31509856011" office:name="__Annotation__1440_3150985601" office:name="__Annotation__1441_315098560111111111111111111111111111111" office:name="__Annotation__1452_315098560111111111111111111111111111111111111111111111111111111111111111111111111111" office:name="__Annotation__1457_3150985601111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" 
so you are left with as below, with a space between the remaining bits after the deletion.

Code: Select all

<style:font-face style:name="Andale Sans UI" svg:font-family="&apos;Andale Sans UI&apos;" style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable"/></office:font-face-decls><office:automatic-styles><style:style style:name="Tabelle1" style:family="table"><style:table-properties style:width="16.999cm" table:align="margins"/></style:style>
It's much easier to see if you pretty print - don't forget to Linearise XML before saving the edited xml file. I cannot pretty print the extract.
Example from tutorial
Example from tutorial
Your file - Delete all the blue stuff leaving a space
Your file - Delete all the blue stuff leaving a space
Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
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: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Need help to fix content.xml

Post by John_Ha »

marta-s sent me the file. I edited it as shown above to remove the unwanted "office:name=" definitions. The file then opened correctly.
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