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
import klyn.io.xml.dom

document = DomDocument()
root = document.createElement("root")
Inherited Attributes
attributeInherited Attributes 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.
Inherited Properties
propertyInherited Properties from XMLDocument: doctype, documentElement, documentURI, domConfig, implementation, inputEncoding, strictErrorChecking, xmlEncoding, xmlStandalone, xmlVersion
propertyInherited Properties from XMLNode: attributes, baseURI, childNodes, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, textContent
propertyInherited Properties from Document: doctype, documentElement, documentURI, domConfig, implementation, inputEncoding, strictErrorChecking, xmlEncoding, xmlStandalone, xmlVersion
propertyInherited Properties from Object: type
propertyInherited Properties 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.
Inherited Methods
methodInherited Methods from XMLDocument: _cloneForDocument, _setDocumentType, adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createEntityReference, createProcessingInstruction, createTextNode, getElementById, getElementsByTagName, getElementsByTagNameNS, importNode, normalizeDocument, renameNode
methodInherited Methods 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
methodInherited Methods from Document: adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getElementById, getElementsByTagName, getElementsByTagNameNS, importNode, normalizeDocument, renameNode
methodInherited Methods from Object: deepCopy, fromJson, toDict, toJson, toString, toXml
methodInherited Methods from Node: appendChild, cloneNode, compareDocumentPosition, getAttribute, getFeature, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setUserData