Returns a GOMAttribute
object which represents the specified attribute
contained in the specified element. If the element has no attribute with the given name,
null
is returned.
GOMAttribute
type provides the most complete information about a particular
attribute, which is obtained dynamically both from the DSM (Data Source Model)
representing the current data source and the DSM Type providing the data type
information about the whole class of data sources this template was designed for.
You may rarely need using this function. If the only what you need is to obtain
a value of a particular attribute,
use getAttrValue()
or getAttrValues()
functions instead.
Parameters:
element
The element whose attribute is requested. If not specified, the generator context element is assumed, i.e. the same as the call:getAttr(contextElement, attrName)
Note: If this parameter is
null
, the function returnsnull
.
attrName
The attribute name.Note: Some DSM Types may support pseudo- (or formula-) attributes. Such attributes are specified with the FlexQuery expressions which calculate the attributes' values from another (real) attributes, possible with the use of some functions.
Pseudo-attributes are treated the same way as the normal ones. (That's actually why the pseudo-attributes were introduced in the first place). Obtaining a value of a pseudo-attribute will just evoke the internal processing of its formula (therefore, if an error occurred during this, it will be reported accordingly). Externally, accessing pseudo-attributes looks the same as the accessing the normal ones. So does this function.
See Also:
GOMAttribute, hasAttr(), getAttrValue(),
getAttrValues(), getAttrFirstValue(), setAttr()
Tip:
You may call this function in a more method-like style:
element.getAttr(attrName)