views:

360

answers:

1

There's this XML file for an RSS feed which has a body:

    <description>
    <div>
        <img width=120 src=&#039;http://enjoythebest.ph/photos/news/150/57_1_100204125514.jpg&amp;#039;&gt;
    </div>
    <![CDATA[Hey come to Manor tomorrow night yo! featuring performances by BEATPHONIK X ADDLIB with KABAYAN KRUMP          MOVEMENT and MANILA'S KRUMP PIONEERS KRUMP PINOY! and of course our Fat Fridays line up: DJs KING,REGGIE and            OLIE on the deck! EMCEE PHAT JORGE on the mic! FAT FRIDAYS! See How Manor does it!]]>
</description>

I'm having trouble getting the data for the image (the one inside the div) and the one for the body (which is the one enclosed in CDATA).

XCode only seems to be able to read the first "<" after the opening description tag.

I can't edit the XML file from the backend, so I'm going to have to work with this.

Any ideas? TIA.

+1  A: 

Which library do you use to parse the xml file?

Normally, if you parse using NSXMLParser, it is able to recognize the CDATA block. You should handle your text inside this delegate method:

- (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock  

Learn more about how to parse an xml document by using event driven model here

sfa
Thanks for this :)
laura