Rigid XML Parsing
by in CodeSOD on 2008-06-30Sure, we've chronicled horrible methods of storing data in XML, but what about when you want to retrieve said data? If you're into .NET, you're probably thinking of something in the System.Xml namespace. If you're a Ruby developer, you're probably thinking of REXML. If you're using PHP, the XML Parser extension. If you're a COBOL programmer, then you're probably praying for death.
Well, if you consider yourself a senior-level XML developer, here's a new technique you can add to your repertoire, courtesy of Paul. Here's an example of a technique dubbed Case-Sensitive Replacement-Based Element Parsing, suitable for all* of your XML documents!