Class: Nokogiri::XML::XPath
- Inherits:
-
Object
- Object
- Nokogiri::XML::XPath
- Defined in:
- lib/nokogiri/xml/xpath.rb,
lib/nokogiri/ffi/xml/xpath.rb,
lib/nokogiri/xml/xpath/syntax_error.rb,
ext/nokogiri/xml_xpath.c
Defined Under Namespace
Classes: SyntaxError
Instance Attribute Summary collapse
-
#cstruct ⇒ Object
:nodoc:.
-
#document ⇒ Object
The Nokogiri::XML::Document tied to this XPath instance.
Instance Method Summary collapse
-
#node_set ⇒ Object
Fetch the node set associated with this xpath context.
Instance Attribute Details
#cstruct ⇒ Object
:nodoc:
5 6 7 |
# File 'lib/nokogiri/ffi/xml/xpath.rb', line 5 def cstruct @cstruct end |
#document ⇒ Object
The Nokogiri::XML::Document tied to this XPath instance
7 8 9 |
# File 'lib/nokogiri/xml/xpath.rb', line 7 def document @document end |
Instance Method Details
#node_set ⇒ Object
Fetch the node set associated with this xpath context.
7 8 9 10 11 12 13 14 15 |
# File 'lib/nokogiri/ffi/xml/xpath.rb', line 7 def node_set # :nodoc: ptr = cstruct[:nodesetval] if cstruct[:nodesetval] ptr = LibXML.xmlXPathNodeSetCreate(nil) if ptr.null? set = XML::NodeSet.new(@document) set.cstruct = LibXML::XmlNodeSet.new(ptr) set.document = @document set end |