Tuesday, January 24, 2012

perl: XML::LibXML::XPathContext - registerNs

XML::LibXML::XPathContext - XPath Evaluation - metacpan.org

If your XML has a namespace without prefix (xmlns="…" instead of xmlns:aaa="…", where 'aaa' would be called the prefix), you still have to provide registerNs with a proper prefix and use that prefix from then on; no undef or zero-length string allowed as prefix.
Learning this lesson cost me some sleep last night.

No comments: