Saves or sends an XML document as text generated from an X-document object.
Return type: LOGICAL
Applies to: X-document object handle
If the LONGCHAR variable's code page is fixed (that is, set using the FIX-CODEPAGE statement) and the fixed code page is not compatible with the encoding specified in the XML document's ENCODING attribute, the SAVE( ) method returns an error and the XML document is not saved to the LONGCHAR.
If the LONGCHAR variable's code page is not fixed, the AVM converts from the XML document's code page to the -cpinternal code page and saves it to the LONGCHAR variable.
The following code fragments demonstrate the use of the SAVE( ) method:
/* Saves the current tree under hDoc as memo.xml. */ DEFINE STREAM mystream. OUTPUT STREAM mystream to memo.xml. hdoc:SAVE("stream","mystream"). OR /* Saves the current tree under hDoc as memo.xml. */ hdoc:SAVE("file","memo.xml"). OR /* Saves the current tree under hDoc in memory referred to by mymem. */ DEFINE VARIABLE hDoc AS HANDLE NO-UNDO. DEFINE VARIABLE mymem AS MEMPTR NO-UNDO. . . . hDoc:SAVE("memptr", mymem). |