XPath evaluation in PHP with Namespaces

If you’re working with XPath in the DOMXML extensions to PHP, there’s an undocumented function you’ll probably need: xpath_register_ns (xpath context, namespace prefix, namespace uri).

Without it, you’ll have to write ugly XPath expressions for documents with a default namespace (such as those returned by FileMakerPro.)

Thanks to Brandon Whitehead for pointing it out in the annotated documentation.

Possibly Related posts (machine generated):

  1. PostgreSQL and XML
  2. PHP Xtree
  3. More on PHP XPath
  4. X Lab: interactive XSLT
  5. XPath Class for PHP

More like this: , .

blog comments powered by Disqus