XML 解析器:KMXmlParser
jopen
9年前
KMXmlParser 用于 iOS 和 Mac OS 的XML 解析器。可以将 XML 数据转换成 NSDictionary 或 NSArray。可以解析 SOAP 响应,可以打开/关闭一个属性的解析。支持 XPath 表达。
用法
Put this path "${SDKROOT}/usr/include/libxml2" under "Header Search Path" in section "Search Paths" of XCode's Build setting, include libxml2.dylib in "Link Binary With Libraries" list and add class files into your project. The common way to use an XML parser looks like this:
KMXmlParser *xmlParser = [[KMXmlParser alloc] init]; xmlParser.discloseArrayTags = @[@"item", @"book"]; result = [xmlParser parseXml:xmlData nodeName:@"books"];