KiteXmlNode

sealed class KiteXmlNode(source)

A parsed XML (or XHTML, or SVG) node tree. KiteXml gives a flat token stream; a tree builder folds it into this so callers can reason about nesting instead of a stack of open tags.

An Element (tag + attributes + ordered children), a Text leaf, and a Comment, which only a parse that asks for comments makes, as a script layer does. Processing instructions and the prologue never reach here, KiteXml drops them. Tags and attribute names arrive lowercased with their namespace prefix stripped, so epub:type reads as type.

Inheritors

Types

Link copied to clipboard
class Comment(var text: String) : KiteXmlNode

A comment and its data, which a parse keeps only when asked, so a layout never sees one. A script layer changes text on a tree of its own, as Text.text (#544).

Link copied to clipboard
class Element(val tag: String, var attrs: Map<String, String>, val children: MutableList<KiteXmlNode> = ArrayList()) : KiteXmlNode
Link copied to clipboard
class Text(var text: String) : KiteXmlNode

A text leaf. A script layer changes text on a tree of its own, as Element.attrs (#41).