nivashno, 19.11.2011 22:32:
I've got this code:
>>> dom = xml.dom.minidom.parse('myfile.xml')
>>> for testnode in dom.getElementsByTagName('tests')[0].childNodes:
... print testnode
When it's working on this xml:
something
I get the following:
But when it's working
On Sat, 19 Nov 2011 15:32:18 -0600, nivashno wrote:
> I always thought that xml was very precisely split up into nodes,
> childnodes, etc, no matter what the whitespace between them was. But
> apparently not, or am I missing something?
XML allows mixed content (an element's children can be a mi
nivashno writes:
> I always thought that xml was very precisely split up into nodes,
> childnodes, etc, no matter what the whitespace between them was. But
> apparently not, or am I missing something?
The whitespace in your example becomes part of a data element.
--
http://mail.python.org/mail