[Python-bugs-list] [Bug #116678] minidom doesn't raise exception for illegal children

noreply@sourceforge.net noreply@sourceforge.net
Sun, 15 Oct 2000 07:06:17 -0700


Bug #116678, was updated on 2000-Oct-11 19:30
Here is a current snapshot of the bug.

Project: Python
Category: Library
Status: Open
Resolution: None
Bug Group: None
Priority: 6
Summary: minidom doesn't raise exception for illegal children

Details: Some types of DOM node such as Text can't have children.
minidom doesn't check for this at all:

from xml.dom import minidom
doc = minidom.Document()
text = doc.createTextNode('lorem ipsum')
elem = doc.createElement('leaf')
text.appendChild( elem )
print text.toxml()

This outputs just 'lorem ipsum', but elem really is a child 
of text; Text.toxml() just isn't recursing because it doesn't expect to do so.



Follow-Ups:

Date: 2000-Oct-12 20:02
By: fdrake

Comment:
This is a bug with detecting an improper use.  It should be fixed, but need not be for Python 2.0.  Correct use will not produce erroneous behavior.  Reducing priority by one.
-------------------------------------------------------

Date: 2000-Oct-15 07:06
By: loewis

Comment:
I believe this is not a bug, but an intended deviation from the DOM spec.
minidom (as the proposed documentation in patch 101821 explains) does
not support the IDL exceptions of module DOM, so it cannot report errors about improper usage.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=116678&group_id=5470