日期:2014-05-17 浏览次数:20714 次
private static void Test()
{
string xmlStr = @"<a>
<exam_uid>145</exam_uid>
<exam_name>外国文学测试题</exam_name>
<exam_descp>外国文学测试题</exam_descp>
<customerid>22342</customerid>
<all_level>5</all_level>
<status>10</status>
<tag1>chinese</tag1>
<subject_name>语文</subject_name>
<subject_lev>2</subject_lev>
<subject_idx>2</subject_idx>
<number>30</number>
<subject_no>00010001</subject_no>
<all_q>30</all_q>
<fullname>在线客服九</fullname>
</a>";
var doc = new XmlDocument();
doc.LoadXml(xmlStr);
if (!doc.HasChildNodes) return;
foreach (XmlNode n in doc.ChildNodes)
{
if (n.Name == "a" && n.HasChildNodes)
{
string temp = string.Empty;
foreach (XmlNode na in n.ChildNodes)
&