Property Address paXML
Read Access: | Get paXML to AddressVariable |
paXML returns the address of the XML representation of the node and its descendant nodes.
This property is used like psXML except that it is the address of the data. Because it is not a string, it can be of any size. This property is typically used in WebApp applications to return large amounts of XML data to an ASP page.
Note: | This property allocates memory for the data and it is therefore important that the data be disposed of when you are done. This is done using the Free() function. |
Here is an example of the first way:
Procedure WriteXMLDocument string sURL Handle hoXML Integer bOK Address pXML Get Create U_cXMLDomDocument To hoXML Set psDocumentName of hoXML to sUrl set pbAsync of hoXML to False Get LoadXmlDocument Of hoXML To bOK If bOK begin Get paXML of hoXML to pXML Send WriteData pXML Move (Free(pXML)) to bOk end Send Destroy of hoXML End_Procedure
This sample can be used to output any XML document to your ASP page. In fact, the XML document could reside on some other server.
Here is an example of the second way:
Function OutXML string sURL returns address Handle hoXML Integer bOK Address pXML Get Create U_cXMLDomDocument To hoXML Set psDocumentName of hoXML to sUrl set pbAsync of hoXML to False Get LoadXmlDocument Of hoXML To bOK If bOK ; Get paXML of hoXML to pXML Send Destroy of hoXML Function_return pXML // let whoever called me, dispose of me. End_Function // registered as follows: RegisterInterface get_OutXML "get_OutXml" // "string sURL returns address" "fetch XML document"
In WebApp an ASP page might call this as follows:
<xml ID="XMLIsland"> <% sXML = oCustomer.call("get_OutXML", sSomeURL) response.write(sXML) %> </xml>
Note that there is no need to dispose of the pointer data because WebApp does it for you.
See AlsopsXML | SaveXMLDocument | LoadXMLDocument | LoadXML | LoadXMLFromAddress