MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap
Revision 2 as of 2018-07-06 16:11:36
  • Python
  • minidom

Python minidom

DOM (Document Object Model interface)

  • https://docs.python.org/2/library/xml.dom.minidom.html

XML parse with minidom

   1 from xml.dom import minidom
   2 print("Hello world")
   3 a="<a><b>aaaa</b><b>bbcc</b></a>"
   4 doc = minidom.parseString(a) # return document 
   5 tags = doc.getElementsByTagName("b")
   6 for t in tags:
   7   print(t.firstChild.nodeValue)
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01