具有停止/恢复功能的惰性 SAX XML 解析器 [英] Lazy SAX XML parser with stop/resume

查看:52
本文介绍了具有停止/恢复功能的惰性 SAX XML 解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很确定答案是否定的,但当然还有比我更聪明的人!

I am pretty sure the answer is no but of course there are cleverer guys than me!

有没有一种方法可以构建一个基于惰性 SAX 的 XML 解析器,它可以被停止(例如,引发异常是一种可能的方法)而且可恢复?

Is there a way to construct a lazy SAX based XML parser that can be stopped (e.g. raising an exception is a possible way of doing this) but also resumable ?

我正在为 Python >= 2.6 使用标准 XML 库寻找可能的解决方案.懒惰"部分也很琐碎:我真的很喜欢这里的可恢复"属性.

I am looking for a possible solution for Python >= 2.6 with standard XML libraries. The "lazy" part is also trivial: I am really after the "resumable" property here.

推荐答案

Expat 可以停止并且可以恢复.AFAIK Python SAX 解析器使用 Expat.API 真的不会将停止的东西暴露给 Python 端吗?

Expat can be stopped and is resumable. AFAIK Python SAX parser uses Expat. Does the API really not expose the stopping stuff to the Python side??

不,看起来解析器停止在 Python 中不可用...

nope, looks like the parser stopping isn't available from Python...

这篇关于具有停止/恢复功能的惰性 SAX XML 解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆