python 过滤xml非法字符 :not well-formed (invalid token)错误处理
2017-12-15 18:54
1756 查看
python处理xml报错:
xml.etree.ElementTree.ParseError: not well-formed (invalid token):
查询得知xml有不支持的字符范围
出现这个错误的原因是,xml文件中含有非法字符,是一个bad xml,即不符合xml规范的.
由于xml文件是第三方提供,只能自己这里处理掉xml中的非法字符
python过滤方法:
替换掉非法字符即可
适用于不会使用到非法字符的情况
xml.etree.ElementTree.ParseError: not well-formed (invalid token):
查询得知xml有不支持的字符范围
出现这个错误的原因是,xml文件中含有非法字符,是一个bad xml,即不符合xml规范的.
由于xml文件是第三方提供,只能自己这里处理掉xml中的非法字符
python过滤方法:
适用于不会使用到非法字符的情况
相关文章推荐
- python 过滤xml非法字符 :not well-formed (invalid token)错误处理
- Android 编译错误——布局 Error parsing XML: not well-formed (invalid token)
- 布局错误error: Error parsing XML: not well-formed (invalid token)
- 关于自定义控件在布局文件中使用时提示error: Error parsing XML: not well-formed (invalid token)错误的问题
- 关于自定义控件在布局文件中使用时提示error: Error parsing XML: not well-formed (invalid token)错误的问题
- python处理xml中非法字符的一种思路
- error: Error parsing XML: not well-formed (invalid token)
- XML parse error: not well-formed (invalid token)
- 关于Error parsing XML: not well-formed (invalid token)的解决方法
- error: Error parsing XML: not well-formed (invalid token)解决办法
- error: Error parsing XML: not well-formed (invalid token) 的解决办法
- Error:(65) Error parsing XML: not well-formed (invalid token)
- android开发中error: Error parsing XML: not well-formed (invalid token)
- android studio 报 Error:(79) Error parsing XML: not well-formed (invalid token)
- error: Error parsing XML: not well-formed (invalid token)
- Parsing Error xml.parsers.expat.ExpatError: not well-formed (invalid token): line X column Y
- Error parsing XML: not well-formed (invalid token)
- Error parsing XML: not well-formed (invalid token) 报错+R文件消失解决的方法
- Error:(37) Error parsing XML: not well-formed (invalid token)
- Error parsing XML: not well-formed (invalid token) 报错,找不出原因