Arbortext Command Language > Functions by Alphabetical Listing > oid_attr_list
  
oid_attr_list
oid_attr_list (oid, arr[, dflt])
This function fills the associative array arr with a list of attributes set for the element identified by oid. This function returns the number of attributes in the array or 0 if the element has no attributes. Each attribute is stored in the array using the attribute name as the key, and its value as the array element value.
* 
Even if you have applied an alias map to the document, this function will return an attribute's real name, not its alias.
dflt is an optional third argument, which if non-zero, results in all attributes for the element identified by oid to be returned. For those attributes whose values are unspecified on the start tag oid, the default values are returned. For namespaced tags, oid_attr_list returns the namespace and any undefined attributes.
For example, the oid_attr function could be written using this function as:
function oid_attr(oid, attrname)
{
local al[]
oid_attr_list(oid, al)
return (attrname in al) ? al[attrname] : ""
}
The built-in function is more efficient, however, since it does not need to create an array using oid_attr_list to obtain the value.