【发布时间】:2015-05-03 04:06:19
【问题描述】:
我的查询输出如下所示:
<ticker-entry gamecode=\"2015050110\" gametype=\"Playoffs\"><visiting-team display_name=\"Tampa Bay\" alias=\"TB\" nickname=\"Lightning\" id=\"20\" division=\"ECA\" conference=\"EC\" score=\"2\"><score heading=\"1\" value=\"0\"></score><score heading=\"2\" value=\"0\"></score><score heading=\"3\" value=\"1\"></score><score heading=\"OT\" value=\"0\"></score><score heading=\"OT2\" value=\"1\"></score><score heading=\"T\" value=\"2\"></score></visiting-team><home-team display_name=\"Montreal\" alias=\"Mon\" nickname=\"Canadiens\" id=\"10\" division=\"ECA\" conference=\"EC\" score=\"1\"><score heading=\"1\" value=\"0\"></score><score heading=\"2\" value=\"0\"></score><score heading=\"3\" value=\"1\"></score><score heading=\"OT\" value=\"0\"></score><score heading=\"OT2\" value=\"0\"></score><score heading=\"T\" value=\"1\"></score></home-team><gamestate status=\"Final\" display_status1=\"Final\" display_status2=\"2OT\" href=\"http://scores.nbcsports.msnbc.com/nhl/recap.asp?g=2015050110\" tv=\"NBCS/CBC\" gametime=\"7:00 PM\" gamedate=\"5/1\" is-dst=\"1\" is-world-dst=\"1\"></gamestate></ticker-entry>
它看起来像 XML,但我编写的 XML 解析器对此无能为力,因为括号不仅具有像 normale xml 中那样的单个单词的属性
<foo>
<bar>Value</bar>
</foo>
那么在objective-c中,将这个字符串拆分成逻辑结构的好方法是什么?
感谢您的帮助!
【问题讨论】:
标签: ios objective-c xml parsing