本文介绍了如何获取XmlNode ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个xml,其中包含组织的雇用信息.
使用XPathQuery ..我已从xml检索到Empnodes.
现在导航每个节点,我为Empnodes创建了XPathNavigator.从XPathNavigator,我创建了XPathNodeIterator.
现在,我想从XPathNodeIterator创建一个XMLNode对象.
如何获取它?
I have a xml which contain employ information of an organization.
Using XPathQuery .. i have retrieved Empnodes form the xml.
Now to navigate each node, i have created XPathNavigator for the Empnodes .From XPathNavigator , i have created XPathNodeIterator.
Now i want to create an XMLNode object form the XPathNodeIterator.
How to get it??
推荐答案
XmlNode parentNode = myXMLDoc.SelectSingleNode("\\root\EmployeeNode");
foreach (XmlNode xn in parentNode.Nodes)
{
//Do something cool with the child node here.
}
霍根
Hogan
这篇关于如何获取XmlNode ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!