Error in XML file

16 views (last 30 days)
Kash Costello
Kash Costello on 4 Feb 2020
Answered: Jeremy Hughes on 4 Feb 2020
Hi, I'm having problem with my XML file. It says:
An invalid XML character (Unicode: 0x1) was found in the element content of the document.
I can only view the <0x01> error when using Sublime Text but when I open it in notepad, it's just a space. When I read it in matlab using textscan, it's also just a space so I can't see what's the special character is. Is there a way to fix this? It would be a really great help.
Thank you so much!

Answers (1)

Jeremy Hughes
Jeremy Hughes on 4 Feb 2020
You could try
fid = fopen(fname);
bytes = fread(fid);
fclose(fid);
find(bytes==1)
If that doesn't find anything, then it may be related to the encoding.
Many things look like a space, by the way.
char(1)
for example. You can try casting to double to see the values of each character.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!