ReadString method

Future<String> ReadString()

Implementation

Future<String> ReadString() async {
  if (_current is XmlStartElementEvent &&
      (_current as XmlStartElementEvent).isSelfClosing) {
    return "";
  } else {
    if (_current is XmlStartElementEvent) {
      await Read();
    }
    final buffer = StringBuffer();
    do {
      buffer.write((_current as XmlTextEvent).text);
    } while (await Read() && _current is XmlTextEvent);
    return _htmlUnescape.convert(buffer.toString());
  }
}