How to Troubleshoot an XML Encoding Issue
When computers communicate purchase orders, medical records or other business data among themselves, the language they speak is XML, or Extensible Markup Language. Although XML may appear to be simple structured text, well formed XML adheres to a strict standard with tightly defined rules and a limited character set. These rules are defined by the World Wide Web Consortium and anyone working with XML should be familiar with the standard.
Instructions
-
-
1
Load the XML file into your web browser. Type the file name in the address bar using the format:
File://c:/foldername/filename.xml
Or click "File," "Open," "Browse," and select the XML file.
-
2
Read the encoding errors which appear, beginning with the first error encountered.
-
-
3
See the list of common errors provided under Tips, then open the XML file with Notepad or your favorite text editor, and correct the problems.
-
4
Save the file then go back to the web browser and click "Refresh" to view the next error.
-
5
Repeat this process until all errors have been corrected. When the file has no more errors, the file content will be displayed in a hierarchical tree in your browser.
-
6
Fix the program that created the file. If the file was sent to you from some other source, contact their developer to resolve the issues.
-
1
Tips & Warnings
The organizations that define industry-standard XML formats often provide validator programs that test for compliance. Check with an organization's website to see if a validator is available. If so, use this instead of a web browser.
Some of the most common error messages as reported by IE7 are as follows:
"Only one top level element is allowed."--Each XML document must have a single root element.
"The following tags were not closed:"--Start tags did not have matching end tags.
"A name was started with an invalid character."--A character appears somewhere in the file that is not part of XML's restricted character set.
"End tag 'line3' does not match the start tag 'LINE3'. Error processing resource file."-- The start tag and end tag do not match. Tag names are case sensitive so make sure the tag names match exactly. This error will also appear if tag names are not nested properly or a start tag is missing.
"The character '<' cannot be used in an attribute value."--An attribute inside the start tag is missing its end quote or the quotes are mismatched.
"Whitespace is not allowed at this location."--This often indicates that a less than (<) character is embedded in the text file.