XMLCharacterData
classin packageklyn.io.xml.dom
public abstract class XMLCharacterData extends XMLNode implements CharacterData
└ XMLNode
└ XMLCharacterData
All Implemented Interfaces: CharacterData

Base implementation for DOM CharacterData nodes, with DOM UTF-16 offsets. Klyn strings contain complete Unicode scalars: operations that would split a surrogate pair fail with INDEX_SIZE_ERR instead of creating invalid text.

Example
import klyn.io.xml.dom

text = XMLText("hello", document)
text.appendData(" world")
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 property data
data as String
No summary.
public readonly property length
length as Int
No summary.
Inherited Properties
propertyInherited Properties from XMLNode: attributes, baseURI, childNodes, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, textContent
propertyInherited Properties from Object: type
Methods
Modifier and Type Member Description
public appendData
appendData(arg as String) as Void throws DOMException
Performs a DOM operation.
public deleteData
deleteData(offset as Int, count as Int) as Void throws DOMException
Performs a DOM operation.
public insertData
insertData(offset as Int, arg as String) as Void throws DOMException
Performs a DOM operation.
public replaceData
replaceData(offset as Int, count as Int, arg as String) as Void throws DOMException
Replaces a bounded range after validating its offset and count.
public substringData
substringData(offset as Int, count as Int) as String throws DOMException
Reads up to count UTF-16 units, clipping at the end.
Inherited Methods
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 Object: deepCopy, fromJson, hash, toDict, toJson, toMap, toString, toXml