[lxml-dev] SAX support in trunk
Hi there, In the past few days I've done some reviewing and editing of the SAX support for lxml. As a result I've now added a sax.py module to the trunk that contains the SAX support. There's a doc/sax.txt document (and doctest) that explains how to use things. Thanks Stefan for this contribution! Your contributions as well as patience is much appreciated! Now on to the rest... :) I have been doing some more reviewing and thinking of what's on the scoder2 branch so I expect more progress to occur next week. Regards, Martijn
Martijn Faassen wrote:
In the past few days I've done some reviewing and editing of the SAX support for lxml.
You're not done, yet. ;) I checked in a patch (following a test case) that fixes a bug if namespace prefixes are redefined further down the tree. I don't know for sure if the test case is 100% conforming to the SAX spec (basically because there is no SAX spec), but I wouldn't want to rely on the fact that all the code out there does what would be necessary to prevent this bug (especially because there is no SAX spec). It now uses a stack for namespace handling, so that prefixes return to their previous definition on "endPrefixMapping". I think that's the right thing to do. I also removed the unicode() calls, as Python handles u'' correctly. BTW: apparently, you set the svn:eol-style for most files, but not for the new ones. I updated them, too. Stefan
Stefan Behnel wrote:
Martijn Faassen wrote:
In the past few days I've done some reviewing and editing of the SAX support for lxml.
You're not done, yet. ;)
I checked in a patch (following a test case) that fixes a bug if namespace prefixes are redefined further down the tree. I don't know for sure if the test case is 100% conforming to the SAX spec (basically because there is no SAX spec), but I wouldn't want to rely on the fact that all the code out there does what would be necessary to prevent this bug (especially because there is no SAX spec).
It now uses a stack for namespace handling, so that prefixes return to their previous definition on "endPrefixMapping". I think that's the right thing to do.
I also removed the unicode() calls, as Python handles u'' correctly.
I've looked it through and I think your changes are correct. I see you applied them to the trunk with testcase so that's fine. So, again, I'm done with the SAX review and on to the other stuff. :)
BTW: apparently, you set the svn:eol-style for most files, but not for the new ones. I updated them, too.
Hm, I'm not sure who set that; I don't recall doing so though I might've have. Thanks for making it consistent, even though I haven't thought the whole svn eol-style through a lot. Regards, Martijn
participants (2)
-
Martijn Faassen
-
Stefan Behnel