{"id":729,"date":"2012-01-24T15:22:00","date_gmt":"2012-01-24T15:22:00","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/Hayek\/Jochen\/wp\/blog-en\/2012\/01\/24\/perl-xmllibxmlxpathcontext-registerns\/"},"modified":"2012-01-24T15:22:00","modified_gmt":"2012-01-24T15:22:00","slug":"perl-xmllibxmlxpathcontext-registerns","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2012\/01\/24\/perl-xmllibxmlxpathcontext-registerns\/","title":{"rendered":"perl: XML::LibXML::XPathContext &#8211; registerNs"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/metacpan.org\/module\/XML::LibXML::XPathContext\">https:\/\/metacpan.org\/module\/XML::LibXML::XPathContext<\/a><\/li>\n<\/ul>\n<p><span style=\"line-height: 1.75\">If your XML has a namespace <\/span><u style=\"line-height: 1.75\">without<\/u><span style=\"line-height: 1.75\">\u00a0<\/span><i style=\"line-height: 1.75\">prefix<\/i><span style=\"line-height: 1.75\"> (xmlns=&#8221;\u2026&#8221; instead of xmlns:aaa=&#8221;\u2026&#8221;, where &#8216;aaa&#8217; would be called the <\/span><i style=\"line-height: 1.75\">prefix<\/i><span style=\"line-height: 1.75\">), you <\/span><u style=\"line-height: 1.75\">still<\/u><span style=\"line-height: 1.75\"> have to provide <\/span><i style=\"line-height: 1.75\">registerNs<\/i><span style=\"line-height: 1.75\"> with a proper <\/span><i style=\"line-height: 1.75\">prefix<\/i><span style=\"line-height: 1.75\"> and use that <\/span><i style=\"line-height: 1.75\">prefix <\/i><span style=\"line-height: 1.75\">from then on; no undef or zero-length string allowed as <\/span><i style=\"line-height: 1.75\">prefix<\/i><span style=\"line-height: 1.75\">.<\/span><\/p>\n<div>Learning this lesson cost me some sleep last night.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/metacpan.org\/module\/XML::LibXML::XPathContext If your XML has a namespace without\u00a0prefix (xmlns=&#8221;\u2026&#8221; instead of xmlns:aaa=&#8221;\u2026&#8221;, where &#8216;aaa&#8217; 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.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[666],"tags":[],"class_list":["post-729","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-bL","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/729","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=729"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/729\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}