Forum Discussion

jeremyk's avatar
jeremyk
Visitor
14 years ago

Simple RSS parsing question

I am looping through an RSS feed using the following

for each item in xml.channel.item
'Gets the tile
tmp = item.GetNamedElements("media:title")

'Fails to get thumbnail because the thumbnail is actually in xml.channel.item.media:content
tmp = item.GetNamedElements("media:thumbnail")
next


The problem I have is that my media:thumbnail is nested under media:content so returns as null when I am walking through the tree looking for it. I was wondering if anyone knows how I can get into media:content and get to the thumbnail?

Thanks very much for the help.

1 Reply

  • Try this:


    for each item in xml.channel.item
    'Gets the tile
    tmp = item.GetNamedElements("media:title")

    mediaContentList = item.GetNamedElements ("media:content")
    tmp = mediaContentList [0].GetNamedElements("media:thumbnail")
    next