replace method

  1. @override
void replace(
  1. XmlNode other
)

Replace this node with other.

Implementation

@override
void replace(XmlNode other) {
  if (hasParent) {
    final siblings = parent.children;
    for (var i = 0; i < siblings.length; i++) {
      if (identical(siblings[i], this)) {
        siblings[i] = other;
        break;
      }
    }
  }
}