Hello corona,
I am trying to read news from this RSS feed “feed://www.fifa.com/worldcup/news/rss.xml”.
I am using the Coronal Business App Sample and switched from the Corona News Feed URL to Fifa News Feed URL and feed Name.
in order to do that I changed the following variables in the function myApp.showScreen2(event) in the main.lua to:
feedName = “rss.xml”
feedURL = “https://www.fifa.com/worldcup/news/”
By the way I could not start the URL with “feed://” because I get and error from “feed.lua” of unsupported URL !
When I try to load the RSS Feed the XML parser gives me the following error:
ERROR: Runtime error
xml.lua:136: attempt to index field ‘?’ (a nil value)
stack traceback:
xml.lua:136: in function ‘ParseXmlText’
xml.lua:156: in function ‘loadFile’
rss.lua:31: in function ‘feed’
feed.lua:329: in function ‘processRSSFeed’
feed.lua:352: in function feed.lua:345
This is not the actual XML Parsing error because the error concatenations had a wrong parameter:
so I changed from this:
error("XmlParser: unclosed "…stack[stack.n].name)
to this
("XmlParser: unclosed "…stack[#stack].name)
then and I got this XML parsing error:
ERROR: Runtime error
xml.lua:136: XmlParser: unclosed html
stack traceback:
[C]: in function ‘error’
xml.lua:136: in function ‘ParseXmlText’
xml.lua:157: in function ‘loadFile’
rss.lua:31: in function ‘feed’
feed.lua:329: in function ‘processRSSFeed’
feed.lua:352: in function feed.lua:345
I used Feedly, an RSS Feed Reader , to make sure there is no issue with the feed and it reads the news feed without any problem.
Can you help me fix this XML Parsing error?