fromElement static method

XmlElement? fromElement(
  1. XmlElement element
)

Converts a g element into a group element. It returns null if the input is not a g element.

Implementation

static XmlElement? fromElement(XmlElement element) {
  if (element.name.local != ElementName.g) return null;

  return XmlElement(
    XmlName(ElementName.group),
    fromString(element.getAttribute(AttributeName.transform)),
    element.children.map((child) => child.copy()),
    element.isSelfClosing,
  );
}