How to handle the CDATA tag while parsing an XML file in iPad

馋奶兔 提交于 2019-12-05 19:51:15

If you need to extract the string from CDATA, you could use this block in foundCDATA:

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

i have taken string from the CDATA tag as Oleg Danu said but still it consists XML tags.So i wrote that entire string to a file,whenever CDATA found, and created one more XMLParser by setting the delegate to same class as that of original Parser.All tags in CDATA tag are parsed properly by the secondary parser.The parser will be released at the end of the foundCDATA method and actual parsing continues as it is.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!