Error in XML file

15 次查看(过去 30 天)
Kash Costello
Kash Costello 2020-2-4
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!

回答(1 个)

Jeremy Hughes
Jeremy Hughes 2020-2-4
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.

标签

Community Treasure Hunt

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

Start Hunting!

Translated by