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: 

How to print these data using roXmlElement interfaces

for row = 0 to settings.numGridRows - 1
        channel = xml.Channel [channelIndex]
'print"channel------------>"channel
'nameElements = channel.getNamedElements("display-name")
nameElements = channel.getNamedElements("id")
print"id------------->"nameElements
name = nameElements.gettext()
print"id--------->"name

<channel id="I4.28458309.microsoft.com">
<display-name>4 WUNC</display-name>
<display-name>4</display-name>
<display-name>WUNC</display-name>
<display-name>PBS Affiliate</display-name>
</channel>

How to print id in channel
........................................................................................................

for programIndex = 0 to xml.programme.Count () - 1
   program = xml.programme [programIndex]
   nameElements = program.getNamedElements("channel")
   print"channel------------->"nameElements
   name = nameElements.gettext()
   print"channel--------->"name

<programme start="20150331113000 -0400" stop="20150331120000 -0400" channel="I4.28458309.microsoft.com">

how to print channel in programme

How to print these data using roXmlElement interfaces 
my console shows this when a run this code in my app this shows on console 
id-------------><Component: roXMLList> =
(
)
id--------->
id-------------><Component: roXMLList> =
(
)
id--------->
id-------------><Component: roXMLList> =
(
)
id--------->
id-------------><Component: roXMLList> =
(
)
id--------->
id-------------><Component: roXMLList> =
(
)
id--------->
id-------------><Component: roXMLList> =
(
)

after press * from Roku remote

channel--------->
channel-------------><Component: roXMLList> =
(
)
channel--------->
channel-------------><Component: roXMLList> =
(
)
channel--------->
channel-------------><Component: roXMLList> =
(
)
channel--------->
channel-------------><Component: roXMLList> =
(
)
channel--------->
channel-------------><Component: roXMLList> =
(
)
channel--------->
channel-------------><Component: roXMLList> =
(
)

Original XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">

<tv source-info-name="Zap2it" generator-info-name="mc2xml" generator-info-url="mailto:mc2xml@gmail.com">

<TimeInfo>
<StartTimeUTC>2017-01-11T00:00:00Z</StartTimeUTC>
<EndTimeUTC>2017-01-11T03:00:00Z</EndTimeUTC>
</TimeInfo>

<channel id="I4.28458309.microsoft.com">
<display-name>4 WUNC</display-name>
<display-name>4</display-name>
<display-name>WUNC</display-name>
<display-name>PBS Affiliate</display-name>
</channel>
       <programme start="20150331113000 -0400" stop="20150331120000 -0400" channel="I4.28458309.microsoft.com">
<title lang="en">Dinosaur Train</title>
<sub-title lang="en">Dinos A to Z, Part 3, Classification; Dinos A to Z, Part 4, A to Z Picnic</sub-title>
<desc lang="en">Don organizes the dinosaurs by species, features and size; all 26 dinosaurs enjoy a picnic where Tiny leads them all in the ``Dinosaurs A to Z'' song.</desc>
<credits>
<actor>Lee Tockar</actor>
<actor>Chantal Strand</actor>
</credits>
<date>20120517</date>
<category lang="en">Children</category>
<category lang="en">Comedy</category>
<category lang="en">Educational</category>
<category lang="en">Episodic</category>
<category lang="en">Kids</category>
<category lang="en">Series</category>
<episode-num system="onscreen">216</episode-num>
<episode-num system="ms_progid">1.EP011702490174</episode-num>
<episode-num system="dd_progid">EP01170249.0174</episode-num>
<audio>
<stereo>stereo</stereo>
</audio>
<previously-shown start="20120517000000" />
<subtitles type="teletext" />
<rating system="VCHIP">
<value>TV-Y</value>
</rating>
</programme>
</tv>
0 Kudos
4 REPLIES 4
EnTerr
Roku Guru

Re: How to print these data using roXmlElement interfaces

apologies but i have no idea what you are asking, somewhat lazy this morning and don't want to reverse-engineer everything.
My general inclination when having some `xml` to dump it to console is to marshal it with genXml():
? xml.genXml(0)
0 Kudos

Re: How to print these data using roXmlElement interfaces

<programme start="20150331140000 -0400" stop="20150331145800 -0400" channel="I237.28455611.microsoft.com">

sir i want to have the text contained within start , stop and channel ,please let me know what function has to be used .
0 Kudos
EnTerr
Roku Guru

Re: How to print these data using roXmlElement interfaces

"jitendragaurgkv" wrote:
<programme start="20150331140000 -0400" stop="20150331145800 -0400" channel="I237.28455611.microsoft.com">
sir i want to have the text contained within start , stop and channel ,please let me know what function has to be used .

Ah. See sdkdoc/Component+Architecture#AttributeOperator
and sdkdoc/ifXMLElement#GetAttributes()
' presumably some loop above, where programme = xml.programme[some index...] '
print programme@start, programme@stop, programme@channel
print programme.getAttributes()
0 Kudos

Re: How to print these data using roXmlElement interfaces

thanks sir
0 Kudos