繁体   English   中英

如何在Android中读取和显示特定的xml数据

[英]How to read and display particular xml data in android

我只想知道正在玩哪个游戏。

一个网址是-> wwww.something.com/data.xml是

<?xml version="1.0" encoding="UTF-8"?>
<Cricket>
   <WC Group="A" Day="Sunday">
      <DayMatch>Aus Vs Ind</DayMatch>
      <NightMatch>Ban Vs S A</Night>
   </WC>
   <WC Group="A" Day="Monday">
      <DayMatch>Ind Vs Ban</DayMatch>
      <NightMatch>Aus Vs S A</NightMatch>
   </WC>
     <WC Group="B" Day="Sunday">
      <DayMatch>Eng VS NZ</DayMatch>
      <NightMatch>Pak Vs Zim</NightMatch>
   </WC>
   <WC Group="B" Day="Monday">
      <DayMatch>Pak VS Eng</DayMatch>
      <NightMatch>Zim Vs NZ </NightMatch>
   </WC>
</Cricket>

现在,我给了输入组A和Day Mondday,然后我希望输出A组和星期一整日和晚上的游戏灯具:

    Ind Vs Ban
    Aus Vs S A

你有什么想法吗 如何在xml中访问组和日期值。

为每个组声明ID。 根据ID和组名,您可以在代码上写条件。

使用SAX Parser解析此文件,并将其放入必须创建的WC模型列表中,例如List<WC>然后在此列表中搜索

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM