attribute static method

String? attribute({
  1. required XmlElement node,
  2. required String tag,
})

Given an XmlElement and an attribute tag(name) we will get the attribute value

Implementation

static String? attribute({required XmlElement node, required String tag})
{
  String? v;
  try
  {
    v = node.getAttribute(tag.toLowerCase());
    v ??= node.getAttribute(tag.toUpperCase());
    v ??= node.getAttribute(tag);
  }
  catch(e) {
    v = null;
    Log().exception(e, caller: 'xml.dart => String attribute({XmlElement node, String tag})');
  }
  return v;
}