Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
mugurelu
Level 7

Parse XML from web

Hello,

I was trying to parse a web hosted xml to extract the video link that should be played into a Roku application.
I seem to be stucked at extracting the hls text from here https://sdkdocs.roku.com/display/sdkdoc/ifXMLElement#ifXMLElement-Parse(xmlasString)asBoolean but still can't extract it.

I know that the xml is downloaded successfully and that the parent is indeed right.

if contentxml.getName() = "elmtv" 

returns true.

But how do I continue to extract the text for "hls" from a child below?

Can somebody please help me or at least put me on the right track?
Thanks!
0 Kudos
3 Replies
renojim
Level 8

Re: Parse XML from web

try:
print contentxml.hls.live.gettext()
0 Kudos
mugurelu
Level 7

Re: Parse XML from web

Yep. Found it here https://sdkdocs.roku.com/display/sdkdoc/Component+Architecture#ComponentArchitecture-BrightScriptXML...

Indeed it works! So simple!

Thank you @renojim !
0 Kudos
EnTerr
Level 8

Re: Parse XML from web

"mugurelu" wrote:
Indeed it works! So simple!

Yeah, the affordance of XML navigation is one of the great things of Roku/Brightscript
0 Kudos