How to read out tag from xml?

I have some problem to read out info from this xml:\[code\]<entry number="50" date="2011-01-29"> <name>Info text about account</name> <row account="1930" debit="0" credit="2051"/> <row account="1471" debit="410" credit="0"/> <row account="4404" debit="1641" credit="0"/></entry>\[/code\]I use this code \[code\]def printInfoOfVerification(): valFound = 0 print("Now system will print information about a verification nr in xml:") val = input("Enter verification number: ") verificationNumbr = xmltree.iter('entry') for i in verificationNumbr: if (i.attrib['number']) == val: valFound = 1 print("Verification number:",val, "found") print("Info about verification:") print(i.attrib['date']) if valFound == 0: print("Verification number not found:",val)\[/code\]If "val" is = 50 this will produce:\[code\]Verification number: 50 foundInfo about verification:2011-01-29\[/code\]But the problem is, I also want to print the info in the tag "name", so for this example it should look like this:\[code\]Verification number: 50 foundInfo about verification:2011-01-29Info text about account\[/code\]I have tried to read in name tag with xmltree.iter('name') and other ways but without success :( Do anyone know how to do this?Thx
 
Back
Top