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

XMLNthText

Use this function to return the nth text value, as indicated by an index number you specify.

Syntax

XMLNthText (%XMLTree,#Index)

Parameter

Description

%XMLTree

A list type DAL variable that passes a name list.

#Index

A integer type DAL variable that passes an index number.

The system returns the nth text value indicated by the index number.

Example

In this example, the LoadXMLList function returns a text list and the XMLNthText function gets the first text.

AStr="Text not found";
%xXMLTree=LoadXMLList("test.xml");
%XMLTree=XMLFind(%xXMLTree,"Forms","Form/text()");
aStr=XMLNthtext(%XMLTree, 1);
#rt=DestroyList(%xXMLTree);
return(aStr);

See also