@XMLGetAllContent
Syntax
@XMLGetAllContent(XMLN);
@XMLGetAllContent(XMLN;Options);
Description
This @Function retrieves the complete text content of an XML node, including the content of all child elements.
The content is converted to the desired character set according to the output flags set for the XML handle.
The optional Options parameter specifies whether the content is returned as text or as a binary buffer.
VSPECHXMLNODE XMLN:
Handle of the XML node whose complete content is to be retrieved.
XMLN must contain a valid VSPECHXMLNODE (XMLN) handle that references an XML node.
TEXT Options (Optional):
Specifies the data type of the returned attribute value.
Option : Meaning
"A" : Returns the attribute value as TEXT.
"B" : Returns the attribute value as VSPECBINBUFFER.
If Options is not specified, option "A" is used.
With option "A", the returned value must not exceed the maximum size of a text item.
With option "B", content up to a maximum size of 100 MB can be returned.
Return Value:
On successful execution, the @Function returns the complete text content of the XML node as TEXT or VSPECBINBUFFER, depending on Options.
The result includes not only the direct text content of the node, but also the text content of all child elements.
If the XML node handle is invalid, an invalid option is specified, or an error occurs during character set conversion, the @Function returns @ERROR.
Example: @XMLGetAllContent(XMLN);
XML := "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<customer>" +
" <name>Example GmbH</name>" +
" <city>Berlin</city>" +
"</customer>";
hXMLD := @XMLParse(XML);
hXMLRoot := @XMLGetRoot(hXMLD);
Content := @XMLGetAllContent(hXMLRoot);
@XMLRelease(hXMLD);
The example retrieves the complete text content of the root element. Content then contains the content of the "<name>" and "<city>" elements.
Example: @XMLGetAllContent(XMLN;Options);
XML := "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<customer>" +
" <name>Example GmbH</name>" +
" <city>Berlin</city>" +
"</customer>";
hXMLD := @XMLParse(XML);
hXMLRoot := @XMLGetRoot(hXMLD);
Content := @XMLGetAllContent(hXMLRoot;"B");
@DestroyBuffer(Content);
@XMLRelease(hXMLD);
The example returns the complete text content of the XML node as a VSPECBINBUFFER.
Note : This text was machine-translated and may contain inaccuracies.
