September 13, 2004

Great tool for XPath, the Query Language From HELL

XPath Explorer

I hate XPath. I think that while it does have an immense amount of power behind it, the sheer lack of usability behind it makes me think that it was designed by people who wanted job security. Kind of like a 7Mb obfuscated Perl script on acid. (Isn't "obfuscated Perl" redundant?)

Anyway, today I needed to write an XPath query to extract information from an XML document returned by a web service. (Yes, the web service returned an XML document as a string inside a SOAP wrapper...don't ask.)

Well, this was a wonderful XML document in that it had several dozen subkeys with identical names that differed solely based on an attribute value or two. Unfortunately, my grasp of XPath is limited to semi-sensible uses for semi-sensible schemas, so I was at a loss.

I found this tool after about 35 minutes of using Google, downloaded it, and had the majority of my XPath query within two minutes. The remainder took about 5 minutes of referring to page 181 of Lee Anne Phillips' "Using XML: Special Edition" from QUE.

This tool now has a permanent home in my toolbox.

No comments: