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: 
hugetv
Level 7

read config.opml file

this file config.opml

<?xml version="1.0" encoding="ISO-8859-1"?>
<opml version="1.0">
<categories
backgroundColor="#444444"
leftBreadcrumbColor="#00EE00"
rightBreadcrumbColor="#0000EE"
posterScreenTitleColor="#EE00C3"
posterScreenSubtitleColor="#00EE00"
posterScreenSynopsisColor="#EEEEEE"
springboardScreenTitleColor="#00EE00"
springboardScreenSynopsisColor="#EEEEEE"
springboardScreenActorColor="#EEEE00"
springboardScreenDirectorColor="#EEEE00"
springboardScreenDateColor="#EEEE00" StartupScreen="1">
<category title="LDS Media Library on USB" subtitle="" url="ext1:/medialibrary_downloaded.xml" showAsList="0" showAsPortrait="0" img="http://192.99.193.252/r/movie_large.png" />
<category title="LDS Media Library - Recent" subtitle="" url="" showAsList="2" showAsPortrait="0">
<category title="English - 4/12/15" subtitle="" url="pkg:/xml/medialibrary_recent_English_20150412.xml" showAsList="0" showAsPortrait="0" />
<category title="English - 4/5/15" subtitle="" url="pkg:/xml/medialibrary_recent_English_20150405.xml" showAsList="0" showAsPortrait="0" />
<category title="English - 3/29/15" subtitle="" url="pkg:/xml/medialibrary_recent_English_20150329.xml" showAsList="0" showAsPortrait="0" />
</category>

</categories>
</opml>
as to obtain the result marked in red
Our system http://www.rokumanager.com
0 Kudos
2 Replies
renojim
Level 8

Re: read config.opml file

Assuming you've read the XML into a string called xml:
xmlel = CreateObject("roXmlElement")
xmlel.Parse(xml) 'should really check the return value to see if it parsed correctly
print xmlel.categories@startupscreen

-JT
0 Kudos
hugetv
Level 7

Re: read config.opml file

good

	raw = ReadASCIIFile("pkg:/config.opml")
opml = CreateObject("roXMLElement")
opml.Parse(raw)
print opml.categories@StartupScreen
Our system http://www.rokumanager.com
0 Kudos