2 ghsyue GHSYue 于 2016.01.25 15:36 提问

Android Pull解析复杂XML文件:这个Xml文件Android该怎么解析???
xml

<?xml version="1.0" encoding="UTF-8"?>
























2个回答

GHSYue
GHSYue   2016.01.25 15:40

<?xml version="1.0" encoding="UTF-8"?>

<Student>

    <item name="张三"         id="0"/>

    <item name="李四"         id="1"/>

    <item name="王五"         id="2"/>

    <item name="赵强"         id="3"/>

    <item name="沈阳"         id="4"/>

</Student>

<Class>

    <item name="一班"             id="0"/>

    <item name="二班"             id="1"/>

    <item name="三班"             id="2"/>

    <item name="四班"             id="3"/>

    <item name="五班"             id="4"/>

</Class>

<Teacher>

    <item name="王老师"  id="0" 
        handler="com.test.teacher.wangTeacher"/>

    <item name="刘老师"  id="1" 
        handler="com.test.teacher.liuTeacher"/>

    <item name="赵老师"  id="2" 
        handler="com.test.teacher.zhaoTeacher"/>

    <item name="张老师"  id="3" 
        handler="com.test.teacher.zhangTeacher"/>

    <item name="高老师"  id="4"
        handler="com.test.teacher.gaoTeacher"/>

</Teacher>

name="pingguschool"
clas="com.test.schoole.pingguSchool"/>

<School
    name="beijingschoole"
    clas="com.test.schoole.beijingSchool"/>

GHSYue
GHSYue 上边这个XML文件该怎么解析??
接近 2 年之前 回复
GHSYue
GHSYue   2016.01.25 15:40

<?xml version="1.0" encoding="UTF-8"?>

<Student>

    <item name="张三"         id="0"/>

    <item name="李四"         id="1"/>

    <item name="王五"         id="2"/>

    <item name="赵强"         id="3"/>

    <item name="沈阳"         id="4"/>

</Student>

<Class>

    <item name="一班"             id="0"/>

    <item name="二班"             id="1"/>

    <item name="三班"             id="2"/>

    <item name="四班"             id="3"/>

    <item name="五班"             id="4"/>

</Class>

<Teacher>

    <item name="王老师"  id="0" 
        handler="com.test.teacher.wangTeacher"/>

    <item name="刘老师"  id="1" 
        handler="com.test.teacher.liuTeacher"/>

    <item name="赵老师"  id="2" 
        handler="com.test.teacher.zhaoTeacher"/>

    <item name="张老师"  id="3" 
        handler="com.test.teacher.zhangTeacher"/>

    <item name="高老师"  id="4"
        handler="com.test.teacher.gaoTeacher"/>

</Teacher>

name="pingguschool"
clas="com.test.schoole.pingguSchool"/>

<School
    name="beijingschoole"
    clas="com.test.schoole.beijingSchool"/>

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!