parse static method

XmlLiteDocument parse(
  1. Uint8List bytes
)

Parses UTF-8 (optionally BOM-prefixed) XML. Throws FormatException on malformed input or a DTD that declares entities.

Implementation

static XmlLiteDocument parse(Uint8List bytes) {
  var start = 0;
  if (bytes.length >= 3 &&
      bytes[0] == 0xEF &&
      bytes[1] == 0xBB &&
      bytes[2] == 0xBF) {
    start = 3;
  }
  final text = utf8.decode(Uint8List.sublistView(bytes, start));
  return parseString(text);
}