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: 
mugurelu
Visitor

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 3
renojim
Community Streaming Expert

Re: Parse XML from web

try:
print contentxml.hls.live.gettext()
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
mugurelu
Visitor

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

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
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.