Every Element Is Searchable : XML Element « XML « Python






Every Element Is Searchable


from xml.dom import minidom 
xmldoc = minidom.parse('binary.xml') 
reflist = xmldoc.getElementsByTagName('ref')      

firstref = reflist[0]                             
print firstref.toxml() 

plist = firstref.getElementsByTagName("p")        

plist 

print plist[0].toxml()                            

print plist[1].toxml() 
           
       








Related examples in the same category

1.Get element by name
2.Searching Is Actually Recursive
3.Searching for XML Elements