The characters of XML document can be encoded in different formats. By default XML uses the Unicode (UTF-8 or UTF-16) character set , but other encodings can be used if they are declared in the XML declaration at the beginning of the document.
A D V E R T I S E M E N T
Due to encoding problem you can get different errors, when you try to load an XML document into Internet Explorer:
"Switch from current encoding to specified encoding not supported."
Such Type of error generate due to inconsistency between the character encoding
specified in the XML declaration and the actual character encoding used to
serialize the XML document. In XML all characters come from the Universal
Character Set (UCS), which always associates a numerical code point with each
character. Many algorithms exist for
converting code points into a sequence of bytes. A specific character encoding
must be used to serialize an XML document. For example, if you type an XML
document into notepad and save it, you can choose from one of several supported
character encodings including ISO-8859-1, UTF-8, or UTF-16.
According to the XML 1.0 specification, all processors are required to automatically
detect and support the UTF-8 and UTF-16 encodings.You don't need an XML declaration
if you use one of these two encodings when serializing your documents,
If you use different encoding other than UTF-8/UTF-16, then you must use an XML
declaration to specify the actual encoding used.
Without knowing what encoding was actually used how can the processor read the encoding information?
It's easy for processors to auto-detect between UTF-8/UTF-16 with or without an
XML declaration by looking for a byte order mark (BOM) required in UTF-16
documents. For all other encodings, you know that the first five characters must
be "<?xml". Since a given processor will only support a finite set of encodings,
a brute-force algorithm can be used that simply looks at the first few bytes to
determine the family of the character encoding used (there are five possible
encoding families including UTF-16 big endian, UTF-16 little endian, UCS-4 or
other 32-bit encoding, EBCDIC, and everything else). Once the processor detects
the encoding family, it can read the rest of the XML declaration (since only a
restricted set of characters can be used in the XML declaration), then it can
switch to using the specified character encoding within the detected family. If,
at this point, the XML declaration tells the processor to switch to an encoding
from a completely different family, that error occurs.
So any time you save a document using a specific encoding, then
indicate a different encoding in the XML declaration, you will get this error
because the encodings must agree.
An invalid character was found in text content.
This error message generate when a character in the XML document does not match the encoding attribute and no any encoding attribute was specified. Normally you will get this error message if your XML document contains "foreign" characters and the file was saved with a single-byte encoding editor like notepad.
Windows 2000 notepad without Encoding
Windows 2000 Notepad files may save as Unicode format.
Save the XML file below as Unicode (Country that the document does not contain any encoding attribute):
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
xml document, xml parser, xml schema, xml declaration,
xml unicode encoding,
xml encoding declaration,
xml encoding utf 8,
xml encoding iso 8859 1,
java xml encoding,
xml iso 8859 1,
xml character encoding,
xml iso 8859,
xml encoding iso 8859,
xml encoding utf,
xml encoding iso,
xml version 1.0 encoding utf 8,
xml version 1.0 encoding,
xml version 1.0 encoding iso 8859 1,
javax xml rpc encoding,
xml version 1.0 encoding utf 16.