Skip to content

XMLNode

do- edited this page Dec 12, 2021 · 37 revisions

XMLNode is the SAXEvent descendant connected to XMLReader internals.

This is not an attempt to implement the W3C specification directly. XMLNode instances may or may not be parts of more complex structures similar to DOM Document.

Application code must not construct instances of this class directly. XMLReader (and, thus, SAXEventEmitter) produces XMLNodes instead of raw SAXEvents.

Members

Name Type Description
parent XMLNode Element node parent to this one, null for root element
level int 0 for root element, parent.level + 1 otherwise
children null or [XMLNode] Array of XMLNodes, for which this one is the parent

Computed Properties

Name Type Description
type SAXEvent.TYPES.* StartElement or EndElement. XMLReader emits both, children may be available on EndElement
name string Raw element name (maybe with namespace prefix)
localName string XMLNode.getLocalName (this.name)
namespaceURI string URI of the namespace of this node, or null
attributes Map AttributesMap
namespacesMap NamespacesMap Set of namespace declarations for this node
isSelfEnclosed Boolean true iif the penultimate character is /

Global functions

Name, parameters Type Description
XMLNode.getLocalName (name) string Part of name after :, or the whole name unless it contains :.

Clone this wiki locally