Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字符串,我试图解析为 XML,如下所示:
XElement.Parse(XMLdata)
但我遇到的问题是 XMLdata 包含以下文本:
$#x0 导致以下异常:'.', hexadecimal value 0x00, is an invalid character. Line 1, position 6554.尝试将字符串解析为 XML 时。
'.', hexadecimal value 0x00, is an invalid character. Line 1, position 6554.
有没有办法在调用之前删除这些字符XElement.Parse(XMLdata)?
请协助
在解析之前替换 xml 内容中的所有特殊字符
" & ' < >