Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.xmlpull.v1.XmlPullParserException #1

Closed
MahdiFarzami opened this issue Sep 16, 2016 · 2 comments
Closed

org.xmlpull.v1.XmlPullParserException #1

MahdiFarzami opened this issue Sep 16, 2016 · 2 comments

Comments

@MahdiFarzami
Copy link

Hi , i try to load Rss feeds items from this url http://nasrnews.ir/%D8%A2%D8%B1%D8%B4%DB%8C%D9%88-%D8%A7%D8%AE%D8%A8%D8%A7%D8%B1/tabid/390/rssid/59/Default.aspx . the xml file doesn't actually start with so i get this error : org.xmlpull.v1.XmlPullParserException: Unexpected token (position:TEXT @1:2 in java.io.StringReader@c9503cd)
how can i solve this problem ?
thank

@prof18
Copy link
Owner

prof18 commented Sep 23, 2016

Hi, sorry for the late response but i'm very busy these days. I debug the parser using your feed and i found out that is working by adding this on tag:

<rss version="2.0"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  >

The line "" is attached to the feed automatically, so it's not the problem. By modifing manually the result string on onPostExcute it's work. Here it is an example of the feed that works:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  >
  <channel>
    <title>حوزه و دانشگاه</title>
    <description> </description>
    <link>http://nasrnews.ir/Default.aspx?TabId=390&amp;rssid=59&amp;Default.aspx</link>
    <language>fa-IR</language>
    <managingEditor>info@setaksoft.com</managingEditor>
    <webMaster>info@setaksoft.com</webMaster>
    <pubDate>Sat, 24 Sep 2016 01:50:59 GMT</pubDate>
    <lastBuildDate>Sat, 24 Sep 2016 01:50:59 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>PackFlash Publishing RSS Generator Version 0.0.0.0</generator>
    <item>
      <title>نتایج دوره‌های کارشناسی و کارشناسی ارشد دانشگاه آزاد اعلام شد</title>
      <description>&lt;p style="text-align: justify;"&gt;نصر: رییس مرکز سنجش و پذیرش دانشگاه آزاد اسلامی از اعلام نتایج دوره&amp;zwnj;های کارشناسی با آزمون و کارشناسی ارشد این دانشگاه خبر داد.&lt;/p&gt;
&lt;p&gt;&lt;a href='http://nasrnews.ir/News/tabid/243/ArticleID/57849/نتایج-دوره‌های-کارشناسی-و-کارشناسی-ارشد-دانشگاه-آزاد-اعلام-شد'&gt;بیشتر...&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://nasrnews.ir/News/tabid/243/ArticleID/57849/نتایج-دوره‌های-کارشناسی-و-کارشناسی-ارشد-دانشگاه-آزاد-اعلام-شد</link>
      <comments>http://nasrnews.ir/News/tabid/243/ArticleID/57849/نتایج-دوره‌های-کارشناسی-و-کارشناسی-ارشد-دانشگاه-آزاد-اعلام-شد</comments>
      <pubDate>Thu, 22 Sep 2016 14:50:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
    </item>
    <item>
      <title>نتایج کارشناسی با آزمون دانشگاه آزاد ساعت ۱۴امروز اعلام می شود</title>
      <description>&lt;p style="text-align: justify;"&gt;نصر: سخنگوی دانشگاه آزاد گفت: نتایج نهایی دوره های کارشناسی با آزمون سال ۹۵ این دانشگاه ساعت ۱۴ امروز اعلام می شود.&lt;/p&gt;
&lt;p&gt;&lt;a href='http://nasrnews.ir/News/tabid/243/ArticleID/57838/نتایج-کارشناسی-با-آزمون-دانشگاه-آزاد-ساعت-۱۴امروز-اعلام-می-شود'&gt;بیشتر...&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://nasrnews.ir/News/tabid/243/ArticleID/57838/نتایج-کارشناسی-با-آزمون-دانشگاه-آزاد-ساعت-۱۴امروز-اعلام-می-شود</link>
      <comments>http://nasrnews.ir/News/tabid/243/ArticleID/57838/نتایج-کارشناسی-با-آزمون-دانشگاه-آزاد-ساعت-۱۴امروز-اعلام-می-شود</comments>
      <pubDate>Thu, 22 Sep 2016 10:54:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
    </item>
  </channel>
</rss>

Obviously this is a badass workaround, but in the next days/week i'll think something thats gonna fix this.

@MahdiFarzami
Copy link
Author

thank you.

@FirstVoyager FirstVoyager mentioned this issue May 12, 2018
prof18 pushed a commit that referenced this issue Jan 4, 2020
prof18 pushed a commit that referenced this issue Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants