Parsing XML from Strings : XML Parse : XML : Python examples (example source code) Organized by topic

C++
PHP
Python
Python Home »  XML   » [  XML Parse  ]  Screenshots 
 



Parsing XML from Strings



from xml.dom import minidom

contents = "<grammar><ref id='bit'><p>0</p><p>1</p></ref></grammar>" 
xmldoc = minidom.parseString(contents)             
print xmldoc.toxml() 
           
       
Related examples in the same category
1.  Parsing XML from Local Files and Remote URLs Parsing XML from Local Files and Remote URLs
2.  Parsing XML from a URL
3.  Parsing XML: Loading an XML Document
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.