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
namespacesMap NamespacesMap Set of namespace declarations for this node
localName string XMLNode.getLocalName (this.name)
namespaceURI string URI of the namespace of this node, or null
Inherited from SAXEvent:
type SAXEvent.TYPES.* Getter for the event type
name string For StartElement and EndElement, the raw element name (maybe with namespace prefix)
attributes Map Lazy getter for the Map of attributes
text string src.slice (9, -3) iif the first character is < (for CDATA it's the body text), src otherwise
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