Child Nodes Can Be Text : XML Children Node « XML « Python






Child Nodes Can Be Text

Child Nodes Can Be Text
from xml.dom import minidom              
xmldoc = minidom.parse('binary.xml') 

grammarNode = xmldoc.firstChild 


grammarNode.childNodes                             

print grammarNode.firstChild.toxml()               

print grammarNode.childNodes[1].toxml()            

print grammarNode.lastChild.toxml()                
           
       








Related examples in the same category

1.Getting Child Nodes
2.toxml Works on Any Nodetoxml Works on Any Node
3.Caching Node Lookups
4.Finding the Direct Children of a Node