hexadecimal value 0x0C, is an invalid character-如何去除XML无效字符
2009-12-18 13:42
459 查看
public static string CleanInvalidXmlChars(string text)
{
// From xml spec valid chars:
// #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] #x2
// any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
string re = @"[^\x09\x0A\x0D\x20-\xD7FF\xE000-\xFFFD\x10000-x10FFFF]";
return Regex.Replace(text, re, "");
}
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/yls087412/archive/2009/10/29/4743320.aspx
{
// From xml spec valid chars:
// #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] #x2
// any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
string re = @"[^\x09\x0A\x0D\x20-\xD7FF\xE000-\xFFFD\x10000-x10FFFF]";
return Regex.Replace(text, re, "");
}
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/yls087412/archive/2009/10/29/4743320.aspx
相关文章推荐
- hexadecimal value 0x0C, is an invalid character-如何去除XML无效字符
- Dom4j 读 xml 时,遇到 xml 无效字符,报错:An invalid XML character
- Dom4j 读 xml 时,遇到 xml 无效字符,报错:An invalid XML character
- INVALID_CHARACTER_ERR: 指定的 XML 字符无效或非法。
- XmlDocument的Load方法报“hexadecimal value .., is an invalid character”
- XML hexadecimal value 0x__, is an invalid character
- XmlDocument的Load方法报“hexadecimal value .., is an invalid character”
- XML文件处理过程中的0x1A 错误处理,Hexadecimal value 0x is an invalid character
- Handling Invalid Characters in an XML String (zz.IS2120.BG57IV3)
- XML解析出现An invalid XML character (Unicode: 0x**) was found in the comment.
- XML解析出现An invalid XML character (Unicode: 0x**) was found in the comment.
- org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x7)
- org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found in the CDATA sectio
- Error parsing XML: An invalid XML character (Unicode:0x1f) was found
- an error occurred while signing: '.', hexadecimal value 0x00, is an invalid character
- SAXParseException An invalid XML character 问题的解决
- SAXParseException An invalid XML character 问题的解决
- 关于 Exception: An invalid XML character (Unicode: 0x0) was found
- XML解析出现An invalid XML character (Unicode: 0x**) was found in the comment.
- spring中XML中Bean property 'dataSource' is not writable or has an invalid setter method.