Title photo
frugal technology, simple living and guerrilla large-appliance repair
Mon, 23 Jun 2014

Using Perl modules to parse an XML feed

I'm looking to figure out all the elements I need to convert my election-results Bash script to Perl, and one of the tasks involved is dealing with XML.

In the Bash script, I'm just treating the XML as text that needs to be hacked at with sed.

But in Perl, as in many languages I presume, there are modules to help with this.

XML::Simple takes a file in XML format and converts it to a "Perl representation," one of those "representations" being a Perl array. Here are some other links on parsing XML in Perl.

Perl Begin recommends avoiding XML::Simple and instead using XML::LibXML.

Now I'll have to figure out what to do with the data after Perl deals with the XML so I can turn it into the HTML I'll need later in the program.

I won't lie by saying that it is a lot easier to find recently written XML-parsing strategies for Python than it is for Perl.

With that in mind, before I close out this entry, here are some links on parsing XML in Python.