{
    "mode": "perldoc",
    "parameter": "XML::LibXML::XPathExpression",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ALibXML%3A%3AXPathExpression/json",
    "generated": "2026-06-11T06:03:52Z",
    "synopsis": "use XML::LibXML;\nmy $compiledxpath = XML::LibXML::XPathExpression->new('//foo[@bar=\"baz\"][position()<4]');\n# interface from XML::LibXML::Node\nmy $result = $node->find($compiledxpath);\nmy @nodes = $node->findnodes($compiledxpath);\nmy $value = $node->findvalue($compiledxpath);\n# interface from XML::LibXML::XPathContext\nmy $result = $xpc->find($compiledxpath,$node);\nmy @nodes = $xpc->findnodes($compiledxpath,$node);\nmy $value = $xpc->findvalue($compiledxpath,$node);\n$compiled = XML::LibXML::XPathExpression->new( xpathstring );",
    "sections": {
        "NAME": {
            "content": "XML::LibXML::XPathExpression - XML::LibXML::XPathExpression - interface to libxml2 pre-compiled\nXPath expressions\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use XML::LibXML;\nmy $compiledxpath = XML::LibXML::XPathExpression->new('//foo[@bar=\"baz\"][position()<4]');\n\n# interface from XML::LibXML::Node\n\nmy $result = $node->find($compiledxpath);\nmy @nodes = $node->findnodes($compiledxpath);\nmy $value = $node->findvalue($compiledxpath);\n\n# interface from XML::LibXML::XPathContext\n\nmy $result = $xpc->find($compiledxpath,$node);\nmy @nodes = $xpc->findnodes($compiledxpath,$node);\nmy $value = $xpc->findvalue($compiledxpath,$node);\n\n$compiled = XML::LibXML::XPathExpression->new( xpathstring );\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is a perl interface to libxml2's pre-compiled XPath expressions. Pre-compiling an XPath\nexpression can give in some performance benefit if the same XPath query is evaluated many times.\n\"XML::LibXML::XPathExpression\" objects can be passed to all \"find...\" functions \"XML::LibXML\"\nthat expect an XPath expression.\n",
            "subsections": [
                {
                    "name": "new",
                    "content": "$compiled = XML::LibXML::XPathExpression->new( xpathstring );\n\nThe constructor takes an XPath 1.0 expression as a string and returns an object representing\nthe pre-compiled expressions (the actual data structure is internal to libxml2).\n"
                }
            ]
        },
        "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::XPathExpression - XML::LibXML::XPathExpression - interface to libxml2 pre-compiled XPath expressions",
    "flags": [],
    "examples": [],
    "see_also": []
}