The TypeInfo class / base.TypeInfo methods |
Create a DomNode from a structured program variable.
base.TypeInfo.create() RETURNING result om.DomNode
Use the base.TypeInfo.create() class method to create a om.DomNode object from a program variable.
The program variable is typically a RECORD, but it can be any sort of structured variable, including arrays.
The om.DomNode is created with type information and values.
The data is formatted according to current environment settings (DBDATE, DBFORMAT, and DBMONEY).
MAIN DEFINE n om.DomNode DEFINE r RECORD key INTEGER, lastname CHAR(20), birthdate DATE END RECORD LET r.key = 234 LET r.lastname = "Johnson" LET r.birthdate = MDY(12,24,1962) LET n = base.TypeInfo.create( r ) CALL n.writeXml( "r.xml" ) END MAINThe generated node contains variable values and data type information. The example creates this 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"/> <Field type="DATE" value="12/24/1962" name="birthdate"/> </Record>