You are here: Function Reference > Alphabetical Listing > X > XMLGetCurText

XMLGetCurText

UYearse this function to get the text from the current element. This function is similar to the XMLGetCurName function.

Syntax

XMLGetCurText (%XMLTree)

Parameter

Description

%XMLTree

A list type DAL variable. This variable can be either an XML tree or a list of extracted elements.

The system returns the text from the current element. The return value is a string type DAL variable.

Example

This example returns text from the last element in the list.

aStr="Text not found!";
%xXMLTree=LoadXMLList("test.xml");
%XMLTree=XMLFind(%xXMLTree,"Forms","Form[text()]");
#rc=XMLFirst(%XMLTree);
loop:
if #rc=0
goto endloop:
end
aStr=XMLGetCurName(%XMLTree);
#rc=XMLNext(%XMLTree);
goto loop:
endloop:
#rc=DestroyList(%xXMLTree);
return(aStr);

See also