changeAttributeName static method

void changeAttributeName(
  1. XmlElement node,
  2. String tag,
  3. String name
)

Changes an XmlElement attribute value

Implementation

static void changeAttributeName(XmlElement node, String tag, String name)
{
  try
  {
    XmlAttribute? a = node.getAttributeNode(tag);
    if (a != null)
    {
      var value = a.value;
      node.removeAttribute(tag);
      setAttribute(node, name, value);
    }
  }
  catch(e)
  {
    Log().exception(e, caller: 'xml.dart => String attribute({XmlElement node, String tag})');
  }
}