class LibXML::XML::XPath::Context

The XML::XPath::Context class is used to evaluate XPath expressions. Generally, you should not directly use this class, but instead use the XML::Document#find and XML::Node#find methods.

doc = XML::Document.string('<header>content</header>')
context = XPath::Context.new(doc)
context.node = doc.root
context.register_namespaces_from_node(doc.root)
nodes = context.find('/header')