XML Exception: Invalid Character(s)

前端 未结 7 1538
醉梦人生
醉梦人生 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:21

    IMHO the best solution would be to modify the code/program/whatever produced the invalid XML that is being fed to your program. Unfortunately this is not always possible. In this case you need to escape all characters < 0x20 before trying to load the document.

提交回复
热议问题