Error "SAXException..." when opening docx document

Hi everyone,
friend of mine shared this docx with me. I added a few comments in libre and saved it. The document got somehow screwed up and I cannot open it anymore. Is there a way how to fix it?

The error message is “SAXException: [word/document.xml line 2]: Opening and ending tag mismatch: sdtContent line 2 and del”.

I uploaded the file on my onedrive.

[error_document.docx]
https://1drv.ms/w/s!AnZH3wCVyzd932tVg9Dg6bmDaGPz?e=mB1WKv

THX,
Jakub

Is Track Changes enabled?

yes, it is

As i am not sure if the link above works I am adding one more

This is a known issue when editing DOCX with Track Changes enabled in Writer. @mikekaganski knows how to fix it.

thank you. @mikekaganski could you please help with that?

https://drive.google.com/uc?export=download&id=1voBYXhUPwXY3vma9S_quAmvwSuGeb4YP

It is fixed now, and LibreOffice opens it.
But MS Word won’t open it - it seems, there is some problem in the content, not in the structure.
Anyhow - it opens in Writer. And may be saved to ODT.

Thank you so much! You are here of the day! :slight_smile: :partying_face:

Hi Mike, I am sure you are tired of this question, but we sure appreciate your knowledge. I have a similar error message, similar problem. Word docx created by another and I am editing in libreoffice. it is almost 300 pages, but every time I save it and try to open it, I get this message
Error SAXException: [word/document.ml line 2]: Opening and ending tag mismatch: rPr line 2 and move To
and lose half of the document. Is the issue in one of the tables in the document? What can I do to fix the error? I can save in .odt, but I still need to send to original writer in .docx.
yes track changes is enabled and needs to be. I am editing her book.
I have writer 7.4.3.2
how can I recover lost edits? or open a copy without losing it too?
thanks so much for your help.

If the document is corrupt like this, it needs to be fixed by editing internal XML.
If the problem is reproducible after you fix and edit again, it is actually good, because it allows to create an actionable bug report. You need to check is this problem (I mean, corruption of a previously good DOCX on save) happens with a current version (24.2); and if so, then file a bug report with a problematic sample (a good DOCX, which, if saved with LibreOffice, would become corrupted).

1 Like

I don’t know how to fix it internally. I am a user not a coder.

is there no way to retrieve the original?

I understand what you are saying about filing a bug report, but I would like to figure out how to work with what is still there first. I would like to retrieve the other half of my document. Any possibility?
I have updated my libre to 24.2.

I read some other responses about working in odt and then send a copy in docx. Is that a viable situation, or would it corrupt in that save or in the sending to the other party?

Can these documents be opened with something else? or did they corrupt in the saving part?

You could notice that others provided their broken documents, to allow others to inspect / fix :wink:

It is always possible that exporting your ODT, the resulting DOCX would be corrupt. But in this situation, only the copy is corrupt; and you have options like trying a newer / older version, or even sending a PDF or ODT - with all your data in ODT still safe.

and thank you, I did not know I could send it to you to work with.
the uncorrupted version has 529 KB. But it has also not been edited with what I thought I had save in the above version.

wouldn’t the missing portions be on my computer? or are they still in that file, but just hidden?

The Chronicles of Kairos - CW copy Edited thru Tower 4 copy.docx (366.8 KB)

Does that mean it cannot be fixed? what if I send another Non “copy”?

I tried earlier today to say yes to this error message, letting libreoffice try to repair and it was still minus 100 pages or so.

Are you sure you are opening my file (and not the original one you sent me)? I fixed it. It should open.

I downloaded yours, and opened it. I will see if I mixed them up.

Yay, yay, thank you so much. It is all there!! At least the pages. So how do I keep it uncorrupted? it is in docx now, do I save it in odt? or docx? other person is changing formatting, so is that the issue?

As said (please be kind to people spending time helping; don’t assume they are glad to repeat the same thing a million times; pay back by trying to find the answer, and not cutting corners by requiring them to repeat themselves): save as ODT; export to DOCX when sending.

I am very grateful for your knowledge, and your time. I did research everywhere I knew to. I read I think most of your answers to people. Some were many years old, so I am trying to ask good questions re the current versions. I still do not know if I can avoid the problem, or fix it without bothering you. I am curious if this will continue to happen as we send back and forth. She will be opening my file and also in reverse.
I am thankful, and I am trying to avoid repetition for you.