Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Regular Contributor
Posts: 56
Registered: ‎03-02-2012
My Device: 9780 & Playbook 32GB & Dev Alpha
My Carrier: Vodafone GR

How to get attribute value out of rss feed tag?

Hello devs. I used the rss example of the documentation.

The problem is on how to get the attribute from a specific tag of the feed

ex. the image tag is not like <image>www.something.com/image.jpg</image>

It is <enclosure url=" www.something.com/image.jpglength="0" type="image/jpeg" />

 

The problem i have is getting the url out of this tag and giving it a name. ex ListItemData.thaturl

 

It cant be that difficult. any suggestions?

 

PS. I know that then i have to find a way of displaying that picture. this is not my problem. I only need the way to get the attribute value.And i know that in cases of [content:media] it will not work.

Developer
Posts: 163
Registered: ‎04-28-2012
My Device: BlackBerry 9800
My Carrier: BlackBerry

Re: How to get attribute value out of rss feed tag?

[ Edited ]
  1. Hi,
     
        I think it will solve ur problem.

                  QDomElement  root = document.documentElement();
                  QDomNode child = root.namedItem("enclosure");
                  QDomElement childElement=child.toElement();
                  qDebug()<<childElement.attribute("url");
     
    check it once.
     
    Regards,
    Naresh Kodumuri.