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
matizeitune
Posts: 366
Registered: ‎07-15-2013
My Device: blackberry Z10

Brought from an xml description Internet

I have a problem about that when I bring data from an xml internet, I look bad descriptions in the internet page looks good, and in my app looks all accumulated
For Example:

On the Internet:

ingredients

4 fillets of hake
1 lemon
1 red pepper
1 tablespoon Provençal
2 tablespoons oil
200 grams of cream
1 small glass of sherry
2 tablespoons blue cheese
Salt and pepper to taste

 

In my app:

Ingredients 4 fillets of hake 1 lemon 1 red pepper 1 tablespoon oil 2 tablespoons Provencal 200 grams of cream [...]

 

Here's the full code http://paste2.org/583mbGLJ

 

I hope you can help
thanks

If you find this information useful please click like --->
@mezeitune on twitter
Developer
YamilBracho
Posts: 713
Registered: ‎05-31-2010
My Device: 8520

Re: Brought from an xml description Internet

I think you have to convert HTML <br> to newline char ("\n"). Use the method replace() of QString

Developer
matizeitune
Posts: 366
Registered: ‎07-15-2013
My Device: blackberry Z10

Re: Brought from an xml description Internet

I do not think is what you you say, that already in the xml looks like this

although there is a label that is (<content:encode>) that there is shown correctly, but when I call I get error

 

This is the xml

 

http://www.universoderecetas.com.ar/feed/

If you find this information useful please click like --->
@mezeitune on twitter
Developer
YamilBracho
Posts: 713
Registered: ‎05-31-2010
My Device: 8520

Re: Brought from an xml description Internet

Did your parse the <content:encoded> ? If so, note the </br> tag. this is it I am tallking about..

Contributor
JUhrig
Posts: 31
Registered: ‎09-25-2012
My Device: N/A

Re: Brought from an xml description Internet

[ Edited ]

Could you post the code where you assign the page properties? And where you parse the xml.

Developer
matizeitune
Posts: 366
Registered: ‎07-15-2013
My Device: blackberry Z10

Re: Brought from an xml description Internet

yes , this is the main.qml

http://paste2.org/D3IEwzZw

 

And this is the page2.qml

http://paste2.org/3PAYzPOh

If you find this information useful please click like --->
@mezeitune on twitter
Contributor
JUhrig
Posts: 31
Registered: ‎09-25-2012
My Device: N/A

Re: Brought from an xml description Internet

Just to try something can you change the text area which holds the ingredient  to a label with multi line set to true and then print the lable text to the console to make sure it has all the correct carrige returns in it.

 

Developer
matizeitune
Posts: 366
Registered: ‎07-15-2013
My Device: blackberry Z10

Re: Brought from an xml description Internet

but in what way might call <content:encoded> label that is not a common label as it has the (:smileyhappy:
when I refer to call, say for example this (ListItemData.content)

If you find this information useful please click like --->
@mezeitune on twitter