string
xmlFilePath =
"D:\\log_xml\\MarInfo.xml"
;
XmlDocument doc =
new
XmlDocument();
doc.Load(xmlFilePath);
string
rst =
""
;
XmlNodeList studentNodeList = doc.SelectNodes(
"Root/MarketList/Market"
);
if
(studentNodeList !=
null
)
{
foreach
(XmlNode studentNode
in
studentNodeList)
{
string
name = studentNode.Attributes[
"MarketName"
].Value+
":"
;
rst+= name;
XmlNode coursesNode = studentNode.SelectSingleNode(
"SubMarketList"
);
XmlNodeList courseNodeList = coursesNode.ChildNodes;
if
(courseNodeList !=
null
)
{
foreach
(XmlNode courseNode
in
courseNodeList)
{
rst += courseNode.Attributes[
"Name"
].Value+
","
;
}
rst +=
"<br/>"
;
}
}
}
Response.Write(rst);