Package-level declarations

Package with various extension functions to make working with DOM nodes easier.

Functions

Link copied to clipboard

Allow access to the node as Element if it is an element, otherwise it is null.

Link copied to clipboard
fun Node.asText(): Text?

Allow access to the node as Text, if so, otherwise null.

Link copied to clipboard
inline fun NamedNodeMap.count(predicate: (Attr) -> Boolean): Int

A function to count all attributes for which the predicate holds.

Link copied to clipboard
inline fun NamedNodeMap.filter(predicate: (Attr) -> Boolean): List<Attr>

A filter function on a NamedNodeMap that returns a list of all (attributes)Attr that meet the predicate.

Link copied to clipboard
inline fun NamedNodeMap.forEach(body: (Attr) -> Unit)

A simple for each implementation for NamedNodeMaps.

Link copied to clipboard
operator fun NodeList.iterator(): Iterator<Node>
Link copied to clipboard
inline fun <R> NamedNodeMap.map(body: (Attr) -> R): List<R>

A (map)Collection.map function for transforming attributes.

Link copied to clipboard

Remove all the child nodes that are elements.