depth property

  1. @override
int get depth
inherited

Return the depth of this node in its tree, a root node has depth 0.

Implementation

@override
int get depth {
  var result = 0;
  XmlNode current = this;
  while (current.parent != null) {
    current = current.parent!;
    result++;
  }
  return result;
}