strange output from Python 3 ElementTree

z2k

New Member
I'm parsing a really simple \[code\].xml\[/code\] file with this snippet\[code\]import xml.etree.ElementTree as etreetree = etree.parse('/home/user/dummy.xml')print(tree.getroot())\[/code\]the output is \[code\]<Element 'doc' at 0x1d2f090>\[/code\]which is correct, but I was expecting something cleaner and as simple as\[code\]doc\[/code\]is this the normal output ? How I can clean this ?I'm using Python 3.x the \[code\]dummy.xml\[/code\] file\[code\]<?xml version="1.0"?><doc> <branch name="testing" hash="1cdf045c"> text,source </branch> <branch name="release01" hash="f200013e"> <sub-branch name="subrelease01"> xml,sgml </sub-branch> </branch> <branch name="invalid"> </branch></doc>\[/code\]
 
Back
Top