Solution
I've actually found a solution to this problem, on com.prof.rssparser/Parser.kt file just trimming the rssFeed string before sending it do the XML parser does the job:
line 134 currently:
val f2 = service.submit(XMLParser(rssFeed))
becomes
val f2 = service.submit(XMLParser(rssFeed.trim()))
and I'm pretty sure it does not have almost any performance impact on the normal flow of the app.
A second option to fix this issue could be to add an option/parameter in the Parser class to do the trim on the rssFeed before parsing?
Hi,
I've fixed the issue by trimming the feed before parsing. That actually makes sense to do it. I'll make a new release with the fix soon
Thanks for the suggestion
Describe the bug When parsing an invalid XML RSS feed which starts with a newline the library throws an error.
org.xmlpull.v1.XmlPullParserException: Unexpected token (poisition:uknown @2:1 in java.io.InputStreamReader@f20908e)
My class:
The link of the RSS Feed https://www.cnj.jus.br/tag/inteligencia-artificial/feed/
Solution I've actually found a solution to this problem, on com.prof.rssparser/Parser.kt file just trimming the rssFeed string before sending it do the XML parser does the job:
becomes
and I'm pretty sure it does not have almost any performance impact on the normal flow of the app.
A second option to fix this issue could be to add an option/parameter in the Parser class to do the trim on the rssFeed before parsing?