Doctype
A document type declaration node.
Renders as , typically for HTML5 documents. Doctype nodes are always rendered without indentation and are treated as leaf nodes by tree operations.
Value parameters
- value
-
the doctype value (e.g., "html")
Attributes
- Source
- Dom.scala
- Graph
-
- Supertypes
-
trait Domtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Inherited methods
Collects all nodes in the tree matching the given partial function.
Collects all nodes in the tree matching the given partial function.
Traverses the entire tree in depth-first order, applying the partial function to each node and collecting matches.
Value parameters
- pf
-
the partial function to apply; nodes that match contribute their transformed values
Attributes
Filters the tree to keep only nodes satisfying the predicate.
Filters the tree to keep only nodes satisfying the predicate.
Removes any node for which the predicate returns false, and recursively filters children. Empty branches collapse to Empty.
Value parameters
- predicate
-
the condition each node must satisfy
Attributes
Finds the first node in the tree satisfying the predicate.
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
- Source
- Product.scala
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
- Source
- Product.scala
Renders the DOM tree to a pretty-printed HTML string with indentation.
Renders the DOM tree to a pretty-printed HTML string with indentation.
Text content is HTML-escaped. Script and Style elements render their children without escaping to allow inline code.
Value parameters
- indent
-
the number of spaces per indentation level; if <= 0, behaves like
render
Attributes
Renders the DOM tree to a minified HTML string.
Selects all descendant nodes matching the given CSS selector.
Selects all descendant nodes matching the given CSS selector.
Value parameters
- selector
-
the CSS selector to match against
Attributes
- Returns
-
a DomSelection containing all matching descendant nodes
- Inherited from:
- Dom
- Source
- Dom.scala
Transforms every node in the tree using the given function.
Transforms every node in the tree using the given function.
Applies the transformation function to each node in depth-first order, then recursively transforms children of Elements. Suitable for rewriting the tree, e.g., removing nodes, modifying attributes, or simplifying structure.
Value parameters
- f
-
the transformation function to apply to each node