class JSONXPath::Node
- JSONXPath::Node
- Reference
- Object
Overview
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
Defined in:
node.crxpath.cr
Class Method Summary
Instance Method Summary
- #children
-
#content
returns the value of the node and all of its child nodes.
- #data : String
- #first_child : Node | Nil
- #first_child=(first_child : Node | Nil)
- #last_child : Node | Nil
- #last_child=(last_child : Node | Nil)
- #level : Int32
- #next_sibling : Node | Nil
- #next_sibling=(next_sibling : Node | Nil)
- #parent : Node | Nil
- #parent=(parent : Node | Nil)
- #prev_sibling : Node | Nil
- #prev_sibling=(prev_sibling : Node | Nil)
- #raw : JSON::Any
-
#select(name : String)
select finds the first of child elements with the specified name
- #type : NodeType
-
#xpath(path : String) : Node | Nil
Searches this node for XPath path.
-
#xpath_bool(path : String)
Searches this node for XPath path and restricts the return type to
String
. -
#xpath_evaluate(path)
Searches this node for XPath path and return result with appropriate type
(Bool | Float64 | String | NodeIterator | Nil)
-
#xpath_float(path : String)
Searches this node for XPath path and restricts the return type to
Float64
. -
#xpath_nodes(path : String) : Array(Node)
Searches this node for XPath path.
Class Method Detail
Instance Method Detail
Searches this node for XPath path. Returns first matched HTML::Node
or nil
Searches this node for XPath path and restricts the return type to String
.
Searches this node for XPath path and return result with appropriate type
(Bool | Float64 | String | NodeIterator | Nil)
Searches this node for XPath path and restricts the return type to Float64
.
Searches this node for XPath path. Returns all of the matched HTML::Node