element static method

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

Returns the value of a child XmlElement element

Implementation

static String? element({required XmlElement node, required String tag})
{
  String? v;
  try
  {
    XmlElement? child = getChildElement(node: node, tag: tag.toUpperCase());
    child ??= getChildElement(node: node, tag: tag.toLowerCase());
    child ??= getChildElement(node: node, tag: tag);
    if (child != null) v = getText(child);
  }
  catch(e) {
    v = null;
    Log().exception(e, caller: 'xml.dart => String element({XmlElement node, String tag})');
  }
  return v;
}