This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author inguin
Recipients
Date 2006-02-18.11:10:42
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I wrote this to the xml-sig mailing list, but I didn't
receive any feedback. Maybe I'm heard here:
The expat XML parser module builds inconsistent DOM
trees if an XML file contains elements (e.g. a comment)
before the DOCTYPE declaration. The DocumentType node
is properly appended to the root node's children, but
neither its previousSibling pointer nor the previous
node's nextSibling pointer are set. E.g., when parsing
an XML file that looks like this:

<?xml version="1.0"?>
<!-- comment -->
<!DOCTYPE test SYSTEM "test.dtd">
<test> Hello world </test>

into a dom tree, the dom.childNodes vector will contain
three nodes (comment, document type and an element),
but the dom.firstChild.nextSibling points to 'None'.

The fix for this bug is trivial: The
start_doctype_decl_handler should not directly
manipulate the document's childNodes vector and use the
_append_child function instead. A patch against Python
2.4.2 is appended.
History
Date User Action Args
2007-08-23 14:38:00adminlinkissue1434090 messages
2007-08-23 14:38:00admincreate