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
Highlighted
Regular Contributor
Posts: 75
Registered: ‎05-31-2013
My Device: 9900
My Carrier: Ufone

parsing xml into listview in c++

hi all

 

i am using soap webservice

i need some help  regarding parsing xml recieved from server

 

i am recieving server response from this line

const QtSoapType& responseValue = response.returnValue();

and getting this response

 

<root><news><item><id>180</id><title>????? ???? ??? "???? 2" ?? ???? ??? ????? ??????.. ??????? ???? ?????? ????? ????? ?? ????</title><description> &#1571;&#1593;&#1604;&#1606; &#1606
;&#1575;&#1574;&#1576; &#1608;&#1586;&#1610;&#1585; &#1575;&#1604;&#1582;&#1575;&#1585;&#1580;&#1610;&#1577; &#1575;&#1604;&#1585;&#1608;&#1587;&#1610;&#1548; &#1594;&#1610;&#1606;&#1575;&#1583;&#1610; &#1594;&#1575
;&#1578;&#1610;&#1604;&#1608;&#1601;, &#1610;&#1608;&#1605; &...

 

how to parse this xml and show in list and how to convert the data in correct format

can you all help please ?

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: parsing xml into listview in c++

looks quite strange to me, maybe an encoding issue?
if you want it in a listview you could use https://developer.blackberry.com/native/reference/cascades/bb__data__xmldataaccess.html
otherwise use qtxml, for example
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Regular Contributor
Posts: 75
Registered: ‎05-31-2013
My Device: 9900
My Carrier: Ufone

Re: parsing xml into listview in c++

i am doing parsing this way

 

qDebug() << "Test XML Value\n" + xml.name().toString() ;
while (!xml.atEnd())
{
xml.readNext();

if (xml.isStartElement())
{
if (xml.name() == "id" )
{
qDebug() << " ::::::::::: country_name ::::::::: "+xml.name().toString()+" ====== "+xml.readElementText().toUtf8();
}
if (xml.name() == "description" )
{
qDebug() << " ::::::::::: country_currency ::::::::: "+xml.name().toString()+" ====== "+xml.readElementText().toUtf8();
}
}
}

 

getting this result

 

أجرى وزير الخارجية الروسي سيرغ
ي لافروف والمبعوث الاممي الأخØÂ...

 

can you tell me, in which format do i have to convert this

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: parsing xml into listview in c++

usually utf8 is used to transfer unicode characters. check what the server sends you.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Regular Contributor
Posts: 75
Registered: ‎05-31-2013
My Device: 9900
My Carrier: Ufone

Re: parsing xml into listview in c++

server is sending me the text in arabic language

i think mostly it is utf

 

any solution for this ?

 

Regular Contributor
Posts: 75
Registered: ‎05-31-2013
My Device: 9900
My Carrier: Ufone

Re: parsing xml into listview in c++

can anyone tell me, how to parse xml in datamodel and show it in listview ?