{
    "mode": "perldoc",
    "parameter": "XML::LibXML::Node",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ALibXML%3A%3ANode/json",
    "generated": "2026-06-10T23:09:05Z",
    "synopsis": "use XML::LibXML;\n$name = $node->nodeName;\n$node->setNodeName( $newName );\n$bool = $node->isSameNode( $othernode );\n$bool = $node->isEqual( $othernode );\n$num = $node->uniquekey;\n$content = $node->nodeValue;\n$content = $node->textContent;\n$type = $node->nodeType;\n$node->unbindNode();\n$childnode = $node->removeChild( $childnode );\n$oldnode = $node->replaceChild( $newNode, $oldNode );\n$node->replaceNode($newNode);\n$childnode = $node->appendChild( $childnode );\n$childnode = $node->addChild( $childnode );\n$node = $parent->addNewChild( $nsURI, $name );\n$node->addSibling($newNode);\n$newnode =$node->cloneNode( $deep );\n$parentnode = $node->parentNode;\n$nextnode = $node->nextSibling();\n$nextnode = $node->nextNonBlankSibling();\n$prevnode = $node->previousSibling();\n$prevnode = $node->previousNonBlankSibling();\n$boolean = $node->hasChildNodes();\n$childnode = $node->firstChild;\n$childnode = $node->lastChild;\n$documentnode = $node->ownerDocument;\n$node = $node->getOwner;\n$node->setOwnerDocument( $doc );\n$node->insertBefore( $newNode, $refNode );\n$node->insertAfter( $newNode, $refNode );\n@nodes = $node->findnodes( $xpathexpression );\n$result = $node->find( $xpath );\nprint $node->findvalue( $xpath );\n$bool = $node->exists( $xpathexpression );\n@childnodes = $node->childNodes();\n@childnodes = $node->nonBlankChildNodes();\n$xmlstring = $node->toString($format,$docencoding);\n$c14nstring = $node->toStringC14N();\n$c14nstring = $node->toStringC14N($withcomments, $xpathexpression , $xpathcontext);\n$c14nstring = $node->toStringC14Nv11();\n$c14nstring = $node->toStringC14Nv11($withcomments, $xpathexpression , $xpathcontext);\n$ec14nstring = $node->toStringEC14N();\n$ec14nstring = $node->toStringEC14N($withcomments, $xpathexpression, $inclusiveprefixlist);\n$ec14nstring = $node->toStringEC14N($withcomments, $xpathexpression, $xpathcontext, $inclusiveprefixlist);\n$str = $doc->serialize($format);\n$localname = $node->localname;\n$nameprefix = $node->prefix;\n$uri = $node->namespaceURI();\n$boolean = $node->hasAttributes();\n@attributelist = $node->attributes();\n$URI = $node->lookupNamespaceURI( $prefix );\n$prefix = $node->lookupNamespacePrefix( $URI );\n$node->normalize;\n@nslist = $node->getNamespaces;\n$node->removeChildNodes();\n$strURI = $node->baseURI();\n$node->setBaseURI($strURI);\n$node->nodePath();\n$lineno = $node->linenumber();",
    "sections": {
        "NAME": {
            "content": "XML::LibXML::Node - Abstract Base Class of XML::LibXML Nodes\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use XML::LibXML;\n\n$name = $node->nodeName;\n$node->setNodeName( $newName );\n$bool = $node->isSameNode( $othernode );\n$bool = $node->isEqual( $othernode );\n$num = $node->uniquekey;\n$content = $node->nodeValue;\n$content = $node->textContent;\n$type = $node->nodeType;\n$node->unbindNode();\n$childnode = $node->removeChild( $childnode );\n$oldnode = $node->replaceChild( $newNode, $oldNode );\n$node->replaceNode($newNode);\n$childnode = $node->appendChild( $childnode );\n$childnode = $node->addChild( $childnode );\n$node = $parent->addNewChild( $nsURI, $name );\n$node->addSibling($newNode);\n$newnode =$node->cloneNode( $deep );\n$parentnode = $node->parentNode;\n$nextnode = $node->nextSibling();\n$nextnode = $node->nextNonBlankSibling();\n$prevnode = $node->previousSibling();\n$prevnode = $node->previousNonBlankSibling();\n$boolean = $node->hasChildNodes();\n$childnode = $node->firstChild;\n$childnode = $node->lastChild;\n$documentnode = $node->ownerDocument;\n$node = $node->getOwner;\n$node->setOwnerDocument( $doc );\n$node->insertBefore( $newNode, $refNode );\n$node->insertAfter( $newNode, $refNode );\n@nodes = $node->findnodes( $xpathexpression );\n$result = $node->find( $xpath );\nprint $node->findvalue( $xpath );\n$bool = $node->exists( $xpathexpression );\n@childnodes = $node->childNodes();\n@childnodes = $node->nonBlankChildNodes();\n$xmlstring = $node->toString($format,$docencoding);\n$c14nstring = $node->toStringC14N();\n$c14nstring = $node->toStringC14N($withcomments, $xpathexpression , $xpathcontext);\n$c14nstring = $node->toStringC14Nv11();\n$c14nstring = $node->toStringC14Nv11($withcomments, $xpathexpression , $xpathcontext);\n$ec14nstring = $node->toStringEC14N();\n$ec14nstring = $node->toStringEC14N($withcomments, $xpathexpression, $inclusiveprefixlist);\n$ec14nstring = $node->toStringEC14N($withcomments, $xpathexpression, $xpathcontext, $inclusiveprefixlist);\n$str = $doc->serialize($format);\n$localname = $node->localname;\n$nameprefix = $node->prefix;\n$uri = $node->namespaceURI();\n$boolean = $node->hasAttributes();\n@attributelist = $node->attributes();\n$URI = $node->lookupNamespaceURI( $prefix );\n$prefix = $node->lookupNamespacePrefix( $URI );\n$node->normalize;\n@nslist = $node->getNamespaces;\n$node->removeChildNodes();\n$strURI = $node->baseURI();\n$node->setBaseURI($strURI);\n$node->nodePath();\n$lineno = $node->linenumber();\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "XML::LibXML::Node defines functions that are common to all Node Types. An XML::LibXML::Node\nshould never be created standalone, but as an instance of a high level class such as\nXML::LibXML::Element or XML::LibXML::Text. The class itself should provide only common\nfunctionality. In XML::LibXML each node is part either of a document or a document-fragment.\nBecause of this there is no node without a parent. This may causes confusion with \"unbound\"\nnodes.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Many functions listed here are extensively documented in the DOM Level 3 specification\n(<http://www.w3.org/TR/DOM-Level-3-Core/>). Please refer to the specification for extensive\ndocumentation.\n\nnodeName\n$name = $node->nodeName;\n\nReturns the node's name. This function is aware of namespaces and returns the full name of\nthe current node (\"prefix:localname\").\n\nSince 1.62 this function also returns the correct DOM names for node types with constant\nnames, namely: #text, #cdata-section, #comment, #document, #document-fragment.\n\nsetNodeName\n$node->setNodeName( $newName );\n\nIn very limited situations, it is useful to change a nodes name. In the DOM specification\nthis should throw an error. This Function is aware of namespaces.\n\nisSameNode\n$bool = $node->isSameNode( $othernode );\n\nreturns TRUE (1) if the given nodes refer to the same node structure, otherwise FALSE (0) is\nreturned.\n\nisEqual\n$bool = $node->isEqual( $othernode );\n\ndeprecated version of isSameNode().\n\n*NOTE* isEqual will change behaviour to follow the DOM specification\n\nuniquekey\n$num = $node->uniquekey;\n\nThis function is not specified for any DOM level. It returns a key guaranteed to be unique\nfor this node, and to always be the same value for this node. In other words, two node\nobjects return the same key if and only if isSameNode indicates that they are the same node.\n\nThe returned key value is useful as a key in hashes.\n\nnodeValue\n$content = $node->nodeValue;\n\nIf the node has any content (such as stored in a \"text node\") it can get requested through\nthis function.\n\n*NOTE:* Element Nodes have no content per definition. To get the text value of an Element\nuse textContent() instead!\n\ntextContent\n$content = $node->textContent;\n\nthis function returns the content of all text nodes in the descendants of the given node as\nspecified in DOM.\n\nnodeType\n$type = $node->nodeType;\n\nReturn a numeric value representing the node type of this node. The module XML::LibXML by\ndefault exports constants for the node types (see the EXPORT section in the XML::LibXML\nmanual page).\n\nunbindNode\n$node->unbindNode();\n\nUnbinds the Node from its siblings and Parent, but not from the Document it belongs to. If\nthe node is not inserted into the DOM afterwards, it will be lost after the program\nterminates. From a low level view, the unbound node is stripped from the context it is and\ninserted into a (hidden) document-fragment.\n\nremoveChild\n$childnode = $node->removeChild( $childnode );\n\nThis will unbind the Child Node from its parent $node. The function returns the unbound\nnode. If \"oldNode\" is not a child of the given Node the function will fail.\n\nreplaceChild\n$oldnode = $node->replaceChild( $newNode, $oldNode );\n\nReplaces the $oldNode with the $newNode. The $oldNode will be unbound from the Node. This\nfunction differs from the DOM L2 specification, in the case, if the new node is not part of\nthe document, the node will be imported first.\n\nreplaceNode\n$node->replaceNode($newNode);\n\nThis function is very similar to replaceChild(), but it replaces the node itself rather than\na childnode. This is useful if a node found by any XPath function, should be replaced.\n\nappendChild\n$childnode = $node->appendChild( $childnode );\n\nThe function will add the $childnode to the end of $node's children. The function should\nfail, if the new childnode is already a child of $node. This function differs from the DOM\nL2 specification, in the case, if the new node is not part of the document, the node will be\nimported first.\n\naddChild\n$childnode = $node->addChild( $childnode );\n\nAs an alternative to appendChild() one can use the addChild() function. This function is a\nbit faster, because it avoids all DOM conformity checks. Therefore this function is quite\nuseful if one builds XML documents in memory where the order and ownership (\"ownerDocument\")\nis assured.\n\naddChild() uses libxml2's own xmlAddChild() function. Thus it has to be used with extra\ncare: If a text node is added to a node and the node itself or its last childnode is as well\na text node, the node to add will be merged with the one already available. The current node\nwill be removed from memory after this action. Because perl is not aware of this action, the\nperl instance is still available. XML::LibXML will catch the loss of a node and refuse to\nrun any function called on that node.\n\nmy $t1 = $doc->createTextNode( \"foo\" );\nmy $t2 = $doc->createTextNode( \"bar\" );\n$t1->addChild( $t2 );       # is OK\nmy $val = $t2->nodeValue(); # will fail, script dies\n\nAlso addChild() will not check if the added node belongs to the same document as the node it\nwill be added to. This could lead to inconsistent documents and in more worse cases even to\nmemory violations, if one does not keep track of this issue.\n\nAlthough this sounds like a lot of trouble, addChild() is useful if a document is built from\na stream, such as happens sometimes in SAX handlers or filters.\n\nIf you are not sure about the source of your nodes, you better stay with appendChild(),\nbecause this function is more user friendly in the sense of being more error tolerant.\n\naddNewChild\n$node = $parent->addNewChild( $nsURI, $name );\n\nSimilar to \"addChild()\", this function uses low level libxml2 functionality to provide\nfaster interface for DOM building. *addNewChild()* uses \"xmlNewChild()\" to create a new node\non a given parent element.\n\naddNewChild() has two parameters $nsURI and $name, where $nsURI is an (optional) namespace\nURI. $name is the fully qualified element name; addNewChild() will determine the correct\nprefix if necessary.\n\nThe function returns the newly created node.\n\nThis function is very useful for DOM building, where a created node can be directly\nassociated with its parent. *NOTE* this function is not part of the DOM specification and\nits use will limit your code to XML::LibXML.\n\naddSibling\n$node->addSibling($newNode);\n\naddSibling() allows adding an additional node to the end of a nodelist, defined by the given\nnode.\n\ncloneNode\n$newnode =$node->cloneNode( $deep );\n\n*cloneNode* creates a copy of $node. When $deep is set to 1 (true) the function will copy\nall child nodes as well. If $deep is 0 only the current node will be copied. Note that in\ncase of element, attributes are copied even if $deep is 0.\n\nNote that the behavior of this function for $deep=0 has changed in 1.62 in order to be\nconsistent with the DOM spec (in older versions attributes and namespace information was not\ncopied for elements).\n\nparentNode\n$parentnode = $node->parentNode;\n\nReturns simply the Parent Node of the current node.\n\nnextSibling\n$nextnode = $node->nextSibling();\n\nReturns the next sibling if any .\n\nnextNonBlankSibling\n$nextnode = $node->nextNonBlankSibling();\n\nReturns the next non-blank sibling if any (a node is blank if it is a Text or CDATA node\nconsisting of whitespace only). This method is not defined by DOM.\n\npreviousSibling\n$prevnode = $node->previousSibling();\n\nAnalogous to *getNextSibling* the function returns the previous sibling if any.\n\npreviousNonBlankSibling\n$prevnode = $node->previousNonBlankSibling();\n\nReturns the previous non-blank sibling if any (a node is blank if it is a Text or CDATA node\nconsisting of whitespace only). This method is not defined by DOM.\n\nhasChildNodes\n$boolean = $node->hasChildNodes();\n\nIf the current node has child nodes this function returns TRUE (1), otherwise it returns\nFALSE (0, not undef).\n\nfirstChild\n$childnode = $node->firstChild;\n\nIf a node has child nodes this function will return the first node in the child list.\n\nlastChild\n$childnode = $node->lastChild;\n\nIf the $node has child nodes this function returns the last child node.\n\nownerDocument\n$documentnode = $node->ownerDocument;\n\nThrough this function it is always possible to access the document the current node is bound\nto.\n\ngetOwner\n$node = $node->getOwner;\n\nThis function returns the node the current node is associated with. In most cases this will\nbe a document node or a document fragment node.\n\nsetOwnerDocument\n$node->setOwnerDocument( $doc );\n\nThis function binds a node to another DOM. This method unbinds the node first, if it is\nalready bound to another document.\n\nThis function is the opposite calling of XML::LibXML::Document's adoptNode() function.\nBecause of this it has the same limitations with Entity References as adoptNode().\n\ninsertBefore\n$node->insertBefore( $newNode, $refNode );\n\nThe method inserts $newNode before $refNode. If $refNode is undefined, the newNode will be\nset as the new last child of the parent node. This function differs from the DOM L2\nspecification, in the case, if the new node is not part of the document, the node will be\nimported first, automatically.\n\n$refNode has to be passed to the function even if it is undefined:\n\n$node->insertBefore( $newNode, undef ); # the same as $node->appendChild( $newNode );\n$node->insertBefore( $newNode ); # wrong\n\nNote, that the reference node has to be a direct child of the node the function is called\non. Also, $newChild is not allowed to be an ancestor of the new parent node.\n\ninsertAfter\n$node->insertAfter( $newNode, $refNode );\n\nThe method inserts $newNode after $refNode. If $refNode is undefined, the newNode will be\nset as the new last child of the parent node.\n\nNote, that $refNode has to be passed explicitly even if it is undef.\n\nfindnodes\n@nodes = $node->findnodes( $xpathexpression );\n\n*findnodes* evaluates the xpath expression (XPath 1.0) on the current node and returns the\nresulting node set as an array. In scalar context, returns an XML::LibXML::NodeList object.\n\nThe xpath expression can be passed either as a string, or as a XML::LibXML::XPathExpression\nobject.\n\n*NOTE ON NAMESPACES AND XPATH*:\n\nA common mistake about XPath is to assume that node tests consisting of an element name with\nno prefix match elements in the default namespace. This assumption is wrong - by XPath\nspecification, such node tests can only match elements that are in no (i.e. null) namespace.\n\nSo, for example, one cannot match the root element of an XHTML document with\n\"$node->find('/html')\" since '/html' would only match if the root element \"<html>\" had no\nnamespace, but all XHTML elements belong to the namespace http://www.w3.org/1999/xhtml.\n(Note that \"xmlns=\"...\"\" namespace declarations can also be specified in a DTD, which makes\nthe situation even worse, since the XML document looks as if there was no default\nnamespace).\n\nThere are several possible ways to deal with namespaces in XPath:\n\n*   The recommended way is to use the XML::LibXML::XPathContext module to define an explicit\ncontext for XPath evaluation, in which a document independent prefix-to-namespace\nmapping can be defined. For example:\n\nmy $xpc = XML::LibXML::XPathContext->new;\n$xpc->registerNs('x', 'http://www.w3.org/1999/xhtml');\n$xpc->find('/x:html',$node);\n\n*   Another possibility is to use prefixes declared in the queried document (if known). If\nthe document declares a prefix for the namespace in question (and the context node is in\nthe scope of the declaration), \"XML::LibXML\" allows you to use the prefix in the XPath\nexpression, e.g.:\n\n$node->find('/x:html');\n\nSee also XML::LibXML::XPathContext->findnodes.\n\nfind\n$result = $node->find( $xpath );\n\n*find* evaluates the XPath 1.0 expression using the current node as the context of the\nexpression, and returns the result depending on what type of result the XPath expression\nhad. For example, the XPath \"1 * 3 + 52\" results in a XML::LibXML::Number object being\nreturned. Other expressions might return an XML::LibXML::Boolean object, or an\nXML::LibXML::Literal object (a string). Each of those objects uses Perl's overload feature\nto \"do the right thing\" in different contexts.\n\nThe xpath expression can be passed either as a string, or as a XML::LibXML::XPathExpression\nobject.\n\nSee also XML::LibXML::XPathContext->find.\n\nfindvalue\nprint $node->findvalue( $xpath );\n\n*findvalue* is exactly equivalent to:\n\n$node->find( $xpath )->toliteral;\n\nThat is, it returns the literal value of the results. This enables you to ensure that you\nget a string back from your search, allowing certain shortcuts. This could be used as the\nequivalent of XSLT's <xsl:value-of select=\"somexpath\"/>.\n\nSee also XML::LibXML::XPathContext->findvalue.\n\nThe xpath expression can be passed either as a string, or as a XML::LibXML::XPathExpression\nobject.\n\nexists\n$bool = $node->exists( $xpathexpression );\n\nThis method behaves like *findnodes*, except that it only returns a boolean value (1 if the\nexpression matches a node, 0 otherwise) and may be faster than *findnodes*, because the\nXPath evaluation may stop early on the first match (this is true for libxml2 >= 2.6.27).\n\nFor XPath expressions that do not return node-set, the method returns true if the returned\nvalue is a non-zero number or a non-empty string.\n\nchildNodes\n@childnodes = $node->childNodes();\n\n*childNodes* implements a more intuitive interface to the childnodes of the current node. It\nenables you to pass all children directly to a \"map\" or \"grep\". If this function is called\nin scalar context, a XML::LibXML::NodeList object will be returned.\n\nnonBlankChildNodes\n@childnodes = $node->nonBlankChildNodes();\n\nThis is like *childNodes*, but returns only non-blank nodes (where a node is blank if it is\na Text or CDATA node consisting of whitespace only). This method is not defined by DOM.\n\ntoString\n$xmlstring = $node->toString($format,$docencoding);\n\nThis method is similar to the method \"toString\" of a XML::LibXML::Document but for a single\nnode. It returns a string consisting of XML serialization of the given node and all its\ndescendants. Unlike \"XML::LibXML::Document::toString\", in this case the resulting string is\nby default a character string (UTF-8 encoded with UTF8 flag on). An optional flag $format\ncontrols indentation, as in \"XML::LibXML::Document::toString\". If the second optional\n$docencoding flag is true, the result will be a byte string in the document encoding (see\n\"XML::LibXML::Document::actualEncoding\").\n\ntoStringC14N\n$c14nstring = $node->toStringC14N();\n$c14nstring = $node->toStringC14N($withcomments, $xpathexpression , $xpathcontext);\n\nThe function is similar to toString(). Instead of simply serializing the document tree, it\ntransforms it as it is specified in the XML-C14N Specification (see\n<http://www.w3.org/TR/xml-c14n>). Such transformation is known as canonization.\n\nIf $withcomments is 0 or not defined, the result-document will not contain any comments\nthat exist in the original document. To include comments into the canonized document,\n$withcomments has to be set to 1.\n\nThe parameter $xpathexpression defines the nodeset of nodes that should be visible in the\nresulting document. This can be used to filter out some nodes. One has to note, that only\nthe nodes that are part of the nodeset, will be included into the result-document. Their\nchild-nodes will not exist in the resulting document, unless they are part of the nodeset\ndefined by the xpath expression.\n\nIf $xpathexpression is omitted or empty, toStringC14N() will include all nodes in the given\nsub-tree, using the following XPath expressions: with comments\n\n(. | .//node() | .//@* | .//namespace::*)\n\nand without comments\n\n(. | .//node() | .//@* | .//namespace::*)[not(self::comment())]\n\nAn optional parameter $xpathcontext can be used to pass an XML::LibXML::XPathContext object\ndefining the context for evaluation of $xpathexpression. This is useful for mapping\nnamespace prefixes used in the XPath expression to namespace URIs. Note, however, that $node\nwill be used as the context node for the evaluation, not the context node of $xpathcontext!\n\ntoStringC14Nv11\n$c14nstring = $node->toStringC14Nv11();\n$c14nstring = $node->toStringC14Nv11($withcomments, $xpathexpression , $xpathcontext);\n\nThis function behaves like toStringC14N() except that it uses the \"XMLC14N11\" constant\nfor canonicalising using the \"C14N 1.1 spec\".\n\ntoStringEC14N\n$ec14nstring = $node->toStringEC14N();\n$ec14nstring = $node->toStringEC14N($withcomments, $xpathexpression, $inclusiveprefixlist);\n$ec14nstring = $node->toStringEC14N($withcomments, $xpathexpression, $xpathcontext, $inclusiveprefixlist);\n\nThe function is similar to toStringC14N() but follows the XML-EXC-C14N Specification (see\n<http://www.w3.org/TR/xml-exc-c14n>) for exclusive canonization of XML.\n\nThe arguments $withcomments, $xpathexpression, $xpathcontext are as in toStringC14N(). An\nARRAY reference can be passed as the last argument $inclusiveprefixlist, listing namespace\nprefixes that are to be handled in the manner described by the Canonical XML Recommendation\n(i.e. preserved in the output even if the namespace is not used). C.f. the spec for details.\n\nserialize\n$str = $doc->serialize($format);\n\nAn alias for toString(). This function was name added to be more consistent with libxml2.\n\nserializec14n\nAn alias for toStringC14N().\n\nserializeexcc14n\nAn alias for toStringEC14N().\n\nlocalname\n$localname = $node->localname;\n\nReturns the local name of a tag. This is the part behind the colon.\n\nprefix\n$nameprefix = $node->prefix;\n\nReturns the prefix of a tag. This is the part before the colon.\n\nnamespaceURI\n$uri = $node->namespaceURI();\n\nreturns the URI of the current namespace.\n\nhasAttributes\n$boolean = $node->hasAttributes();\n\nreturns 1 (TRUE) if the current node has any attributes set, otherwise 0 (FALSE) is\nreturned.\n\nattributes\n@attributelist = $node->attributes();\n\nThis function returns all attributes and namespace declarations assigned to the given node.\n\nBecause XML::LibXML does not implement namespace declarations and attributes the same way,\nit is required to test what kind of node is handled while accessing the functions result.\n\nIf this function is called in array context the attribute nodes are returned as an array. In\nscalar context, the function will return a XML::LibXML::NamedNodeMap object.\n\nlookupNamespaceURI\n$URI = $node->lookupNamespaceURI( $prefix );\n\nFind a namespace URI by its prefix starting at the current node.\n\nlookupNamespacePrefix\n$prefix = $node->lookupNamespacePrefix( $URI );\n\nFind a namespace prefix by its URI starting at the current node.\n\n*NOTE* Only the namespace URIs are meant to be unique. The prefix is only document related.\nAlso the document might have more than a single prefix defined for a namespace.\n\nnormalize\n$node->normalize;\n\nThis function normalizes adjacent text nodes. This function is not as strict as libxml2's\nxmlTextMerge() function, since it will not free a node that is still referenced by the perl\nlayer.\n\ngetNamespaces\n@nslist = $node->getNamespaces;\n\nIf a node has any namespaces defined, this function will return these namespaces. Note, that\nthis will not return all namespaces that are in scope, but only the ones declared explicitly\nfor that node.\n\nAlthough getNamespaces is available for all nodes, it only makes sense if used with element\nnodes.\n\nremoveChildNodes\n$node->removeChildNodes();\n\nThis function is not specified for any DOM level: It removes all childnodes from a node in a\nsingle step. Other than the libxml2 function itself (xmlFreeNodeList), this function will\nnot immediately remove the nodes from the memory. This saves one from getting memory\nviolations, if there are nodes still referred to from the Perl level.\n\nbaseURI ()\n$strURI = $node->baseURI();\n\nSearches for the base URL of the node. The method should work on both XML and HTML documents\neven if base mechanisms for these are completely different. It returns the base as defined\nin RFC 2396 sections \"5.1.1. Base URI within Document Content\" and \"5.1.2. Base URI from the\nEncapsulating Entity\". However it does not return the document base (5.1.3), use method\n\"URI\" of \"XML::LibXML::Document\" for this.\n\nsetBaseURI ($strURI)\n$node->setBaseURI($strURI);\n\nThis method only does something useful for an element node in an XML document. It sets the\nxml:base attribute on the node to $strURI, which effectively sets the base URI of the node\nto the same value.\n\nNote: For HTML documents this behaves as if the document was XML which may not be desired,\nsince it does not effectively set the base URI of the node. See RFC 2396 appendix D for an\nexample of how base URI can be specified in HTML.\n\nnodePath\n$node->nodePath();\n\nThis function is not specified for any DOM level: It returns a canonical structure based\nXPath for a given node.\n\nlinenumber\n$lineno = $node->linenumber();\n\nThis function returns the line number where the tag was found during parsing. If a node is\nadded to the document the line number is 0. Problems may occur, if a node from one document\nis passed to another one.\n\nIMPORTANT: Due to limitations in the libxml2 library line numbers greater than 65535 will be\nreturned as 65535. Please see <http://bugzilla.gnome.org/showbug.cgi?id=325533> for more\ndetails.\n\nNote: linenumber() is special to XML::LibXML and not part of the DOM specification.\n\nIf the linenumbers flag of the parser was not activated before parsing, linenumber() will\nalways return 0.\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::Node - Abstract Base Class of XML::LibXML Nodes",
    "flags": [],
    "examples": [],
    "see_also": []
}