Use python to process XML file

danmcleran at yahoo.com danmcleran at yahoo.com
Fri Mar 10 14:36:57 EST 2006


I have a little py module that implements the Composite pattern to
represent xml file contents. My class is called ExtensionRegistry
because that's what I use it for, you could rename it to whatever you
wanted. After parsing, this allows me to access my xml file contents
like this:

xmlFile = ExtensionRegistry(xmlFile = 'test.xml')

print xmlFile['log']['a'].getDataItems()

would result in printing

>>text

Let me know if you want me to send it to you.




More information about the Python-list mailing list