Consultor Eletrônico



Kbase P5213: How To Load An XML Document From A Memptr?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   15/10/2008
Status: Verified

GOAL:

How to load an XML document from a memptr?

FIX:

To load an XML document from a data source other than a file the data will have to be placed into a memory pointer (MEMPTR) variable and that variable must then be passed to the LOAD method.

For example,


DEFINE VARIABLE mData AS MEMPTR NO-UNDO.

SET-SIZE(mData) = 1048576.  /* start with 1MB of memory as a base */

/* Assume the external data was placed into a character variable thru some */
/* means.                                                                  */

PUT-STRING(mData,1) = A_Character_Variable_Containing_The_Data.

hXML:LOAD("MEMPTR", mData, FALSE).  /* Load the XML document */

SET-SIZE(mData) = 0.  /* Must deallocate memptr when done or you leak memory */