class

JSONXPath::Node

Inherits Reference < Object

A Node consists of a NodeType and some data (tag name for element nodes, content for text) and are part of a tree of Nodes

Class methods

parse(input : String | IO)
Source

Instance methods

children
Source
content

returns the value of the node and all of its child nodes.

Source
data
Source
first_child
Source
first_child=(first_child : Node | Nil)
Source
last_child
Source
last_child=(last_child : Node | Nil)
Source
level
Source
next_sibling
Source
next_sibling=(next_sibling : Node | Nil)
Source
parent
Source
parent=(parent : Node | Nil)
Source
prev_sibling
Source
prev_sibling=(prev_sibling : Node | Nil)
Source
select(name : String)

select finds the first of child elements with the specified name

Source
type
Source
xpath(path : String) : Node | Nil

Searches this node for XPath path. Returns first matched HTML::Node or nil

Source
xpath_bool(path : String)

Searches this node for XPath path and restricts the return type to String.

Source
xpath_evaluate(path)

Searches this node for XPath path and return result with appropriate type (Bool | Float64 | String | NodeIterator | Nil)

Source
xpath_float(path : String)

Searches this node for XPath path and restricts the return type to Float64.

Source
xpath_nodes(path : String) : Array(Node)

Searches this node for XPath path. Returns all of the matched HTML::Node

Source