requireAttr

fnstring requireAttr(XmlElement elem, string attrName, string location = "")

Retrieves a required attribute value from an element.

Parameters

elemThe element to read the attribute from.
attrNameThe attribute name.
locationOptional location string for diagnostics. Defaults to `""`.

Returns

The attribute value as a string.

Throws

OdfXmlException when the attribute is missing or empty.