Parsing XML from a String : DOM : XML PYTHON TUTORIALS


PYTHON TUTORIALS » XML » DOM »

 

Parsing XML from a String


from xml.dom import minidom 

contents = "<grammar><ref id='bit'><para>0</para><para>1</para></ref></grammar>" 
xmldoc = minidom.parseString(contents)    
print xmldoc.toxml()



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo XML
» DOM