Forum Discussion

hugetv's avatar
hugetv
Visitor
11 years ago

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

2 Replies

  • renojim's avatar
    renojim
    Community Streaming Expert
    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
  • good

    	raw = ReadASCIIFile("pkg:/config.opml")
    opml = CreateObject("roXMLElement")
    opml.Parse(raw)
    print opml.categories@StartupScreen