AttributeExtension extension

on
  • XmlStartElementEvent

Methods

attribute<T>(String attributeName, {Converter<T>? convert}) → Future<T>

Available on XmlStartElementEvent, provided by the AttributeExtension extension

Extracts an attribute by name. Throws MissingAttribute if not found.
hasAttribute(String attributeName) → Future<bool>

Available on XmlStartElementEvent, provided by the AttributeExtension extension

Checks for the presence of an attribute. Returns true if found.
namedAttribute<T>(String attributeName, {Converter<T>? convert, dynamic isRequired = false, T? defaultValue}) → Future<T?>

Available on XmlStartElementEvent, provided by the AttributeExtension extension

Extracts an attribute from an element, converting it into a desired type.
optionalAttribute<T>(String attributeName, {Converter<T>? convert}) → Future<T?>

Available on XmlStartElementEvent, provided by the AttributeExtension extension

Extracts an attribute by name. Returns null if not found.