The DomDocument class / om.DomDocument methods |
Create a new text node in the DOM document.
createChars( string STRING ) RETURNING result om.DomNode
Use the method createChars() to create a new om.DomNode text node. The content of the text node must be passed as parameter.
The new created node will have the reserved tagName "@chars", and a single attribute named "@chars" storing the character data.
To hold the reference to the new node, define a variable with the type om.DomNode type.
MAIN DEFINE mydoc om.DomDocument DEFINE root, text om.DomNode LET mydoc = om.DomDocument.create("Test") LET root = mydoc.getDocumentElement() LET text = mydoc.createChars("Hello, world!") DISPLAY text.getAttribute("@chars") CALL root.appendChild(text) CALL root.writeXML("output.xml") END MAIN