XML樣例:
<?xml version="1.0" encoding="gb2312"?> <bookstore> <book genre="李2紅" ISBN="2-3631-4"> <title>CS從入門到精通</title> <author>候捷</author> <price>58.3</price> </book> <book genre="李贊紅" ISBN="2-3631-4"> <title>CS從入門到精通</title> <author>小六</author> <price>58.3</price> </book> <book45 genre="李贊紅" ISBN="2-3631-4"> <title>CS從入門到精通</title> <author>大黃</author> <price>58.3</price> </book45> </bookstore>
測試代碼:
<span style="white-space:pre"> </span> XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("E:\\bookstore.xml"); //獲取bookstore節點的所有子節點 // 查看本欄目