XML Exception: Invalid Character(s)

前端 未结 7 1600
醉梦人生
醉梦人生 2020-12-10 03:55

I am working on a small project that is receiving XML data in string form from a long running application. I am trying to load this string data into an XDocument

7条回答
  •  情深已故
    2020-12-10 04:11

    XML can handle just about any character, but there are ranges, control codes and such, that it won't.

    Your best bet, if you can't get them to fix their output, is to sanitize the raw data you're receiving. You need replace illegal characters with the character reference format you noted.

    (You can't even resort to CDATA, as there is no way to escape these characters there.)

提交回复
热议问题