DOMParser
classin packageklyn.io.xml.dom
public class DOMParser extends Object:
└ DOMParser

DOM parser that reads XML into the pure Klyn XMLDocument implementation.

DOMParser is the high-level DOM entry point: it hides SAX callbacks and returns a ready-to-use document tree.

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

parser = DOMParser() document = parser.parseFromString("<root><child id=\"1\">text</child></root>") print(document.documentElement.tagName)

Properties inherited from Object: type
Constructors
Modifier and Type Member Description
public DOMParser Creates a DOM parser.
Methods
Modifier and Type Member Description
public parse
parse(source as InputSource) as DomDocument throws IOException, DOMException:
Parses XML from a SAX input source.
public parseFromFile
parseFromFile(filePath as FilePath) as DomDocument throws IOException, DOMException:
Parses XML from a FilePath.
public parseFromFile
parseFromFile(filePath as String) as DomDocument throws IOException, DOMException:
Parses XML from a file path.
public parseFromString
parseFromString(xml as String) as DomDocument throws DOMException:
Parses XML from a string.
Methods inherited from Object: fromJson, toDict, toJson, toString, toXml