minidom and DOM level 2

The lib ref claims that minidom supports DOM Level 1. Does anyone know what parts of Level 2 are not implemented? I wasn't able to find anything offhand. It seems to be more a matter of what's not documented, or what's not covered by the regression tests. So. I'd be happy to do some diffing between the implementation, documentation, tests, and the Recommendation, and submit patches for whatever needs it. If anyone thinks that's worthwhile. Anyone? -j

Jason Orendorff schrieb:
The lib ref claims that minidom supports DOM Level 1. Does anyone know what parts of Level 2 are not implemented?
Most prominently, minidom only implements the Core module of DOM level 2, none of Views, Events, Style, Traversal and Range, or HTML. Whether anything is lacking in DOM Core level 2, I would have to check in detail. Regards, Martin

Jason Orendorff wrote:
OK, I think this is worthwhile then. :) I'll read the spec and submit a patch.
You're planning to implement EntityReference in minidom? That'll be fun! :-) One of the nastier corners of DOM and XML in general.
I'd be happy to do some diffing between the implementation, documentation, tests, and the Recommendation
I hacked up an experimental test harness for the W3 DOM Test Suite in order to test my own imp; you might find it useful: http://doxdesk.com/software/py/domts.html The TS is far from definitive, but its tests for Level 1 and 2 are to the best of my knowledge accurate. Incidentally minidom falls far short of passing even Level 1 Core for more reasons than omission of EntityReference. I noted the main known problems with it here: http://pyxml.sourceforge.net/topics/compliance.html Good luck! -- And Clover mailto:and@doxdesk.com http://www.doxdesk.com/

On 4/7/07, Andrew Clover <and-dev@doxdesk.com> wrote:
Mmm. So I'm finding. EntityReferences seem to force detailed knowledge of entity handling into the DOM implementation. expat doesn't expose the information in a particularly helpful way. In a word, blaargh. I'd be happy to set this aside and work on Level 1 compliance:
Very nice. Thanks for posting this. I don't suppose you'd be willing to update it for Python 2.5, would you? Martin, have you looked at this? Some of these might be hard to fix, given expat. -j

Martin, have you looked at this?
Only just now. I assume Andrew is right on these, although one would have to verify each and every one, reading the spec, reading the documentation, reading the source, testing, fixing. Very time-consuming. In any case, the *claim* certainly is that minidom supports level 2 core. Any proof to the contrary indicates a bug; patches are welcome. Regards, Martin

Jason Orendorff wrote:
I don't suppose you'd be willing to update it for Python 2.5, would you?
Can do, but at this point I'm not aware of any work having been done on the issues listed there between the 2.3 and 2.5 releases. The danger is people may be used to the "wrong" minidom behaviours, given they have been static for so long and are in many cases central to how minidom works. -- And Clover mailto:and@doxdesk.com http://www.doxdesk.com/

On 4/13/07, Andrew Clover <and-dev@doxdesk.com> wrote:
I've been running the DOM test suite against trunk, using your test harness. It's kind of alarming at first that over 100 tests fail. :) But many of the failures involve entity references. An even larger portion involve error cases: we accept things we should check and reject. For example, doc.createElement('\t') should fail. These are certainly bugs, and they're easy to fix. I'm working through them.
When I get to these, I'll post about it. -j

Jason Orendorff schrieb:
The lib ref claims that minidom supports DOM Level 1. Does anyone know what parts of Level 2 are not implemented?
Most prominently, minidom only implements the Core module of DOM level 2, none of Views, Events, Style, Traversal and Range, or HTML. Whether anything is lacking in DOM Core level 2, I would have to check in detail. Regards, Martin

Jason Orendorff wrote:
OK, I think this is worthwhile then. :) I'll read the spec and submit a patch.
You're planning to implement EntityReference in minidom? That'll be fun! :-) One of the nastier corners of DOM and XML in general.
I'd be happy to do some diffing between the implementation, documentation, tests, and the Recommendation
I hacked up an experimental test harness for the W3 DOM Test Suite in order to test my own imp; you might find it useful: http://doxdesk.com/software/py/domts.html The TS is far from definitive, but its tests for Level 1 and 2 are to the best of my knowledge accurate. Incidentally minidom falls far short of passing even Level 1 Core for more reasons than omission of EntityReference. I noted the main known problems with it here: http://pyxml.sourceforge.net/topics/compliance.html Good luck! -- And Clover mailto:and@doxdesk.com http://www.doxdesk.com/

On 4/7/07, Andrew Clover <and-dev@doxdesk.com> wrote:
Mmm. So I'm finding. EntityReferences seem to force detailed knowledge of entity handling into the DOM implementation. expat doesn't expose the information in a particularly helpful way. In a word, blaargh. I'd be happy to set this aside and work on Level 1 compliance:
Very nice. Thanks for posting this. I don't suppose you'd be willing to update it for Python 2.5, would you? Martin, have you looked at this? Some of these might be hard to fix, given expat. -j

Martin, have you looked at this?
Only just now. I assume Andrew is right on these, although one would have to verify each and every one, reading the spec, reading the documentation, reading the source, testing, fixing. Very time-consuming. In any case, the *claim* certainly is that minidom supports level 2 core. Any proof to the contrary indicates a bug; patches are welcome. Regards, Martin

Jason Orendorff wrote:
I don't suppose you'd be willing to update it for Python 2.5, would you?
Can do, but at this point I'm not aware of any work having been done on the issues listed there between the 2.3 and 2.5 releases. The danger is people may be used to the "wrong" minidom behaviours, given they have been static for so long and are in many cases central to how minidom works. -- And Clover mailto:and@doxdesk.com http://www.doxdesk.com/

On 4/13/07, Andrew Clover <and-dev@doxdesk.com> wrote:
I've been running the DOM test suite against trunk, using your test harness. It's kind of alarming at first that over 100 tests fail. :) But many of the failures involve entity references. An even larger portion involve error cases: we accept things we should check and reject. For example, doc.createElement('\t') should fail. These are certainly bugs, and they're easy to fix. I'm working through them.
When I get to these, I'll post about it. -j
participants (4)
-
"Martin v. Löwis"
-
Andrew Clover
-
Brett Cannon
-
Jason Orendorff