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

New Contributor
Posts: 5
Registered: ‎12-11-2012
My Device: Curve 9360
My Carrier: Att

Parse xml doc in QML with javascript

I have a simple list in an xml data type. Is there a way to make that xml doc available to javascript in QML so that I can parse it. I want to display one item or more items for the list based on user input. Is this possible with an XML data model? 


/// xml doc 



   <item title="apple"/>

   <item title="banana"/>

  <item title="pear"/>



/// QML page


//....Container etc





   rootPathIndex[x]      //x might be where the output of a function controls what is displayed


 function xmlparser( y) // y is where an xml array or object would be delivered to a javascript function


Posts: 83
Registered: ‎02-05-2012
My Device: PRIV
My Carrier: T-Mobile

Re: Parse xml doc in QML with javascript



I recently answered a question about how to parse XML Data and get it to QML in this thread. I provide a Sample project which includes an XML Parser Class (C++) and shows how to retrieve XML Data with it from QML.