getChildElement static method
Given a tag(name) returns the first child element of a XmlElement that matches
Implementation
static XmlElement? getChildElement({required XmlElement node, required String tag})
{
try
{
Iterable<XmlElement> nodes;
nodes = node.findElements(tag, namespace: "*");
if (nodes.isNotEmpty) return nodes.first;
nodes = node.findElements(tag.toUpperCase(), namespace: "*");
if (nodes.isNotEmpty) return nodes.first;
nodes = node.findElements(tag.toLowerCase(), namespace: "*");
if (nodes.isNotEmpty) return nodes.first;
}
catch(e) {
Log().exception(e, caller: 'xml.dart => XmlElement getChildElement({XmlElement node, String tag})');
}
return null;
}