{"id":7268,"date":"2022-12-20T19:37:33","date_gmt":"2022-12-20T22:37:33","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/xmllibxmlnamespace-man3\/"},"modified":"2022-12-20T19:37:33","modified_gmt":"2022-12-20T22:37:33","slug":"xmllibxmlnamespace-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/xmllibxmlnamespace-man3\/","title":{"rendered":"XML::LibXML::Namespace (man3)"},"content":{"rendered":"<h1 align=\"center\">XML::LibXML::Namespace<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#METHODS\">METHODS<\/a><br \/> <a href=\"#AUTHORS\">AUTHORS<\/a><br \/> <a href=\"#VERSION\">VERSION<\/a><br \/> <a href=\"#COPYRIGHT\">COPYRIGHT<\/a><br \/> <a href=\"#LICENSE\">LICENSE<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">XML::LibXML::Namespace \u2212 XML::LibXML Namespace Implementation<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">use XML::LibXML; <br \/> # Only methods specific to Namespace nodes are listed here, <br \/> # see the XML::LibXML::Node manpage for other methods <br \/> my $ns = XML::LibXML::Namespace\u2212>new($nsURI); <br \/> print $ns\u2212>nodeName(); <br \/> print $ns\u2212>name(); <br \/> $localname = $ns\u2212>getLocalName(); <br \/> print $ns\u2212>getData(); <br \/> print $ns\u2212>getValue(); <br \/> print $ns\u2212>value(); <br \/> $known_uri = $ns\u2212>getNamespaceURI(); <br \/> $known_prefix = $ns\u2212>getPrefix(); <br \/> $key = $ns\u2212>unique_key();<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Namespace nodes are returned by both $element\u2212>findnodes(\u2019namespace::foo\u2019) or by $node\u2212><b>getNamespaces()<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The namespace node <small>API<\/small> is not part of any current <small>DOM API,<\/small> and so it is quite minimal. It should be noted that namespace nodes are <i>not<\/i> a sub class of XML::LibXML::Node, however Namespace nodes act a lot like attribute nodes, and similarly named methods will return what you would expect if you treated the namespace node as an attribute. Note that in order to fix several inconsistencies between the <small>API<\/small> and the documentation, the behavior of some functions have been changed in 1.64.<\/p>\n<h2>METHODS <a name=\"METHODS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"4%\">\n<p style=\"margin-top: 1em\">new<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"69%\">\n<p style=\"margin-top: 1em\">my $ns = XML::LibXML::Namespace\u2212>new($nsURI);<\/p>\n<\/td>\n<td width=\"11%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Creates a new Namespace node. Note that this is not a \u2019node\u2019 as an attribute or an element node. Therefore you can\u2019t do call all XML::LibXML::Node Functions. All functions available for this node are listed below.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Optionally you can pass the prefix to the namespace constructor. If this second parameter is omitted you will create a so called default namespace. Note, the newly created namespace is not bound to any document or node, therefore you should not expect it to be available in an existing document.<\/p>\n<p style=\"margin-left:11%;\">declaredURI<\/p>\n<p style=\"margin-left:17%;\">Returns the <small>URI<\/small> for this namespace.<\/p>\n<p style=\"margin-left:11%;\">declaredPrefix<\/p>\n<p style=\"margin-left:17%;\">Returns the prefix for this namespace.<\/p>\n<p style=\"margin-left:11%;\">nodeName<\/p>\n<p style=\"margin-left:17%;\">print $ns\u2212>nodeName();<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Returns &#8220;xmlns:prefix&#8221;, where prefix is the prefix for this namespace.<\/p>\n<p style=\"margin-left:11%;\">name<\/p>\n<p style=\"margin-left:17%;\">print $ns\u2212>name();<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Alias for <b>nodeName()<\/b><\/p>\n<p style=\"margin-left:11%;\">getLocalName<\/p>\n<p style=\"margin-left:17%;\">$localname = $ns\u2212>getLocalName();<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Returns the local name of this node as if it were an attribute, that is, the prefix associated with the namespace.<\/p>\n<p style=\"margin-left:11%;\">getData<\/p>\n<p style=\"margin-left:17%;\">print $ns\u2212>getData();<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Returns the <small>URI<\/small> of the namespace, i.e. the value of this node as if it were an attribute.<\/p>\n<p style=\"margin-left:11%;\">getValue<\/p>\n<p style=\"margin-left:17%;\">print $ns\u2212>getValue();<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Alias for <b>getData()<\/b><\/p>\n<p style=\"margin-left:11%;\">value<\/p>\n<p style=\"margin-left:17%;\">print $ns\u2212>value();<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Alias for <b>getData()<\/b><\/p>\n<p style=\"margin-left:11%;\">getNamespaceURI<\/p>\n<p style=\"margin-left:17%;\">$known_uri = $ns\u2212>getNamespaceURI();<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Returns the string &#8220;http:\/\/www.w3.org\/2000\/xmlns\/&#8221;<\/p>\n<p style=\"margin-left:11%;\">getPrefix<\/p>\n<p style=\"margin-left:17%;\">$known_prefix = $ns\u2212>getPrefix();<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Returns the string &#8220;xmlns&#8221;<\/p>\n<p style=\"margin-left:11%;\">unique_key<\/p>\n<p style=\"margin-left:17%;\">$key = $ns\u2212>unique_key();<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">This method returns a key guaranteed to be unique for this namespace, and to always be the same value for this namespace. Two namespace objects return the same key if and only if they have the same prefix and the same <small>URI.<\/small> The returned key value is useful as a key in hashes.<\/p>\n<h2>AUTHORS <a name=\"AUTHORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Matt Sergeant, Christian Glahn, Petr Pajas<\/p>\n<h2>VERSION <a name=\"VERSION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">2.0206<\/p>\n<h2>COPYRIGHT <a name=\"COPYRIGHT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">2001\u22122007, AxKit.com Ltd.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">2002\u22122006, Christian Glahn.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">2006\u22122009, Petr Pajas.<\/p>\n<h2>LICENSE <a name=\"LICENSE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This program is free software; you can redistribute it and\/or modify it under the same terms as Perl itself.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  XML::LibXML::Namespace \u2212 XML::LibXML Namespace Implementation <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3007,3593],"class_list":["post-7268","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-man3","tag-xmllibxmlnamespace"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7268"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7268\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}