【发布时间】:2013-08-21 06:01:20
【问题描述】:
我尝试像这样使用 lxml 在 Python 中解析 XML 文件:
objectify.parse(xmlPath, parserWithSchema)
但 XML 文件可能在奇怪的地方包含 cmets:
<root>
<text>Sam<!--comment-->ple text</text>
<!--comment-->
<float>1.2<!--comment-->3456</float>
</root>
解析前不加载或删除cmets的方法?
【问题讨论】:
标签: python xml xml-parsing comments lxml