System.Xml.XmlException: hexadecimal value 0×00 invalid character

I got the following error message when trying to validate an XML file against an XSD file using .NET:

Unhandled Exception: System.Xml.XmlException: ‘.’, hexadecimal value 0×00, is an invalid character. Line 2, position 1.

It turned out that my XSD file was encoded using UCS-2 Little Endian. So I used Notepad++ to convert it to UTF-8 and the problem was solved.

(I think converting to ANSI would also solve the problem.)

24 June 2009 | .NET | Comments

One Response to “System.Xml.XmlException: hexadecimal value 0×00 invalid character”

  1. 1 azlan 25 June 2009 @ 12:39 pm

    That’s mean encode playing big role…..so must be careful about that..hmmmm

Comments:

  1.  
  2.  
  3.