writeIterable method

void writeIterable(
  1. Iterable<XmlHasVisitor> nodes,
  2. [String separator]
)

Implementation

void writeIterable(Iterable<XmlHasVisitor> nodes, [String separator]) {
  final iterator = nodes.iterator;
  if (iterator.moveNext()) {
    if (separator == null || separator.isEmpty) {
      do {
        visit(iterator.current);
      } while (iterator.moveNext());
    } else {
      visit(iterator.current);
      while (iterator.moveNext()) {
        buffer.write(separator);
        visit(iterator.current);
      }
    }
  }
}