[XML-SIG] DocumentFragment ??
and-xml at doxdesk.com
Tue May 4 08:48:17 EDT 2004
Kevin Thackray <kevin.thackray at clarisys.fr> wrote:
> newDoc = Document()
> class Header(DocumentFragment):
minidom makes no promises about using its internal classes directly
rather than through the W3C standard DOM interfaces (createDocument and
Instantiating Node objects manually in later versions of minidom is
likely to result in broken objects that can cause exceptions like these.
In particular, you can't construct a DocumentFragment without telling it
which Document it belongs to. Normally this would happen in the
Subclassing the DOM objects from minidom (or the other implementations I
know of) is unsupported. You would have to either override all the
relevant factory methods, or write back your extended versions into
their namespace. Both approaches would require in-depth knowledge of the
implementation's internal data structures, and would be incompatible
I suggest using a containment relationship between Header and
DocumentFragment, instead of inheritance.
* - except in earlier versions of the Reference Manual, where Document
was specified to be directly instantiable.
mailto:and at doxdesk.com
More information about the XML-SIG