class JSONXPath::Node

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.cr
xpath.cr

Class Method Summary

Instance Method Summary

Class Method Detail

def self.parse(input : String | IO) #

[View source]

Instance Method Detail

def children #

[View source]
def content #

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


[View source]
def data : String #

[View source]
def first_child : Node | Nil #

[View source]
def first_child=(first_child : Node | Nil) #

[View source]
def last_child : Node | Nil #

[View source]
def last_child=(last_child : Node | Nil) #

[View source]
def level : Int32 #

[View source]
def next_sibling : Node | Nil #

[View source]
def next_sibling=(next_sibling : Node | Nil) #

[View source]
def parent : Node | Nil #

[View source]
def parent=(parent : Node | Nil) #

[View source]
def prev_sibling : Node | Nil #

[View source]
def prev_sibling=(prev_sibling : Node | Nil) #

[View source]
def raw : JSON::Any #

[View source]
def select(name : String) #

select finds the first of child elements with the specified name


[View source]
def type : NodeType #

[View source]
def xpath(path : String) : Node | Nil #

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


[View source]
def xpath_bool(path : String) #

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


[View source]
def xpath_evaluate(path) #

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


[View source]
def xpath_float(path : String) #

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


[View source]
def xpath_nodes(path : String) : Array(Node) #

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


[View source]