Document
struct DocumentImplements Movable, Sized
__init__
def __init__(out self) parse
def parse(doc: String) -> Self Parses a whole document. Raises on malformed XML or no root.
__len__
def __len__(self) -> Int Number of elements in the document.
root
def root(self) -> Int name
def name(self, node: Int) -> String The element's name as written, prefix included.
text
def text(self, node: Int) -> String The element's own text, entity-decoded.
parent
def parent(self, node: Int) -> Int attr
def attr(self, node: Int, name: String, default: String = "") -> String children
def children(self, node: Int) -> List[Int] child
def child(self, node: Int, name: String) -> Int The first child with local name name, or NO_NODE.
child_text
def child_text(self, node: Int, name: String, default: String = "") -> String find_all
def find_all(self, node: Int, path: String) -> List[Int] Every element reached from node by the /-separated path.
Each segment steps down one level and matches all children of that
name, so a/b yields every b under every a, in document order.
find
def find(self, node: Int, path: String) -> Int The first element find_all would return, or NO_NODE.
find_text
def find_text(self, node: Int, path: String, default: String = "") -> String