replace method

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

Replace this node with other.

Implementation

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