om.DomDocument.createChars

Create a new text node in the DOM document.

Syntax

createChars(
   value STRING )
  RETURNS om.DomNode
  1. value defines the content of the text node.

Usage

Use the method createChars() to create a new om.DomNode text node. The content of the text node must be passed as parameter.

The 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 om.DomNode type.

Example

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