netvl / xml-rs

An XML library in Rust
MIT License
461 stars 113 forks source link

Would be nice to report the stream position for an emitted XmlEvent #192

Open filmil opened 4 years ago

filmil commented 4 years ago

This would help the event processor orient itself in the input stream (perhaps it needs to output some error message that does not pertain to the syntax).

netvl commented 4 years ago

At the moment, you can use the Position trait, which is implemented for EventReader. This, unfortunately, does prevent you from using the into_iter() interface.

In the new version of the API, I'll have to think about how to fit it in. Thanks!