Dart FFI bindings to a stream-oriented XML parser library written in C.
Expat excels with files too large to fit RAM, and where performance and flexibility are crucial.
import 'package:expat/expat.dart';
main() {
var parser = XmlParser(
onStartElement: (String element, List<String> attributes) {
print('onStartElement $element')
},
onCharacterData: (String data) {
print('onCharacterData $data');
},
onEndElement: (String element) {
print('onEndElement $element');
},
);
parser.parse(xml: '<foo>bar</foo>');
parser.dispose();
}