pau*_*991 5 iphone parsing objective-c xml-parsing
我有这样的xml ......
<object>
<list name="subscriptions">
<object>
<string name="id">feed/http://feeds.feedburner.com/computerdefense</string>
<string name="title">.:Computer Defense:.</string>
<list name="categories">
<object>
<string name="id">user/14761688561595773457/label/Hacking</string>
<string name="label">Hacking</string>
</object>
</list>
<string name="sortid">7372F971</string>
<number name="firstitemmsec">1240520939961</number>
<string name="htmlUrl">http://www.computerdefense.org</string>
</object>
<object>
<string name="id">feed/http://www.rawseo.com/news/feed/</string>
<string name="title">A blend of programming and seo</string>
<list name="categories">
<object>
<string name="id">user/14761688561595773457/label/Hacking</string>
<string name="label">Hacking</string>
</object>
</list>
<string name="sortid">D6766911</string>
<number name="firstitemmsec">1258495136927</number>
<string name="htmlUrl">http://www.rawseo.com/news</string>
</object>
<object>
<string name="id">feed/http://it-adsense.blogspot.com/atom.xml</string>
<string name="title">AdSense Blog-Italiano</string>
<list name="categories">
<object>
<string name="id">
user/14761688561595773457/label/Seo e Web Marketing
</string>
<string name="label">Seo e Web Marketing</string>
</object>
</list>
<string name="sortid">9FB570ED</string>
<number name="firstitemmsec">1233684720758</number>
<string name="htmlUrl">http://it-adsense.blogspot.com/</string>
</object>
<object>
<string name="id">feed/http://feeds.feedburner.com/aextnet</string>
<string name="title">AEXT.NET NET MAGAZINE</string>
<list name="categories"/>
<string name="sortid">70800CFE</string>
<number name="firstitemmsec">1277627346000</number>
<string name="htmlUrl">http://aext.net</string>
</object>
<object>
<string name="id">feed/http://feeds.feedburner.com/alessandroscoscia</string>
<string name="title">Alessandro Scoscia</string>
<list name="categories"/>
<string name="sortid">51CB8E6E</string>
<number name="firstitemmsec">1217001547735</number>
<string name="htmlUrl">http://www.alessandroscoscia.it</string>
</object>
<object>
Run Code Online (Sandbox Code Playgroud)
有人可以展示我该如何解析它?我需要解析的文本是在body变量中
NSMutableString *body = [[NSMutableString alloc]initWithData:responseData encoding:NSASCIIStringEncoding];
Run Code Online (Sandbox Code Playgroud)
我需要在一个数组或NSDictionary中插入所有信息
and*_*ndy 16
最好使用objective-c解析库.
这篇文章对一些可用的文章有很好的了解:
http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project
此外,此页面包含使用其中一个库的完整代码示例:
http://www.raywenderlich.com/725/how-to-read-and-write-xml-documents-with-gdataxml
| 归档时间: |
|
| 查看次数: |
26851 次 |
| 最近记录: |