abla/xml/tree
Generated from source.
Source module; follow its importing module's re-export links.
Source: abla/xml/tree.ab
xmlAnyNamespace (val)
val xmlAnyNamespace
Matches an element or attribute in any namespace.
XmlAttribute (class)
class XmlAttribute(
val name: string,
val prefix: string,
val localName: string,
val namespaceUri: string,
val value: string,
// False for a default the DTD supplied.
val specified: bool = true
)
Represents a qualified XML attribute and its value, including namespace and presence information.
XmlNode (interface)
sealed interface XmlNode
Provides the common base type for XML tree nodes.
XmlText (class)
class XmlText(val text: string, val cdata: bool = false) : XmlNode
Represents character data and records whether it came from a CDATA section.
XmlComment (class)
class XmlComment(val text: string) : XmlNode
Represents the text of an XML comment.
XmlProcessingInstruction (class)
class XmlProcessingInstruction(val target: string, val data: string) : XmlNode
Represents a processing instruction's target and data.
XmlSkippedEntity (class)
class XmlSkippedEntity(val name: string) : XmlNode
A reference to an entity the parser didn't read: an external one, or one declared somewhere it didn't read. Its content is unknown.
XmlElement (class)
class XmlElement(
val name: string,
val prefix: string,
val localName: string,
val namespaceUri: string,
val attributes: array<XmlAttribute>,
val children: array<XmlNode>,
val byteOffset: int,
val line: int,
val column: int,
val namespacesResolved: bool = false
) : XmlNode
Represents an XML element with a qualified name, attributes and ordered children.
XmlElement.attribute (method)
fun attribute(localName: string, namespaceUri: string = ""): XmlAttribute?
The attribute with this local name, or null.
XmlElement.attributeValue (method)
fun attributeValue(localName: string, fallback: string = "", namespaceUri: string = ""): string
That attribute's value, or fallback.
XmlElement.child (method)
fun child(localName: string, namespaceUri: string = xmlAnyNamespace): XmlElement?
The first child element with this local name, or null. Without a namespace argument any namespace matches.
XmlElement.elements (method)
fun elements(localName: string = xmlAnyNamespace, namespaceUri: string = xmlAnyNamespace): array<XmlElement>
Every child element, or those with this local name.
XmlElement.text (method)
fun text(): string
All the text in this element and below it, in document order.
XmlElement.childText (method)
fun childText(localName: string, namespaceUri: string = xmlAnyNamespace): string
The text of the first child with this local name, or "".
XmlDoctype (class)
class XmlDoctype(val name: string, val publicId: string, val systemId: string)
Stores a document type name and its public and system identifiers.
XmlDocument (class)
class XmlDocument(
val version: string,
// As declared; "" when the declaration has none.
val encoding: string,
val standalone: string,
val doctype: XmlDoctype?,
// Comments and processing instructions before the root element.
val prolog: array<XmlNode>,
val root: XmlElement,
// And after it.
val epilog: array<XmlNode>,
// Whether the content is incomplete: some entity wasn't read.
val skippedEntities: int
)
Stores the XML root and document-level metadata and nodes.
xmlNamespaceMatches (fun)
fun xmlNamespaceMatches(actual: string, wanted: string): bool
Reports whether the expected namespace equals the actual URI or is the wildcard.
xmlAppendText (fun)
fun xmlAppendText(var out: ByteBuffer, element: XmlElement): void
Appends text from the element and its descendants in document order. The tree is walked with a stack of its own: how deep it is does not matter (a reader with its maxDepth raised can give a tree a million levels deep), the call stack does not grow with it.
Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.