[XML-SIG] xml.dom.minidom.Text no more __init__?

Fred L. Drake, Jr. fdrake at acm.org
Fri Mar 26 07:22:06 EST 2004

On Thursday 25 March 2004 09:55 pm, brett hartshorn wrote:
 > What happened to the Text node in minidom?
 > With Redhat9 it works fine, but in Fedora Core1 is seems to have changed.
 > I am trying to overload the Text class and here is the error message i am
 > getting:
 > xml.dom.minidom.Text.__init__(self, data)
 > AttributeError: class Text has no attribute '__init__'

The constructor for the Text class has never been part of the documented API.  
The __init__(), in particular, was removed to support faster creation of an 
entire tree (which was very successful).

The Document object has a factory method, createTextNode(), that takes the 
text for the node as the only argument.  This is the only documented and 
supported way to construct new text nodes.  Other factory methods are used 
for other node types.


Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation

More information about the XML-SIG mailing list