Chief wrote:
I am unable to load an xml document that contains Chinese characters in
an attribute value. I need to load the document into and XmlDocument
object and am using the XmlDocument.Load(string filename) method. I get
an error that says the document contains invalid characters. The
document loads fine with Chinese characters in a node value, but not in
an attribute value. I have tried setting the encoding to UTF-8 and
UTF-16, but neither solve the problem. Can Chinese (or other Unicode
characters) be used in an attribute value in an XML Document?
Yes, certainly, the error you get says that the parser finds a byte
sequence that does correspond to a character in the declared charset.
So unless you are running in a bug in .NET's XmlDocument parser there is
a problem with that file that needs to be fixed.
What happens if you load the XML document into IE? Does IE then complain
too about invalid characters?
Or try any other XML parser to see whether it gives errors too to be
able to decide whether the problem is with the file or with .NET's XML
parser.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/