How to process a CDATA tag when parsing an XML file in iPad

I am working on an application where I need to parse some XML files that contain CDATA tags. The parsing of plain xml is pretty straight forward, but I run into problems getting the data that is inside the CDATA tag.

The method parser:foundCDATA:is called for every CDATA tag encountered, where the CDATABlock parameter is of type NSData.

Please suggest a way to parse the CDATA tag.

+3
source share
2 answers

If you need to extract a string from CDATA, you can use this block in the found CDATA:

NSMutableString *lStr = [[NSMutableString alloc] initWithData:CDATABlock encoding:NSUTF8StringEncoding];
+5
source

CDATA, , XML-. , , CDATA, XMLParser, , . CDATA . foundCDATA, , .

0

Source: https://habr.com/ru/post/1788182/


All Articles