paXML - BaseXmlDomNode
Returns an address of the XML representation of the node and its descendant nodes
Type: Property
Access: Read-Only
Data Type: Address
Parameters: None
Syntax
Property Address paXML
| Access Type | Syntax |
|---|---|
| Read Access: | Get paXML to AddressVariable |
Description
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.
| Col 1 | Col 2 |
|---|---|
| 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. |
There are two ways you can use this property. If you are using the data but not returning it, you must dispose of it. If you are returning the data as an address (function_return returns an address), it is the job of the method receiving the function return to dispose of the data. If the returning function is part of your DataFlex application you must free the data when you no longer need it. If the data is being returned to an ASP page, WebApp will dispose of the data for you.
Example:
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.
Example:
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 Also
psXML | SaveXMLDocument | LoadXMLDocument | LoadXML | LoadXMLFromAddress