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
hemant_sain
Posts: 180
Registered: ‎12-09-2011
My Device: 9360, BB10

Parse local xml file in qml.

Hi All

 

I want to parse the xml file which i store in my assets folder and want to show the data in list, i tried this using datasource but it is not working.

Can somebody please provide code for this.

My xml is in this format:

 

<CountryListResponse xmlns="......">
<Countries>
<Country>
<CountryCode>AF</CountryCode>
<CountryID>1</CountryID>
<CountryName>Afghanistan</CountryName>
<Languages i:nil="true"/>
</Country>

<Country>
<CountryCode>IN</CountryCode>
<CountryID>2</CountryID>
<CountryName>India</CountryName>
<Languages i:nil="true"/>
</Country>
</Countries>
</CountryListResponse>

 

Plese someone provide the code to parse this xml and bind it into list.

 

Thanks in advance.

Trusted Contributor
Sith_Apprentice
Posts: 207
Registered: ‎05-02-2010
My Device: various

Re: Parse local xml file in qml.

https://developer.blackberry.com/cascades/documentation/device_platform/data_access/working_with_xml...

 

This should get you on the right track.

If you are the original poster (OP) and your issue is solved, please remember to click the "Accept as Solution" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the Star on the left of their post.