You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I must admit, I've found this library a bit confusing so I could just be off on how to approach this. I'm trying to parse a Wikipedia dump (with a separate parser), but I first need to grab the content between <page> tags to pass to the parser.
The println! in the Ok(Event::Text(e)) only prints out "\n " repeatedly. Am I misunderstanding the purpose of the event or how to use it, or is there a different way to grab the text between two tags? I did try to use read_to_end_into(), but I couldn't understand how one turns the Range<usize> into actual text.
The text was updated successfully, but these errors were encountered:
then you've get exactly that result which your code does. Just after reading "\n " (between <page> and <tag>) you reset in_page and text obviously won't be included in the result.
I must admit, I've found this library a bit confusing so I could just be off on how to approach this. I'm trying to parse a Wikipedia dump (with a separate parser), but I first need to grab the content between
<page>
tags to pass to the parser.This is what I have so far.
The
println!
in theOk(Event::Text(e))
only prints out"\n "
repeatedly. Am I misunderstanding the purpose of the event or how to use it, or is there a different way to grab the text between two tags? I did try to useread_to_end_into()
, but I couldn't understand how one turns theRange<usize>
into actual text.The text was updated successfully, but these errors were encountered: