Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
destruk
Streaming Star

Parse XML in chunks?

To eliminate the memory limit of the Roku boxes, is it possible to parse an RSS feed in pieces, rather than having to parse the entire thing? And how could you resume parsing when needed later in the script?
Or is truly the best solution to use mysql and do a limit query?
0 Kudos
4 REPLIES 4
kbenson
Visitor

Re: Parse XML in chunks?

I imagine if you need, you could use a regular expression to break the downloaded RSS into chunks without too much trouble. If you post a sample, I'd be happy to help.
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos
destruk
Streaming Star

Re: Parse XML in chunks?

I'm still trying to get a feel for how this works. I ran across this post which makes me worry about the memory limit - viewtopic.php?f=34&t=35105&p=226658&hilit=out+of+memory+xml#p226658
There aren't any specifications as to how much ram each roku device ships with, how fast the processor is, etc etc, so for now I have the following questions:
When downloading an XML, what is the size of the storage area for the source file? ie - if I download a 3MB XML to parse, or pick and choose what data to add to an array, what would be the file size limit to hold the source xml?
Does all the XML need to exist before the screen is displayed, or can I have it load the episode xml based on which category is selected?
Most of the examples use static data - is there a better dynamic example available anywhere besides deviantart and/or the video player?
Does the size of a url matter in a content list as far as memory goes? - ie is there any ram benefit to using a url shortening service like tinyurl to allow you to have more array entries?
0 Kudos
jbrave
Channel Surfer

Re: Parse XML in chunks?

Generally, one would get the XML from a server that has URL based controls on the amount of data returned. For instance, I request data for my channels in chunks of 20 records so there is never a problem.

Http://API.company.com/files.XML?limit=20&page=0

Which should give a list of 20 files. To get the next 20, page=1

So if you are generating XML, make sure you have a control like that set up. If you are just serving XML as a file, then break it up into many files like 1.XML, 2.XML, 3.XML etc.

-Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
destruk
Streaming Star

Re: Parse XML in chunks?

Thanks. 🙂
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.