DomDocument
classin packageklyn.io.xml.dom
public class DomDocument extends XMLDocument:
└ XMLNode
└ DomDocument

Compatibility DOM document class returned by DOMParser.

DomDocument is an XMLDocument whose elements are created as DomElement, matching the original DOM parser tests while preserving the standard Document interface.

@example `klyn import klyn.io.xml.dom

document = DomDocument() root = document.createElement("root")

Attributes inherited from Node: ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Properties
Modifier and Type Member Description
public readonly property documentElement
documentElement as DomElement:
Root element of the parsed document.
Properties inherited from XMLDocument: doctype, documentElement, documentURI, domConfig, implementation, inputEncoding, strictErrorChecking, xmlEncoding, xmlStandalone, xmlVersion
Properties inherited from XMLNode: attributes, baseURI, childNodes, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, textContent
Properties inherited from Document: doctype, documentElement, documentURI, domConfig, implementation, inputEncoding, strictErrorChecking, xmlEncoding, xmlStandalone, xmlVersion
Properties inherited from Object: type
Properties inherited from Node: attributes, baseURI, childNodes, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, textContent
Constructors
Modifier and Type Member Description
public DomDocument
DomDocument(implementation as DOMImplementation = null, doctype as DocumentType = null):
Creates an empty parser document.
Methods
Modifier and Type Member Description
public createElement
createElement(tagName as String) as Element throws DOMException:
Creates a DOM parser element without a namespace.
public createElementNS
createElementNS(namespaceURI as String, qualifiedName as String) as Element throws DOMException:
Creates a DOM parser element with an optional namespace.
public getElementsByTagName
getElementsByTagName(tagName as String) as DomNodeList:
Returns document descendant elements matching a tag name.
public getElementsByTagNameNS
getElementsByTagNameNS(namespaceURI as String, localName as String) as DomNodeList throws DOMException:
Returns document descendant elements matching a namespace URI and local name.
Methods inherited from XMLDocument: _cloneForDocument, _setDocumentType, adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createEntityReference, createProcessingInstruction, createTextNode, getElementById, getElementsByTagName, getElementsByTagNameNS, importNode, normalizeDocument, renameNode
Methods inherited from XMLNode: _collectElementsByTagName, _collectElementsByTagNameNS, _setNamespace, _setOwnerDocument, _setOwnerDocumentRecursive, _setParentNode, appendChild, cloneNode, compareDocumentPosition, getAttribute, getFeature, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setUserData
Methods inherited from Document: adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getElementById, getElementsByTagName, getElementsByTagNameNS, importNode, normalizeDocument, renameNode
Methods inherited from Object: fromJson, toDict, toJson, toString, toXml
Methods inherited from Node: appendChild, cloneNode, compareDocumentPosition, getAttribute, getFeature, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setUserData