View Source Tamnoon.DOM.NodeCollection (Tamnoon v1.0.0-rc.3)

Represents a DOM node collection. Accepts two parameters for how to select the nodes, :selector_type and :selector_value. For example, when :selector_type is :children and :selector_value is a Tamnoon.DOM.Node.t/0, it will be equivalent to using element.children() in JS.

Fields

  • :selector_type – an atom indicating the type of selector.

    • Expected values: :xpath, :query, :children.
  • :selector_value – the value associated with the selector.

Summary

Types

@type t() :: %Tamnoon.DOM.NodeCollection{
  selector_type: :xpath | :query | :children,
  selector_value: String.t() | Tamnoon.DOM.Node.t()
}

Functions

Link to this function

is_node_collection?(node_collection)

View Source
@spec is_node_collection?(node_collection :: any()) :: boolean()
@spec new!(node_collection :: term()) :: %Tamnoon.DOM.NodeCollection{
  selector_type: term(),
  selector_value: term()
}

Constructs a Tamnoon.DOM.NodeCollection.t/0 with the following arguments:

  • :selector_type – an atom (:xpath, :query or :children).

  • :selector_value – a String.t/0 the value associated with the selector.