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
Developer
Posts: 216
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline
Accepted Solution

How to get "content:encoded" from XML using QML

I downloaded RSS news example, it's work good, but if I need change "description" to "content:encoded" how I can make it? Because if I change "feedItem.description" to "feedItem.content:encoded" it isn't work.

 

Maybe somebody know solution?

 

 

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

Re: How to get "content:encoded" from XML using QML

a way I solved this is by using yahoo pipes. you can rename content:encoded to anything you want and then create a new rss that you can asign that anything to item.description. and then just change the url at the qml. it works fine.

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

Re: How to get "content:encoded" from XML using QML

and if content:encoded is html content, you can easily get it with a webview.

 

Developer
Posts: 216
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: How to get "content:encoded" from XML using QML

Yes it using webview, but ":" cause error because irs a array feedItem.description. If I use feeditem.content:encoded it can't work, because its an error.
Developer
Posts: 216
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: How to get "content:encoded" from XML using QML

I don't want use proxying of rss feeds for stable working of my app.
Developer
Posts: 216
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: How to get "content:encoded" from XML using QML

I try Qt feature XmlRole for renaming but it not help me.
Regular Contributor
Posts: 56
Registered: ‎03-02-2012
My Device: 9780 & Playbook 32GB & Dev Alpha
My Carrier: Vodafone GR

Re: How to get "content:encoded" from XML using QML

there must be a way that this could be handled inside your app. but i dont know it.lol

 

the only solution i could figure out was renaming with yahoo pipes and I get title and pubDate for every item the same way as before and i changed only description. so when someone chooses an item in the list view, he gets a new content page that has this inside:

Container {
        ScrollView {
            WebView {
                html: "<html>" +
                           "<body>"+
                           contentView.description +
                           "</body>" +
                           "</html>"
                settings.zoomToFitEnabled: true
                settings.activeTextEnabled: true
                settings.defaultFontSize: 35
                settings.minimumFontSize: 35
            }      
            }        
    }

 and i  get a nice html webview of the content and the pics and everything.

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

Re: How to get "content:encoded" from XML using QML

IMG_00000119.pngIMG_00000118.png

Developer
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C
My Carrier: Rogers

Re: How to get "content:encoded" from XML using QML

How would I add images to the rss feed section before being pushed to the WebView. Also alexchristou do you have Facebook and twitter integration working. Based on you pic.

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Regular Contributor
Posts: 56
Registered: ‎03-02-2012
My Device: 9780 & Playbook 32GB & Dev Alpha
My Carrier: Vodafone GR

Re: How to get "content:encoded" from XML using QML

It depends on the feed. If ther is enclosure.url i remane through pipes. If it is content:encoded i try webview as the example above.if you get the image link try webimageview(there is somewhere in the forum) else try imageloader example, although i didnt try it yet. Fb and twitter not working, although no need for those buttons to be there. Share invocation should do all the work.