On 21 June 2010 12:34, Cédric Krier <[email protected]> wrote:
> Ideas (or patch) are welcome to improve this.
> And it is even perhaps Python sax parser to improve.
> Which parser genshi uses?

TLDR: Expat with location tracking that's been supported since Python 2.4.

Long version from the Genshi FAQ:

Q: So then why not just use Kid?

A: We think that Kid represents a huge step forward for XML-based
templating in Python.  Match templates and the generator-based
processing model are extremely powerful concepts.
But arguably Kid also has some basic design problems. For example, Kid
generates Python code from templates, which adds a lot of complexity
to the code and can make the process of locating and fixing template
errors a true nightmare. A syntax error in a template expression will
cause an exception that points somewhere in the generated code. In
addition, as Kid is based on  ElementTree, and the ElementTree API
doesn't provide location information for parse events, exceptions
reported by Kid often don't include information about what part of the
template caused the error. (To be fair, this kind of location tracking
wasn't even available in the Python bindings for Expat before Python
2.4.)
We felt these problems would best be addressed by developing a new
engine from scratch, as opposed to trying to “fix” Kid.

http://genshi.edgewall.org/wiki/GenshiFaq

Best,
Elver

-- 
[email protected] mailing list

Reply via email to