Need help with corrupted file: SAXException: [word/document.xml line 2]: Opening and ending tag mismatch: sdtContent line 2 and del

xb_capstone_paper_v1_commented.docx (990.3 KB)

Hi Everyone,

I have seen other threads with this issue, but it seemed like it was advisable to start a new one with my specific situation, details, and file attached, so here it is.

This was originally a .docx created in Word. I edited it in LibreOffice Writer (version 7.3.1.3 I believe), making tracked changes and adding comments. I had done this with several other files that had no problems, but I have learned from reading those other threads that this is bad practice. Lesson learned. :frowning:

Now the file won’t open at all in Word, and when I try to open it in Writer I get the following message:
SAXException: [word/document.xml line 2]: Opening and ending tag mismatch: sdtContent line 2 and del

I still have the original document, but the comments and tracked changes in this corrupted version are many hours of work that I really need to recover.

I started to wade into to some of the solutions in those other threads, but I quickly got in over my head.

I have seen @mikekaganski out there saving others with this kind of situation, so I’m keeping my fingers crossed that he or someone else out there can salvage this one too!

Please let me know if I can provide any other information.

Thank you all in advance!
Andrew

Dear @mikekaganski, I have the same problems where a .docx was edited with comments and tags and now it’s not opening (not even the person that commented can open it in LibreOffice). Could you help somehow?
Here’s the file: Ladataan Google Docsia

Many thanks, Lisa

https://drive.google.com/uc?export=download&id=1-gcHRLr8VMB-sozYy6GCjU2uE9CzocAc

1 Like

You deserve a statue. Thank you for the super quick help!

xb_capstone_paper_v1_commented.docx (991.2 KB)

You are a wizard, my friend. Thank you so much for the help. I am really grateful. You saved me hours of extra work.

Out of curiosity: Is it a matter of locating the mismatched tags in the XML and correcting them, or is there more to the story? And, if that is the way to solve it, how do you approach that in general?

Hopefully I won’t have to deal with this again, but if there are any lessons to learn here, I’m all ears.

Of course, if you would rather not explain your methods, no complaints from me. :slight_smile: I just really appreciate you being willing to take time to help folks like myself.

Thank you!

Yes.

I’m not quite sure I understood the question. Basically, I am a LibreOffice developer myself, and I did quite some changes around OOXML import and export, so I have rather good understanding of the format structure, and thus it often is easy to me to see which change makes sense, and which is not. It’s not a question of not wanting to share the knowledge; rather, it’s difficult to me to describe this.

Yes, I also hope you won’t face this, after you upgraded to 7.5.2, where tdf#147892 is finally fixed. But the general lesson to learn is: whenever possible (i.e., unless your workflow absolutely prohibits this), always save in the native format (here: ODT). Only save to external file formats when sending to someone, and keep the original version in ODT. This is not a 100% guarantee, but the odds that native file format is more robust are higher than for external formats.

1 Like

Great. Thanks for all of the information, and thank you again for your generosity in sharing your time and knowledge helping me and others. I really really appreciate it.

Hellow, I am having the problema related to it, I have tryied do solve it but it seems is not that easy. The original document has around 130 pages but it only open 11.
DISSERTAÇÃO correção professor.docx (975.7 KB)
Could u please helpe-me!

DISSERTAÇÃO correção professor.docx (994.5 KB)

Oh my man, thank you very much, you saved me a lot of time. But if it is not ask too much I really would like to have a tutorial about it :smiley: i tryied do fix it manually but didnt find a pattern. I dont know a thing a bout code but I am curious. Again thank u very much!!!.

:smiley:

This was tdf#149996 (so a bit different issue). And it was caused by a hyperlink including an anchor to a shape with inner text box. Note that the fix version is 7.5.3, so not released yet - and it means that if you re-create such a formatting, saving it to DOCX will break again.

The problem was that the hyperlink closed prematurely. I found the problematic closing tag, then found its opening counterpart (on a very different level). I saw that the hyperlink was intended to span at least over two text runs, the second of them containing the anchor; but to avoid the problem, I simply moved the closing tag after the first text run.

I’m sorry if this looks cryptic. As said: it’s really easy after you spent years working on this.

thank u again, very, vey, very much!!!

I have the same proble, could u please help?
KosmosKrMmKr.docx (321.5 KB)

KosmosKrMmKr_fixed.docx (321.3 KB)

1 Like

Hi @mikekaganski,

Can you please help with this file?

I encountered this problem when using libreoffice 7.5.2. I upgraded the version to 7.5.5, I am still not able to open the file. Your help is much appreciated.

Thanks,
Eng Kuan

Hi Mike,
I can’t open the google drive link. Can you please resend?
Thanks,
Eng Kuan

Please try again.

It works! Thank you so much for your help, Mike. Literally saving me hours of work. Can’t thank you enough! Have a wonderful day. :slight_smile: