Summary:
See also: Built-in classes
The TypeInfo class is a built-in class provided to serialize program variables.
base.TypeInfo
Class Methods | |
Name | Description |
create( variable ) RETURNING om.DomNode |
Creates a DOM node from a program variable |
The create()
method of this class builds a DomNode
object from any kind of structured program variable, which is the serialization
of the variable:
01
MAIN02
DEFINE n om.DomNode03
DEFINE r RECORD04
key INTEGER,05
lastname CHAR(20)06
END RECORD07
LET r.key = 23408
LET r.lastname = "Johnson"09
LET n = base.TypeInfo.create( r )10
CALL n.writeXml( "r.xml" )11
END MAIN
The generated node contains variable values and data type information. The above example creates the following file:
<?xml version="1.0"? encoding="ISO-8859-1"> <Record> <Field type="INTEGER" value="234" name="key"/> <Field type="CHAR(20)" value="Johnson" name="lastname"/> </Record>