I have an XML document which I want to parse using NSXMLParser. One of the tags it can contain is <html>
, and in my parsed representation I want the contents of that tag, verbatim. However, when I parse the document, my delegate methods are called for the start, end and contents of each tag inside the html tag.
I can't get the provider of the document to add CDATA tags; nor can I use something other than NSXMLParser to parse the document.
Is there a way for me to tell the parser to treat the contents of HTML tags as CDATA and to leave them unparsed, even if they contain other tags?
NSXMLParser
? Convert data to string, do the necessary modification, convert back to data and pass it to parser. – Amar