XML Parsers

Over the past few weeks at the office I’ve had a need for a couple of different XML Parsers; one for traditional ASP and one PHP. I’ve found a couple that seem to work well and thought I’d make a note of them before I lost them for good.

ASP XML Parser

Buster Collings only has one source code example out there, but it’s a good one. This code was used to bring in an RSS newsfeed from Thomson and display it on one of our clients’ home page. Fairly straightforward, but requires MSXML2 so you might need to upgrade your server if you’re running an older OS.

PHP XML Parsers

There are actually two PHP parsers I’ve found while working on my latest project, but they’re very similar; in fact, one was born from the other. A very common one is SimpleXML out on PHP.net, a fantastic PHP resource. This code works great for PHP5 and higher.

I, of course, am helping a client which is hosting their site on GoDaddy.com, which is still running PHP4 for some reason. The typical SimpleXML does not work on previous version of PHP, but luckily Adam Flynn had the same issue. He piggy-backed off the existing SimpleXML code and created an XML parser that is compatible with PHP4.

Leave a Reply