{
    "mode": "perldoc",
    "parameter": "XML::XPath::NodeSet",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3ANodeSet/json",
    "generated": "2026-06-11T21:54:22Z",
    "synopsis": "my $results = $xp->find('//someelement');\nif (!$results->isa('XML::XPath::NodeSet')) {\nprint \"Found $results\\n\";\nexit;\n}\nforeach my $context ($results->getnodelist) {\nmy $newresults = $xp->find('./other/element', $context);\n...\n}",
    "sections": {
        "NAME": {
            "content": "XML::XPath::NodeSet - a list of XML document nodes\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "An XML::XPath::NodeSet object contains an ordered list of nodes. The nodes each take the same\nformat as described in XML::XPath::XMLParser.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "my $results = $xp->find('//someelement');\nif (!$results->isa('XML::XPath::NodeSet')) {\nprint \"Found $results\\n\";\nexit;\n}\nforeach my $context ($results->getnodelist) {\nmy $newresults = $xp->find('./other/element', $context);\n...\n}\n",
            "subsections": []
        },
        "API": {
            "content": "new()\nYou will almost never have to create a new NodeSet object, as it is all done for you by XPath.\n\ngetnodelist()\nReturns a list of nodes. See XML::XPath::XMLParser for the format of the nodes.\n\nstringvalue()\nReturns the string-value of the first node in the list. See the XPath specification for what\n\"string-value\" means.\n\ntoliteral()\nReturns the concatenation of all the string-values of all the nodes in the list.\n\ngetnode($pos)\nReturns the node at $pos. The node position in XPath is based at 1, not 0.\n\nsize()\nReturns the number of nodes in the NodeSet.\n\npop()\nEquivalent to perl's pop function.\n\npush(@nodes)\nEquivalent to perl's push function.\n\nappend($nodeset)\nGiven a nodeset, appends the list of nodes in $nodeset to the end of the current list.\n\nshift()\nEquivalent to perl's shift function.\n\nunshift(@nodes)\nEquivalent to perl's unshift function.\n\nprepend($nodeset)\nGiven a nodeset, prepends the list of nodes in $nodeset to the front of the current list.\n",
            "subsections": []
        }
    },
    "summary": "XML::XPath::NodeSet - a list of XML document nodes",
    "flags": [],
    "examples": [],
    "see_also": []
}