the name in the end tag of the element must match the element type in the start tag error

Anonymous
2010-10-28T11:18:41+00:00

I too am having the problem many people seem to be having on this forum. I have created a fairly large and important document which includes a lot of maths equations and some graphics. Now every time I try to open it it says there is an error with a mismatch between the start and end tags. I have never worked with XML but have tried to find what feels like a needle in a haystack and can't really see how to proceed. Is there any chance you could help? I have uploaded the document to:

http://www.sendspace.com/file/0ecfpu

Many thanks,

Andrew

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2010-11-01T19:04:17+00:00

Hi Andrew,

The fixed file is at http://www.wordarticles.com/temp/AH%20Statistics%201%20Notes%20-%20Outcome%202.docx

To try to answer your questions:

There is no easy way to do it in Notepad - I generally use Visual Studio; Yves Dhondt - the only other person here, AFAIK, who fixes these documents - has some tool he wrote himself. It isn't very difficult but there is no guarantee of what you will find when you look. Usually - and I'm sure you're right - it happens when equations and graphics are together and an oMath end tag, and perhaps part of the equation it ends, gets misplaced within a structure that is meant to enable the equation be correctly displayed in earlier versions of Word that do not support the new equation engine.

The structure should be:

<mc:AlternateContent>

<mc:Choice>

<m:oMath>

Start of equation

End of equation

</m:oMath>

<mc:Choice>

<mc:Fallback>

Probably some graphics

</mc:Fallback>

</AlternateContent>

but ends up as:

<mc:AlternateContent>

<mc:Choice>

<m:oMath>

Start of equation

<mc:Choice>

<mc:Fallback>

Probably some graphics

</mc:Fallback> </AlternateContent>

End of equation

</m:oMath>

This is a bug so nothing is for certain, and I don't know what circumstances trigger it, or what you can do to avoid it. I also don't know if Microsoft are working on it, although I have informed them and they have replied that 'it has been passed to the appropriate team' or some such.

For my own amusement I am working on an AddIn that will attempt to mend these documents but I don't know how well it will work, yet.


Enjoy,

Tony

www.WordArticles.com

Was this answer helpful?

8 people found this answer helpful.
0 comments No comments

207 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-10-21T06:52:58+00:00

    You are probably at a good starting place being a freshman in a computer related field.  In terms of recovering Word documents, the file format is xml based so any beginner book about xml should help.  The first book I read about xml was the following.

    http://www.barnesandnoble.com/w/xml-kevin-h-goldberg/1100835512?ean=9780321559678

    I don't know that it's the best and I'm sure any beginner xml book will provide you with some good information and give you the basic concepts.  Also, the following links might be somewhat useful.

    http://msdn.microsoft.com/en-us/library/ywzwa6ex(v=vs.71).aspx

    http://www.w3schools.com/XML/xml_whatis.asp

    If you weren't asking about xml though and you were wondering about computers in general, you could try asking the school's teachers and advisors for more specfic materials or classes you could take that would be helpful. 

    Brandon

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-10-21T06:47:57+00:00

    Thanks.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-10-21T06:35:57+00:00

    In general, the first thing I do is see what kind of "corruption" is happening on the document.  Sometimes, when I look at the xml it's misplaced or missing tags, sometimes the tags are valid but they are in a place that they shouldn't be or they shouldn't be in the file at all.   

    To do this I start by opening the "document.xml" file in Visual Studio.  It usually does a great job of flagging the problem tags.  Now that the file is opened and the problem tags are identified, I format the output (Ctrl+K+F) so that I can see the tree structure of the file. 

    At this point, unfortunately, it would be a lengthy write up to actually go through all the checks I've done and the different trial and error procedures.  I have seen some mentions on other forums where people will look back up the xml tree and remove whatever parent node contains the invalid xml until there are no more errors.  It could be done this way and you might be able to get the file valid per the schema and ultimately Word will open it, but that happens at the cost of deleted customer data so I try to avoid that.  Typically I use a combination of reading through the open xml specs to find out what the xml should look like and then review the surrounding tags to get an idea about what "object" is causing the problem. 

    That process usually handles the majority of the misplaced tag problems I've seen.  There are a couple other types of problems and I apologize that I'm not able to provide a full tutorial but hopefully it helps in some way.

    Brandon

    Was this answer helpful?

    0 comments No comments