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
sho3ebovich
Posts: 120
Registered: ‎12-22-2011
My Device: ---

Parsing XML Issue

Dears 

 

I want to parse xml from remore url  

 

the xml format :

 

<channels>

    <channel>
        <id>1</id>
        <name>channel_1</name>
        <image>imageUrl</image> 
    </channel>

    <channel>
        <id>2</id>
        <name>channel_2</name>
        <image>imageUrl</image>
    </channel>

</channels>

 

not i got it as QByteArray xmlByte

 

Now i need to convert this QByteArray to GroupDataModel

To be able to pass it via signal to QML 

 

Please Any Help 

Developer
canadainc
Posts: 19
Registered: ‎07-02-2013
My Device: BlackBerry Q10

Re: Parsing XML Issue

This is what you're looking for:

http://developer.blackberry.com/cascades/reference/bb__data__xmldataaccess.html#function-loadfrombuf...

 

Use XmlDataAccess to load up your data from your QByteArray. Then see the example at the top of that page, they use this data to now populate the GroupDataModel.