XML Parser Error

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?

I turned the DEBUG flag on xml.lua and I was able to see that the parser is parsing all tag.

Attached is the rss.xml file that I copied from the rss.feed function. ( renamed it to rss.html because it was not uploading. if necessary please rename it to .xml

Hi,

Have you tried this https://github.com/robmiracle/Corona-SDK-RSS-Reader as a test? Works fine for me.

Make sure to change line 50 as noted in the readme.

-- processAtomFeed(feedName, baseDir) processRSSFeed(feedName, baseDir)

I used these values:

... local feedURL = "https://www.fifa.com/worldcup/news/rss.xml" local feedName = "rss.xml" ...

-dev

Simply change line 151 in main.lua to:

       feedURL = "https://www.fifa.com/worldcup/news/rss.xml",

Rob

Thanks Develephant,

It worked! Thanks.

Also I found out that feedURL = “https://www.fifa.com/worldcup/news/rss.xml” on the Corona Business Development App will also work if you add the rss.xml!

I turned the DEBUG flag on xml.lua and I was able to see that the parser is parsing all tag.

Attached is the rss.xml file that I copied from the rss.feed function. ( renamed it to rss.html because it was not uploading. if necessary please rename it to .xml

Hi,

Have you tried this https://github.com/robmiracle/Corona-SDK-RSS-Reader as a test? Works fine for me.

Make sure to change line 50 as noted in the readme.

-- processAtomFeed(feedName, baseDir) processRSSFeed(feedName, baseDir)

I used these values:

... local feedURL = "https://www.fifa.com/worldcup/news/rss.xml" local feedName = "rss.xml" ...

-dev

Simply change line 151 in main.lua to:

       feedURL = "https://www.fifa.com/worldcup/news/rss.xml",

Rob

Thanks Develephant,

It worked! Thanks.

Also I found out that feedURL = “https://www.fifa.com/worldcup/news/rss.xml” on the Corona Business Development App will also work if you add the rss.xml!