我有一个xml:
<pages>
<page id="1" pagename="mypagename">
<field>
<addedbox>
<label>myname</label>
<id>myid</id>
</addedbox>
</field>
</page>
</pages>
如何获得标签的价值?
答案 0 :(得分:0)
尝试
XmlDocument xDoc = new XmlDocument();
xDoc.Load("myxml.xml");
//XmlNode node = xDoc.SelectSingleNode("//pages/page[@id='1'])");
XmlNode node1 = (xDoc.SelectSingleNode("//pages/page[@id='1']/field/addedbox/label"));