Page 1 of 1

[Solved] ODT file with "Attribute office:name redefined"

Posted: Wed Nov 19, 2025 1:44 pm
by Babel Editing
Hello,

I cannot reopen an .odt file I just saved.

I get the message: "error on line 2 at column 22322: Attribute office:name redefined"

I've unzipped the .odt and been in to the xml file and there is a whole lot of junk (mainly repeated 1s) in the style:style section. I tried replacing this with code from the original version of the file, and with code suggested by ChatGPT, but no help. And I'm no programmer so that's the limit of my ability.

Can anyone help? Very very many thanks in advance,

Ben
[new to forum]

Re: Help needed: Corrupted .ODT file "Attribute office:name redefined"

Posted: Wed Nov 19, 2025 4:13 pm
by MrProgrammer
Hi, and welcome to the forum.

Babel Editing wrote: Wed Nov 19, 2025 1:44 pm … with code suggested by ChatGPT, but no help
Ha! Here is code suggested by a human. It's fixed many similar problems, including the seven given in the tutorial.
[Tutorial] Delete duplicate attributes tool

If you need any additional assistance, attach a document demonstrating the difficulty. I cannot not help further unless you attach a Writer document.

Re: Help needed: Corrupted .ODT file "Attribute office:name redefined"

Posted: Wed Nov 19, 2025 4:22 pm
by Babel Editing
Dear MrProgrammer,

Thank you so much for your reply. I am afraid I don't know enough programming to understand your code! Very sorry and also embarrassed.

I attach the problem file. Quite early on in the XML are a bunch of 1s which I am sure should not be there.

Ben

Re: Help needed: Corrupted .ODT file "Attribute office:name redefined"

Posted: Wed Nov 19, 2025 7:03 pm
by MrProgrammer
I used my Delete Duplicate Attributes tool. This recovery took 30 seconds.
Attributes read   : 12553
Attributes written: 12530
Attributes removed: 23
updating: content.xml

20251119.odt
(93.67 KiB) Downloaded 153 times

If this solved your problem please go to your first post use the Edit ✏️ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.

Re: Help needed: Corrupted .ODT file "Attribute office:name redefined"

Posted: Wed Nov 19, 2025 7:12 pm
by RoryOF
There were many 1111 blocks scattered through the file. I've never seen anything quite like that; I think Mr Programmer's recovery is as good as you are going to get.

Re: Corrupted .ODT file "Attribute office:name redefined"

Posted: Wed Nov 19, 2025 11:54 pm
by Babel Editing
Dear MrProgrammer (and RoryOF),

I am utterly blown away by your kindness. I really don't know what to say! This forum truly has the original cooperative spirit of the original internet.

Thank you a million times -- you've saved me having to re-do the whole job.

Ben