Page 8 of 29PREVNEXT

Open XML II: Editing Documents in the XML

Error page caused by a syntax error in the XML

When you open a document part in an XML viewer (such as Internet Explorer), an error message may appear in place of the file content if there is a syntax error in the XML.

You can edit content in a document part just as you edit text in a document. Cut, copy, paste, delete, or type text in order to edit the text, values (such as formatting settings), or tags in a document part. You can try doing this for yourself, with step-by-step instructions, in the practice session at the end of this lesson.

The most important thing to keep in mind when editing a document part is the XML structure. Most tags are case-sensitive and the syntax is very specific. If you accidentally delete a bracket, from the end of a tag, for example, the file will not be able to open.

For best results, after you edit an XML part, open it in a structured XML viewer (such as Internet Explorer). If there is a syntax error, you will usually see an error message. In most cases, the message provides information to help you find the error.

For example, the Internet Explorer error message in the picture indicates that an end tag </w:r>) is the next recognized tag following the start tag <w:t>. Because paired tags are always nested, the end tag has to match the start tag. So the information provided here tells you to insert a missing, or look for an incorrectly written, </w:t> tag. Remember that the error could be as small as omitting a bracket or a slash.

Page 8 of 29PREVNEXT