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

noreply@sourceforge.net noreply@sourceforge.net
Wed, 11 Oct 2000 19:30:14 -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: 5
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.



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