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

XMLNthAttrName

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

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 name indicated by the index number.

Example

In this example, the XMLFind function returns a list of attributes and the XMLNthAttrName 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=XMLNthAttrName(%XMLTree, 1);
end
#rt=DestroyList(%xXMLTree);
return(aStr);

See also