CDATA xml parsing extra greater than problem

Posted by Ruchir Shah on Stack Overflow See other posts from Stack Overflow or by Ruchir Shah
Published on 2010-06-16T08:07:40Z Indexed on 2010/06/16 8:12 UTC
Read the original article Hit count: 262

Filed under:
|
|
|
|

Hi,

I am creating an xml using php and parsing that xml in iphone application code. In description field there is some html tags and text.

I am using following line to convert this html tags in to xml tag using CDATA.

 $response .= '<desc><![CDATA['.trim($feed['fulltext']).']]></desc>';

Now, here my $feed['fulltext'] value is like this

<span class="ABC">...text...</span>

In xml I am getting following response,

<desc><![CDATA[><span class"ABC">...text...</span>]]></desc>

You can see here, I am getting an extra greater-than symbol just before the value of $feed['fulltext'] starts. (like this: >...text...)

Any solution or suggestion for this?

Thanks in advance. Cheers.

© Stack Overflow or respective owner

Related posts about php

Related posts about html