I recently had XML that did not load. The error message was
The hexadecimal value 0x00 is an invalid character
received minimum code in LinqPad (C # operators):
var xmlDocument = new XmlDocument(); xmlDocument.Load(@"C:\Users\Thomas\AppData\Local\Temp\tmp485D.tmp");
I went through XML with a hex editor, but could not find the character 0x00. I minimized the XML to
<?xml version="1.0" encoding="UTF-8"?> <x> </x>
In my hex editor, it displays as
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 00000000 FF FE 3C 00 3F 00 78 00 6D 00 6C 00 20 00 76 00 ΓΏΓΎ<.?.xml .v. 00000010 65 00 72 00 73 00 69 00 6F 00 6E 00 3D 00 22 00 ersion=.". 00000020 31 00 2E 00 30 00 22 00 20 00 65 00 6E 00 63 00 1...0.". .enc 00000030 6F 00 64 00 69 00 6E 00 67 00 3D 00 22 00 55 00 oding=.".U. 00000040 54 00 46 00 2D 00 38 00 22 00 3F 00 3E 00 0D 00 TF-.8.".?.>... 00000050 0A 00 3C 00 78 00 3E 00 0D 00 0A 00 3C 00 2F 00 ..<.x.>.....<./. 00000060 78 00 3E 00 x.>.
Therefore, it is very easy to see that the 00 00 character is missing. All even-numbered columns contain values ββother than 00 .
Why is he complaining about an invalid 0x00 character?
source share