perl: XML::LibXML::XPathContext – registerNs

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.

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.