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

XMLNthAttrValue

Use this function to return the nth attribute value, as indicated by an index number you specify. This function is similar to the XMLNthAttrName function.

Syntax

XMLNthAttrValue (%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 attribute value indicated by the index number.

Example

In this example, the XMLFind function returns a list of attributes and the XMLNthAttrValue function returns the name of the first attribute in the list.

aStr="Attribute not found!";
%xXMLTree=LoadXMLList("test.xml");
%XMLTree=XMLFind(%xXMLTree,"Forms","Form/@*");
aStr=XMLNthAttrValue(%XMLTree, 1);
end
#rt=DestroyList(%xXMLTree);
return(aStr);

See also