Monday, October 26, 2009

Two of most popular problems with handmade XML

Sooner or later everybody tries to master his/her own XML files using notepad. And sooner or later one gets troubles with it:

1. XmlSerializer reports on Deserialize():

"http://abcde.efg/blabla" was not expected here

Assure the case in the path - xmlns attribute value is case sensitive: http://abcde.efg is not the same as http://Abcde.efg

2. Trying to open a "handmade" XML file in Internet Explorer

Invalid character in content. Error on processing the resource file:///filename

Most popular cause: create XML with notepad and save a ANSI. Once there's a special character in the content (like german Umlaute or french accents) - you'll be notified with the error message above.

The cure: open the file and save as UTF-8.
Check also MS KB

Enjoy!

No comments: