我使用SAX解析大型xml文件。
但它将每个XML code转换为它的符号版本。在
如何防止SAX这种行为。在
示例with_amp.xml
:
在
<?xml version="1.0" encoding="utf-8"?>
<root>
<title>One Two</title>
<title>One &mdash; Two</title>
</root>
python处理程序:
在
^{pr2}$
我希望输出是:
在
One Two
One &mdash; Two
Tags:
使用saxutils,我成功地做到了。 https://docs.python.org/2/library/xml.sax.utils.html#module-xml.sax.saxutils
例如,关于您的信息:
会变成
^{pr2}$(您需要将saxutils添加到导入中: 整个过程都会
相关问题 更多 >
编程相关推荐