Child Nodes Can Be Text : DOM : XML PYTHON TUTORIALS


PYTHON TUTORIALS » XML » DOM »

 

Child Nodes Can Be Text


from xml.dom import minidom                                        
xmldoc = minidom.parse('binary.xml')     
print xmldoc                                                                 
grammarNode = xmldoc.firstChild 
print grammarNode.childNodes                    
print grammarNode.firstChild.toxml()           
print grammarNode.childNodes[1].toxml()       
print grammarNode.childNodes[3].toxml()         
print grammarNode.lastChild.toxml()



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo XML
» DOM