- From: Thomas Mueller <tomtom.mueller@gmx.de>
- Date: Wed, 8 Sep 2004 14:06:44 +0700
- To: "public-compound-documents lists.w3.org" <public-compound-documents@w3.org>
Received on Wednesday, 8 September 2004 07:07:31 UTC
> > I'm getting somewhat painfully acquainted with xml.dom.minidom. What is > > the relationship between its documentElement attribute and its childNodes > > list? > > I thought XML documents consisted of a single, possibly compound, node. > > Why is a list of childNodes needed? > >>> import xml.dom.minidom as md > >>> dom = md.parseString("""<?xml version="1.0" ?><!--comment--><root/>""") > >>> dom.childNodes [<DOM Comment node "comment">, <DOM Element: root at 0x4038c1ac>] > >>> > > Seems like comments are preserved in childNodes, too. Comments, processing instructions and whitespace text nodes can come before the document element, and in that way becoem the children of the document node. Minidom doesn't keep document-level whitespace, but som DOM impls do. Furthermore the doctype of the document is a child of the document node. --- GoldED/386 2.42.G0614+ * Origin: Everything goes the bach runter ... * http://online6casino.com
Received on Wednesday, 8 September 2004 07:07:31 UTC