日期:2014-05-17 浏览次数:21050 次
<?xml version="1.0" encoding="utf-8" ?>
<list>
<tablename id="WorkOrder" name="工单">
<dataFiled>filed1</dataFiled>
<dataNote>字段1</dataNote>
<dataFiled>filed2</dataFiled>
<dataNote>字段2</dataNote>
<dataFiled>filed3</dataFiled>
<dataNote>字段3</dataNote>
<dataFiled>filed4</dataFiled>
<dataNote>字段4</dataNote>
<dataFiled>filed5</dataFiled>
<dataNote>字段5</dataNote>
</tablename>
<tablename id="Other" name="其他">
<dataFiled>filed1</dataFiled>
<dataNote>字段1</dataNote>
<dataFiled>filed2</dataFiled>
<dataNote>字段2</dataNote>
<dataFiled>filed3</dataFiled>
<dataNote>字段3</dataNote>
<dataFiled>filed4</dataFiled>
<dataNote>字段4</dataNote>
<dataFiled>filed5</dataFiled>
<dataNote>字段5</dataNote>
</tablename>
</list>
string result = string.Empty;
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load("test.xml");
XmlNodeList nodeList = xmlDocument.SelectNodes("list/tablename");
foreach (XmlNode node in nodeList)