views:

17

answers:

1

Hi Guys,

I am not understanding how to get the content of CDATA, I

NSString* htmlString = [self getnerateFormattedString:details]; [webView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.myWebsite.com"]];

-(NSString*) getnerateFormattedString:(TrackDetails*) details { NSString* htmlString = @""; htmlString = @"a {color: red}"; htmlString = [htmlString stringByAppendingString:@" "];

if (atrackDetails.trackTitle != nil)
{
    htmlString = [htmlString stringByAppendingString:@"<div align='center' >"];
    htmlString = [htmlString stringByAppendingString:@"<font size='4'>"];
    htmlString = [htmlString stringByAppendingString:details.trackTitle];
    htmlString = [htmlString stringByAppendingString:@"</b></font></div><br>"];
}
htmlString = [htmlString stringByAppendingString:@"<table width=300px cellpadding=5 cellspacing=5 border=0 align='center' height=10px> "];

}

Like this I am loading using loadHTMLString. But I don't know how to get CDATA Content to load webView.

Please Help Me, Thank you, Madan Mohan.

A: 

you have cdata code with html content

When you parse the Xml like this, shown below,

dataString =[dataString stringByAppendingString:@""];

dataString=[dataString stringByAppendingString:@"cdata code with html content for example"

dataString =[dataString stringByAppendingString:@""];

You will get this --> Only Html code that u can pass to method which it can dispaly in webview. Pass this string to loadHTMLString method in webView

Madan Mohan