Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Microsoft Office Word
Search
Search
 
Check for updates: (c) Microsoft
Office downloads
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

Email this linkEmail this link Printer-Friendly VersionPrinter-Friendly Version Bookmark and ShareShare
Troubleshoot XML in Word
 

Note  XML features, except for saving documents as XML with the Word XML schema, are available only in Microsoft Office Professional Edition 2003 and stand-alone Microsoft Office Word 2003.

ShowThe XML Document task pane disappears and is not in the task pane list once I start to edit a document.

Once you start to edit an XML document that has data views available in the XML Document task pane, you activate the data view that you selected. This process cannot be reversed, because a data view is an Extensible Stylesheet Language Transformation (XSLT) (XSL Transformation (XSLT): A file that is used to transform XML documents into other types of documents, such as HTML or XML. It is designed for use as part of XSL.) that processes data in the XML document when the XML document is opened for editing. For this reason, be sure to select the data view you want to use before you start editing the document.

Note  The XML Document task pane also disappears if you switch to the Mail Merge task pane, because the data view is applied if you start a mail merge.

ShowWord doesn't open my XML file properly.

Check the following:

ShowThe file must use proper XML syntax (it must be well formed)

If the XML file is not well formed, Word displays a message. In the message dialog box, click Details to read the XML error message. Then, open the file in a text editor to correct the problem, and try to reopen the file in Word.

If you're editing a file in Word and intend to save only the XML data (discard the Word XML schema), avoid saving the document when it is not well formed. For example, in the XML Structure task pane, check to make sure that you have just one root element defined for the document.

Note  The XML Structure task pane displays errors where the XML structure does not follow the rules of the attached XML schema (validation errors), but the pane does not report syntax errors where the document is not well formed. To find XML syntax errors, open the file with a program that reads XML and reports errors, such as Microsoft Internet Explorer 5 or later.

ShowThere must be XML tags in the document if you are saving data only

If you save an XML document that has no custom schema attached or that has no XML elements in the document, you must keep the Word XML schema (WordML) when you save the document. Otherwise, the document is not well formed, because it lacks a root element.

ShowWord must be able to apply an XSL Transformation

If Word cannot use the Extensible Stylesheet Language Transformation (XSLT) (XSL Transformation (XSLT): A file that is used to transform XML documents into other types of documents, such as HTML or XML. It is designed for use as part of XSL.) that you specify, then Word attempts to apply any XSLT that is specified within the document. If none is specified, then Word attempts to apply its default transformation to open the document. If the default transformation doesn't work, Word alerts you to the problem. You can try specifying another XSLT file (.xslt), or you can open the file in a text editor.

ShowWhen I saved my XML file, I lost some data.

If you apply an Extensible Stylesheet Language Transformation (XSLT) (XSL Transformation (XSLT): A file that is used to transform XML documents into other types of documents, such as HTML or XML. It is designed for use as part of XSL.) when you save your XML file, Word saves the result of the transformation, not the original XML file. If your original XML file contains data that the transformation does not use, then that data is discarded. To solve this problem, keep a separate copy of the XML file with no transformation applied, and when you apply a transformation, use Save As to create a new file.

ShowThe list of elements is hard to read.

If the element names in the XML Structure task pane are long and include content similar to "{urn:," you can turn off the display of the namespace in element names. In the XML Structure task pane, click XML Options, and then select the Hide namespace alias in XML Structure task pane check box.
advertisement