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: 
belltown
Roku Guru

Re: VideoPlayer XML Question

For actors and categories, etc., i.e. any field that can appear more than once, do not use a separate XML element name for each one, use the same element repeated as many times as necessary, e.g:


<category>Drama</category>
<category>Romance</category>
<category>Mystery</category>
<actor>Sylvia Sidney</actor>
<actor>Oskar Homolka</actor>
<actor>Desmond Tester</actor>


In your BrightScript code, read the XML elements using a 'for each' loop and Push each item into an array, e.g:


item.Actors = [] ' Create an array of actors
for each actor in curShow.actor
item.Actors.Push (validStr (actor.GetText ()))
end for

item.Categories = [] ' Create an array of categories
for each category in curShow.category
item.Categories.Push (validStr (category.GetText ()))
end for
0 Kudos
dew
Visitor

Re: VideoPlayer XML Question

Thank you belltown, that did it 😄 thank you again for all of your help.
Cheers
DEW
0 Kudos