How Namespaces Can Hose Your XPath Queries in PHP

Album Cover: White Blood Cells

"Every breath that is in your lungs is a tiny little gift to me."
White Stripes / Dead Leaves and the Dirty Ground

Posted on January 28, 2009 7:34 PM in XML
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

A few weeks back I encountered a problem with PHP's SimpleXMLElement->xpath() function. As it turns out, this problem is well known. What occurred to me recently, though, is that this is all related to the issue I covered a week ago in C#. In this case, though, PHP doesn't have a clean solution to the problem yet (though there most certainly is a solution), whereas C# does.


sjiikncj on May 15, 2017 at 5:23 AM:

Post Comments

If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.


Email Address:



Check this box if you hate spam.