[code.view]

[top] / python / PyMOTW / xml / etree / ElementTree / ElementTree_entity_references.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2010 Doug Hellmann.  All rights reserved.
     #
     """Dump the OPML in plain text
     """
     #end_pymotw_header
     
     from xml.etree import ElementTree
     
     with open('data.xml', 'rt') as f:
         tree = ElementTree.parse(f)
     
     node = tree.find('entity_expansion')
     print node.tag
     print '  in attribute:', node.attrib['attribute']
     print '  in text     :', node.text
     

[top] / python / PyMOTW / xml / etree / ElementTree / ElementTree_entity_references.py

contact | logmethods.com