{
    "mode": "perldoc",
    "parameter": "XML::LibXML::Namespace",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ALibXML%3A%3ANamespace/json",
    "generated": "2026-06-09T23:00:18Z",
    "synopsis": "use XML::LibXML;\n# Only methods specific to Namespace nodes are listed here,\n# see the XML::LibXML::Node manpage for other methods\nmy $ns = XML::LibXML::Namespace->new($nsURI);\nprint $ns->nodeName();\nprint $ns->name();\n$localname = $ns->getLocalName();\nprint $ns->getData();\nprint $ns->getValue();\nprint $ns->value();\n$knownuri = $ns->getNamespaceURI();\n$knownprefix = $ns->getPrefix();\n$key = $ns->uniquekey();",
    "sections": {
        "NAME": {
            "content": "XML::LibXML::Namespace - XML::LibXML Namespace Implementation\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use XML::LibXML;\n# Only methods specific to Namespace nodes are listed here,\n# see the XML::LibXML::Node manpage for other methods\n\nmy $ns = XML::LibXML::Namespace->new($nsURI);\nprint $ns->nodeName();\nprint $ns->name();\n$localname = $ns->getLocalName();\nprint $ns->getData();\nprint $ns->getValue();\nprint $ns->value();\n$knownuri = $ns->getNamespaceURI();\n$knownprefix = $ns->getPrefix();\n$key = $ns->uniquekey();\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Namespace nodes are returned by both $element->findnodes('namespace::foo') or by\n$node->getNamespaces().\n\nThe namespace node API is not part of any current DOM API, and so it is quite minimal. It should\nbe noted that namespace nodes are *not* a sub class of XML::LibXML::Node, however Namespace\nnodes act a lot like attribute nodes, and similarly named methods will return what you would\nexpect if you treated the namespace node as an attribute. Note that in order to fix several\ninconsistencies between the API and the documentation, the behavior of some functions have been\nchanged in 1.64.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "new\nmy $ns = XML::LibXML::Namespace->new($nsURI);\n\nCreates a new Namespace node. Note that this is not a 'node' as an attribute or an element\nnode. Therefore you can't do call all XML::LibXML::Node Functions. All functions available\nfor this node are listed below.\n\nOptionally you can pass the prefix to the namespace constructor. If this second parameter is\nomitted you will create a so called default namespace. Note, the newly created namespace is\nnot bound to any document or node, therefore you should not expect it to be available in an\nexisting document.\n\ndeclaredURI\nReturns the URI for this namespace.\n\ndeclaredPrefix\nReturns the prefix for this namespace.\n\nnodeName\nprint $ns->nodeName();\n\nReturns \"xmlns:prefix\", where prefix is the prefix for this namespace.\n\nname\nprint $ns->name();\n\nAlias for nodeName()\n\ngetLocalName\n$localname = $ns->getLocalName();\n\nReturns the local name of this node as if it were an attribute, that is, the prefix\nassociated with the namespace.\n\ngetData\nprint $ns->getData();\n\nReturns the URI of the namespace, i.e. the value of this node as if it were an attribute.\n\ngetValue\nprint $ns->getValue();\n\nAlias for getData()\n\nvalue\nprint $ns->value();\n\nAlias for getData()\n\ngetNamespaceURI\n$knownuri = $ns->getNamespaceURI();\n\nReturns the string \"http://www.w3.org/2000/xmlns/\"\n\ngetPrefix\n$knownprefix = $ns->getPrefix();\n\nReturns the string \"xmlns\"\n\nuniquekey\n$key = $ns->uniquekey();\n\nThis method returns a key guaranteed to be unique for this namespace, and to always be the\nsame value for this namespace. Two namespace objects return the same key if and only if they\nhave the same prefix and the same URI. The returned key value is useful as a key in hashes.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Matt Sergeant, Christian Glahn, Petr Pajas\n",
            "subsections": []
        },
        "VERSION": {
            "content": "2.0134\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "2001-2007, AxKit.com Ltd.\n\n2002-2006, Christian Glahn.\n\n2006-2009, Petr Pajas.\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "This program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        }
    },
    "summary": "XML::LibXML::Namespace - XML::LibXML Namespace Implementation",
    "flags": [],
    "examples": [],
    "see_also": []
}