Skip to main content

Posts

Showing posts with the label python

Elegant XML parsing using the ElementTree Module

Mark Mruss, from the learningpython.com , wrote an interesting article on an " Elegant XML parsing using the ElementTree Module ". I had a little project on my job on which I had to read some XML data and make some reports with them. I am using PHP to that, but after reading this Mark Mruss's article, I am regretting not have started with Python since the begging. "XML is everywhere. It seems you can’t do much these days unless you utilize XML in one way or another. Fortunately, Python developers have a new tool in our standard arsenal: the ElementTree module. This article aims to introduce you to reading, writing, saving, and loading XML using the ElementTree module. Introduction Reading XML data Listing 1 Listing 2 Reading XML Attributes Writing XML Listing 3 Writing XML Attributes Reading XML Files Writing XML Data to a File Reading from the Web Conclusion" Read the entire article at learningpython.com