toXmlEvents method
Converts a byte stream into a sequence of XmlEvent objects.
Automatically detects and strips Byte Order Marks (BOM) and resolves XML encoding declarations before parsing events.
For example:
await File('books.xml')
.openRead()
.toXmlEvents()
.normalizeEvents()
.forEach(print);
Implementation
Stream<List<XmlEvent>> toXmlEvents({
Encoding? defaultEncoding,
XmlEntityMapping? entityMapping,
bool validateDocument = false,
bool validateNamespace = false,
bool validateNesting = false,
bool validateAttributes = false,
bool withLocation = false,
bool withNamespace = false,
bool withParent = false,
}) => decodeXmlStream(defaultEncoding: defaultEncoding).toXmlEvents(
entityMapping: entityMapping,
validateDocument: validateDocument,
validateNamespace: validateNamespace,
validateNesting: validateNesting,
validateAttributes: validateAttributes,
withLocation: withLocation,
withNamespace: withNamespace,
withParent: withParent,
);