我有这样的 XML 文件:
<activities>
<activity>
<filename>http://www.someurl.com/documentSetting/members/0/701/66/videos/521/521.mp4</filename>
<thumbnail>http://www.someurl.com/documentSetting/members/0/701/66/videos/521/521_120x90.jpg</thumbnail>
<id>521</id>
<is_private>0</is_private>
<comments>
<comment>
<id>111</id>
<body>Good video</body>
<member_id>oo7</member_id>
<profile_image>http://www.someurl.com/images/avatar/default_male_qlone.png</profile_image>
</comment>
<comment>
<id>222</id>
<body>nice video</body>
<member_id>123</member_id>
<profile_image>http://www.someurl.com/images/avatar/default_male_qlone.png</profile_image>
</comment>
<comment>
<id>333</id>
<body>gotcha!!!</body>
<member_id>11</member_id>
<profile_image>http://www.someurl.com/images/avatar/default_male_qlone.png</profile_image>
</comment>
</activity>
<activity>
<filename>http://www.someurl.com/documentSetting/members/0/701/66/videos/521/521.mp4</filename>
<thumbnail>http://www.someurl.com/documentSetting/members/0/701/66/videos/521/521_120x90.jpg</thumbnail>
<id>522</id>
<is_private>0</is_private>
<comments>
<comment>
<id>101</id>
<body>aaa</body>
<member_id>oo7</member_id>
<profile_image>http://www.someurl.com/images/avatar/default_male_qlone.png</profile_image>
</comment>
<comment>
<id>222</id>
<body>bbb</body>
<member_id>123</member_id>
<profile_image>http://www.someurl.com/images/avatar/default_male_qlone.png</profile_image>
</comment>
<comment>
<id>333</id>
<body>ccc</body>
<member_id>11</member_id>
<profile_image>http://www.someurl.com/images/avatar/default_male_qlone.png</profile_image>
</comment>
</activity>
现在我想解析这个 XML 文件并在 ListView ::: 中像这样显示它
将文件名标签视为状态 ::
状态一:
Comment 1
Comment 2
Comment 3
Comment 4
状态二:
Comment 1
Comment 2
Comment 3
假设第一个活动有 4 条评论作为嵌套标签,第二个活动在他的评论标签中有 3 条评论。
这个怎么做?