Try OpenEdge Now
skip to main content
Working with XML
Reading and Writing XML with the Document Object Model (DOM) : Creating XML output from ABL : Example of creating an output XML file : Writing an XML file to a MEMPTR, a stream, or a LONGCHAR
 
Writing an XML file to a MEMPTR, a stream, or a LONGCHAR
You can also write an XML file to a MEMPTR or to an output stream or to a LONGCHAR as the following code fragments demonstrate.
The following fragment shows how to save an XML file to a MEMPTR:
DEFINE VARIABLE memfile AS MEMPTR NO-UNDO.
. . .
hDoc:SAVE("memptr",memfile). /* SAVE( ) will set the memptr size */
. . .
The following fragment shows how to save an XML file to a LONGCHAR:
DEFINE VARIABLE longstring AS LONGCHAR NO-UNDO.
. . .
hDoc:SAVE("LONGCHAR",longstring).
. . .
The following fragment shows how to save an XML file to an output stream:
DEFINE STREAM xmlstream.
. . .
OUTPUT STREAM xmlstream TO custxml.xml.
hDoc:SAVE("stream","xmlstream").
OUTPUT CLOSE.
. . .