如何获取标记并存储父级内其他标记的数据?

时间:2016-02-04 10:14:05

标签: xcode ios7 xml-parsing

我的XML文件如下所示

<NotifyInfo>
    <NotifyCount>5</NotifyCount>
    <Notify>
        <title>News/Notices</title>
        <count>1</count>
        <url>notice_board.jsp</url>
    </Notify>
    <Notify>
        <title>Results</title>
        <count>2</count>
        <url>reports.jsp</url>
    </Notify>
    <Notify>
        <title>Photo Gallery</title>
        <count>2</count>
        <url>photo_slider.jsp</url>
    </Notify>
</NotifyInfo>

我想得到<Notify></Notify>标签并存储每个通知的每个值,即标题,计数和网址,以便在需要时在我的项目中调用该值。

我已经使用了XMLReader类,我正在使用它来获取所有其他标记值,但是当父标记内有重复的标记时,我不知道如何解析数据。

0 个答案:

没有答案