insert method

void insert(
  1. XmlInsertElementEdit insert
)

Inserts a new element based on the provided insert definition.

Implementation

void insert(XmlInsertElementEdit insert) {
  final (anchor, indent) = getInsertionAnchor(insert);
  if (anchor == -1) {
    throw ArgumentError('Insertion path not found: ${insert.path}');
  }

  _events.insertAll(anchor, insert.buildEvents(indent));
}