Hi all,
I am wondering why the following returns empty results:
print commandlet.firstChild.toxml()
print commandlet.childNodes[0].toxml() #this is the same as firstChild
print commandlet.childNodes[2].toxml()
It must be something I overlook, ... but I can't put my finger on it.
Thanks for having a look on it,
Here's the complete picture:
>>> from xml.dom import minidom
>>> xmldoc = minidom.parse('/tmp/test.xml')
>>> print xmldoc.firstChild.toxml()
<commandlet>
<properties>
<version>0.1 Beta</version>
<name>test</name>
<description>just a test</description>
<author>somebody</author>
<platform>linux2</platform>
<exitcode>0</exitcode>
<errors/>
<totaltime>3.19</totaltime>
</properties>
<grid>
<row number="2">
<column number="8" value="100"/>
</row>
<row number="3">
<column number="8" value="97.8"/>
</row>
<row number="4">
<column number="8" value="97.7"/>
</row>
<row number="5">
<column number="8" value="97.6"/>
</row>
</grid>
</commandlet>
>>> commandlet=xmldoc.firstChild
>>> print commandlet.firstChild.toxml()
>>> print commandlet.childNodes[0].toxml()
>>> print commandlet.childNodes[1].toxml()
<properties>
<version>0.1 Beta</version>
<name>test</name>
<description>just a test</description>
<author>somebody</author>
<platform>linux2</platform>
<exitcode>0</exitcode>
<errors/>
<totaltime>3.19</totaltime>
</properties>
>>> print commandlet.childNodes[2].toxml()
>>> print commandlet.childNodes[3].toxml()
<grid>
<row number="2">
<column number="8" value="100"/>
</row>
<row number="3">
<column number="8" value="97.8"/>
</row>
<row number="4">
<column number="8" value="97.7"/>
</row>
<row number="5">
<column number="8" value="97.6"/>
</row>
</grid>
>>>
Bookmarks