minidom nodes without a document?

"Martin v. Löwis" martin at v.loewis.de
Sun Nov 23 15:13:49 EST 2003


Magnus Lie Hetland wrote:

> Is it possible to build a minidom tree bottom-up without access to a
> document node? It seems that simply instantiating the various node
> classes doesn't quite do the trick...

No. In the DOM, all nodes always belong to a Document. They don't have
to be part of a hiearchy, though - you can create unattached Element
nodes with createElement[NS], and put them in a hierarchy as you like.

Regards,
Martin





More information about the Python-list mailing list