2 linfeng 1245 linfeng_1245 于 2013.06.13 15:18 提问

android 如何进行嵌套 xml解析
<?xml version="1.0" encoding="utf-8" standalone="no"?>

<Programs>
      <Program>
           <name>默认播放</name>
           <type>DEFAULT</type>
           <StartTime/>
           <EndTime/>
           <ProgramID>default</ProgramID>
           <url>default.html</url>
           <BackgroundMusic>false</BackgroundMusic>
        </Program>  


      <Program>
           <name>指定一段日期和时间播放</name>
           <type>DAILY</type>
           <StartTime>2013-06-08 09:00:00</StartTime>
             <EndTime>2013-08-08 10:00:00</EndTime>
           <ProgramID>DailyList</ProgramID>
           <url>1.html</url>
           <BackgroundMusic>false</BackgroundMusic>
      </Program>  


      <Program>
           <name>周期播放,每周一三五指定时间段播放</name>
           <type>WEEKLY</type>
            <StartTime>2013-06-08 09:00:00</StartTime>
              <EndTime>2013-08-08 10:00:00</EndTime>
           <ProgramID>WeeklyList</ProgramID>
           <url>2.html</url>
           <BackgroundMusic>true</BackgroundMusic>
           <week>
                <monday start=09:00 end=10:00/>
                <tuesday/>
                <wednesday start=09:00 end=12:00/>
                <thursday/>
                <friday start=09:00 end=17:00/>
                <saturday/>
                <sunday/>                          
           </week>                 
        </Program>  


      <Program>
           <name>按月周期播放,约定每月1,8,18号播放</name>
           <type>monthly</type>
           <StartTime>2013-06-08 09:00:00</StartTime>
             <EndTime>2013-08-08 10:00:00</EndTime>
           <ProgramID>MonthlyList</ProgramID>
           <url>3.html</url>
           <BackgroundMusic>false</BackgroundMusic>
           <month>
                <date start=09:00 end=10:00>1</date>
                <date start=09:00 end=10:00>8</date>
                <date start=09:00 end=10:00>18</date>
           </month>        
        </Program>                          
 </Programs>    

1个回答

u010434246
u010434246   2017.02.13 16:51

推荐pull解析方式

Csdn user default icon
上传中...
上传图片
插入图片