getAttr

fnstring getAttr(XmlElement elem, string attrName, string defaultValue = "")

Retrieves an attribute value from an element, returning a default when absent.

Parameters

elemThe element to read the attribute from.
attrNameThe attribute name.
defaultValueThe value to return when the attribute is missing. Defaults to `""`.

Returns

The attribute value, or defaultValue if the attribute is absent.