Python and XML

Lots of noise about Python’s vast plethora of XML libraries from Nelson and responses from Uche. I still think it’s too complicated. Way too complicated. What I want to do is this:

>>> import xmllib
>>> xmldoc = xmllib.open("filename.xml")
>>> print xmldoc.xpath("//node1/node2")
[<DOM Element: node2 at 0x3457>, <DOM Element: node2 at 0x090532>]
>>> print xmldoc.dom.getElementsByTagName("node2")
[<DOM Element: node2 at 0x3457>, <DOM Element: node2 at 0x090532>]

That’d do me. In fact, I think I might write it.

I'm currently available for hire, to help you plan, architect, and build new systems, and for technical writing and articles. You can take a look at some projects I've worked on and some of my writing. If you'd like to talk about your upcoming project, do get in touch.

More in the discussion (powered by webmentions)

  • (no mentions, yet.)