csharp System.Xml.XPath.XPathNavigator.NavigatorComparer类(方法)实例源码

下面列出了csharp System.Xml.XPath.XPathNavigator.NavigatorComparer 类(方法)源码代码实例,从而了解它的用法。

作者:.NET开发    项目:System.Xml.XPat   
XPathDocument document = new XPathDocument("books.xml");
XPathNavigator navigator = document.CreateNavigator();
Hashtable table = new Hashtable(XPathNavigator.NavigatorComparer);

// Add nodes to the Hashtable.
foreach (XPathNavigator navigator2 in navigator.Select("//book"))
{
    object value = navigator2.Evaluate("string(./title)");
    table.Add(navigator2.Clone(), value);
    Console.WriteLine("Added book with title {0}", value);
}

Console.WriteLine(table.Count);
Console.WriteLine("Does the Hashtable have the book \"The Confidence Man\"?");
Console.WriteLine(table.Contains(navigator.SelectSingleNode("//book[title='The Confidence Man']")));


问题


面经


文章

微信
公众号

扫码关注公众号