KXML::Document
Inherits KXML::Node < Reference < Object
Instance methods
Monotonic document order for mutation-created nodes. Structural mutations can place a new node before existing ones, so a plain "max + 1" would hand out orders that contradict document order; the whole document is renumbered in traversal order instead.
Fast path for the common "append at the end" mutation: when pred (the node the new node follows in document order) was the document's last node before the insertion - prev_last, snapshotted by the caller before it spliced the node in - the new node simply takes the next orders instead of paying the full-tree renumber pass. Any other position falls back to renumber.
Creates an element for name (a Clark-notation {uri}local or a
plain/qualified name). When a namespace URI is involved and no
in-scope binding exists on context (or its ancestors), the
binding is declared on the new element itself using prefix_hint
(or a generated nsN) - mirroring libxml2's
xmlSearchNsByHref/xmlNewNs dance.
The node holding the maximum doc_order. Order stays monotonic with document position across mutations: every insertion either renumbers or appends after the current maximum, and unlink only removes nodes (the relative order of the survivors is untouched).
Deepest, last node of start's subtree in document order: attributes order between their element and its children, and the last child's subtree precedes anything after it.
Attribute names declared ID in the internal DTD subset
(population is best-effort: only ATTLIST declarations seen during
the parse register here). Lets XPath's id() resolve tokens.
Assigns doc_order to every node and attribute in document order (pre-order traversal, attributes immediately after their element).
pretty mirrors libxml2's XML::SaveOptions::FORMAT: elements whose children are all elements/comments/PIs get one child per line with indent_size-space indentation; text-bearing content is inline.