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

XMLAttrName

Use this function to return the name of the current attribute pointed to by the XMLFirstAttrib and XMLNextAttrib functions.

Syntax

XMLAttrName (%XMLTree)

Parameter

Description

%XMLTree

Enter a list type DAL variable that passes the XML tree handle.

The system returns the name of the current attribute pointed to by the XMLFirstAttrib and XMLNextAttrib functions.

Example

This example returns the second attribute name of the first form in the list.

aStr="Attribute not found!";
%xXMLTree=LoadXMLList("test.xml");
%XMLTree=XMLFind(%xXMLTree,"Forms","Form");
#rc=XMLFirst(%XMLTree);
#rc=XMLFirstAttrib(%XMLTree);
#rc=XMLNextAttrib(%XMLTree);
if #rc > 0
aStr=XMLAttrName(%XMLTree);
end
#rt=DestroyList(%xXMLTree);
return(aStr);

See also