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?
- #first_child=(first_child : Node?)
- #last_child : Node?
- #last_child=(last_child : Node?)
- #level : Int32
- #next_sibling : Node?
- #next_sibling=(next_sibling : Node?)
- #parent : Node?
- #parent=(parent : Node?)
- #prev_sibling : Node?
- #prev_sibling=(prev_sibling : Node?)
- #raw : JSON::Any
-
#select(name : String)
select finds the first of child elements with the specified name
- #type : NodeType
-
#xpath(path : String) : Node?
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