Question about xml.com
J
python-list at smetj.net
Tue Mar 10 19:35:38 EDT 2009
Dear all,
I have loaded an xml file into xmldoc.
I would have expected that print commandlet.childNodes[0].toxml() would
contain the content but that's only at print
commandlet.childNodes[1].toxml()
The same for print commandlet.childNodes[2].toxml()
Why are commandlet.childNodes[0] and commandlet.childNodes[2] empty?
Thanks in advance!
J
>>> print xmldoc.firstChild.toxml()
0.1 Beta
test
just a test
somebody
linux2
0
3.19
>>> commandlet=xmldoc.firstChild
>>> print commandlet.firstChild.toxml()
>>> print commandlet.childNodes[0].toxml()
>>> print commandlet.childNodes[1].toxml()
0.1 Beta
test
just a test
somebody
linux2
0
3.19
>>> print commandlet.childNodes[2].toxml()
>>> print commandlet.childNodes[3].toxml()
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090311/6af77d2c/attachment.html>
More information about the Python-list
mailing list