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.
我很确定答案是否定的,但当然还有比我更聪明的人!
有没有办法构建一个可以停止的基于惰性 SAX 的 XML 解析器(例如,引发异常是一种可能的方式)但也可以恢复?
我正在寻找 Python >= 2.6 和标准 XML 库的可能解决方案。“懒惰”部分也是微不足道的:我真的很喜欢这里的“可恢复”属性。
Expat 可以停止并且可以恢复。AFAIK Python SAX 解析器使用 Expat。API 真的不会将停止的东西暴露给 Python 端吗?
编辑:不,看起来解析器停止不适用于 Python ......