Every Element Is Searchable : DOM : XML PYTHON TUTORIALS


PYTHON TUTORIALS » XML » DOM »

 

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")     
print plist 
print plist[0].toxml()                        
print plist[1].toxml()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo XML
» DOM