I’m parsing an XML document using GData and some of the elements contain text with HTML tags.
<Paragraph>
Page 1 has some text
<br/>
<br/>
normal text
<br/>
<b>Strong Text</b>
<br />
<i>Italic Text</i>
<br />
normal text
</Paragraph>
NSString * para = [[[content elementsForName:@"Paragraph"] objectAtIndex:0]stringValue];
I’d like to the contents of the paragraph tag including the HTML tags to be assigned to the NSString para, but what I get is the text with all tags removed like below
Page 1 has some textnormal textStrong TextItalic Textnormal text
Is there any way to assign the entire string with HTML tags to an NSString?
You need to call XMLString method of GDataXMLNode. It will return you XML/HTML representation in string format.