[XML-SIG] Re: Ignoring whitespace with DOM

Randall Hopper aa8vb@yahoo.com
Fri, 10 Dec 1999 13:33:51 -0500


Randall Hopper:
 |With the Python DOM, is there a supported method to configure whitespace
 |parsing?  (Possibly something like SAX's ignorableWhitespace which saw
 |mentioned.)
...
 |<root>
 |  <element1>Data 1</element1>
 |  <element2/>
 |</root>
...
 |element1  = rootNode.childNodes.item(0)
 |element2  = rootNode.childNodes.item(1)


In case it helps, what prompted me to ask is that I'm trying XML DOM
examples listed in this book I'm reading.  I'm pulling out simple DOM code
and XML data island snippets in MSIE5 Javascript and keying them into
Python to try.  It appears that MSIE5's XML DOM is somehow filtering out
the whitespace.

For example, item(1) refers to element2 in the XML and doesn't seem to be
thrown off by spaces and line breaks in the XML data.

Randall