kissxml

(Kiss)XML xpath and default namespace

久未见 提交于 2019-12-23 19:33:50
问题 I am working on an iPhone project that needs to parse some xml. The xml may or may not include a default namespace. I need to know how to parse the xml in case it uses a default namespace. As I need to both read an write xml, I'm leaning towards using KissXML, but I'm open for suggestions. This is my code: NSString *content = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"bookstore" ofType:@"xml"] encoding:NSUTF8StringEncoding error:nil]; DDXMLDocument

KissXML not returning strings

流过昼夜 提交于 2019-12-22 18:25:14
问题 I have an example XML like this: <rss version="2.0"> <channel> <title></title> <link></link> <description></description> <item> <title></title> <link></link> <description></description> <pubDate></pubDate> <guid></guid> </item> and so on… And my obj-c syntax is looking like this: NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; DDXMLDocument *ddDoc = [[DDXMLDocument alloc] initWithData:data options:0 error:&error]; NSArray *xmlItems =

Swift Framework with libxml

谁说我不能喝 提交于 2019-12-18 16:30:38
问题 I have Swift Framework project that uses the KissXML Objective-C library. KissXML internally uses libxml. When I build the xcode project (Xcode 6 - beta 5), I get this error: error: <unknown>:0: error: '/SwiftFramework/SwiftFramework/KissXML/DDXMLNode.h:2: include of non-modular header inside framework module SwiftFramework.DDXMLNode I have seen this answer that discusses making the relevant header files public. I have done that but I am not sure how to address the case of this header that is

KissXML not returning strings

穿精又带淫゛_ 提交于 2019-12-06 14:14:51
I have an example XML like this: <rss version="2.0"> <channel> <title></title> <link></link> <description></description> <item> <title></title> <link></link> <description></description> <pubDate></pubDate> <guid></guid> </item> and so on… And my obj-c syntax is looking like this: NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; DDXMLDocument *ddDoc = [[DDXMLDocument alloc] initWithData:data options:0 error:&error]; NSArray *xmlItems = [ddDoc nodesForXPath:@"//item" error:&error]; // where ddDoc is your DDXMLDocument NSMutableArray

Swift Framework with libxml

风格不统一 提交于 2019-11-30 13:51:49
I have Swift Framework project that uses the KissXML Objective-C library. KissXML internally uses libxml. When I build the xcode project (Xcode 6 - beta 5), I get this error: error: <unknown>:0: error: '/SwiftFramework/SwiftFramework/KissXML/DDXMLNode.h:2: include of non-modular header inside framework module SwiftFramework.DDXMLNode I have seen this answer that discusses making the relevant header files public. I have done that but I am not sure how to address the case of this header that is imported in the DDXMLNode.h and that is not explicitly part of my project: #import <libxml/tree.h> Any