日期:2014-05-16 浏览次数:20522 次
<?xml version="1.0" encoding="UTF-8" ?>
<teacher LessonTitle="测试">
<general title="你懂的" msg="不懂"/>
<descrption document="jjkk" />
<part PartTitle="测试" PartNum="5" PartOver="1">
<sco ScoTitle="S001" isok="测试" />
<quest Title="测试" />
</part>
<part PartTitle="测试" PartNum="5" PartOver="1">
<sco ScoTitle="S001" isok="测试" />
<quest Title="测试" />
<!--间隔线-->
<sco ScoTitle="S001" isok="测试" />
<quest Title="测试" />
</part>
<part PartTitle="测试" PartNum="5" PartOver="1">
<sco ScoTitle="S001" isok="测试" />
<quest Title="测试" />
<!--间隔线-->
<sco ScoTitle="S001" isok="测试" />
<quest Title="测试" />
<!--间隔线-->
<sco ScoTitle="S001" isok="测试" />
<quest Title="测试" />
</part>
....part节点
</teacher>
public class teacher
{
public string LessonTitle { get; set; }
public general general{ get; set;}
public descrption descrption{ get; set;}
public List<part> partlist{ get; set; }
}
public class general
{
public string title { get; set; }
public string msg { get; set; }
}
public class descrption
{
public string document { get; set; }
}
//================>part
public class part
{
public string PartTitle { get; set; }
public string PartNum { get; set; }
public string PartOver { get; set; }
List<kk> sco_quest{ get; set; }
}
public class kk
{
public sco sco{ get; set; }
public quest quest{ get; set; }
}
public class sco
{
public string ScoTitle { get; set; }
public string isok { get; set; }
}
public class quest
{
public string Title { get; set; }
}
XmlSerializer serializer = new XmlSerializer(typeof(teacher));
using (TextReader reader = new StreamReader("XmlFile1.xml"))
&nbs