本文整理汇总了C#中System.Xml.XPath.XPathNavigator.MoveToFollowing方法的典型用法代码示例。如果您正苦于以下问题:C# XPathNavigator.MoveToFollowing方法的具体用法?C# XPathNavigator.MoveToFollowing怎么用?C# XPathNavigator.MoveToFollowing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了XPathNavigator.MoveToFollowing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XPathDocument
XPathDocument document = new XPathDocument("contosoBooks.xml");
XPathNavigator navigator = document.CreateNavigator();
navigator.MoveToFollowing("price", "http://www.contoso.com/books");
XPathNavigator boundary = navigator.Clone();
navigator.MoveToRoot();
while (navigator.MoveToFollowing(XPathNodeType.Text, boundary))
{
Console.WriteLine(navigator.OuterXml);
}
示例2: XPathDocument
XPathDocument document = new XPathDocument("contosoBooks.xml");
XPathNavigator navigator = document.CreateNavigator();
navigator.MoveToFollowing("book", "http://www.contoso.com/books");
XPathNavigator boundary = navigator.Clone();
boundary.MoveToFollowing("first-name", "http://www.contoso.com/books");
navigator.MoveToFollowing("price", "http://www.contoso.com/books", boundary);
Console.WriteLine("Position (after boundary): {0}", navigator.Name);
Console.WriteLine(navigator.OuterXml);
navigator.MoveToFollowing("title", "http://www.contoso.com/books", boundary);
Console.WriteLine("Position (before boundary): {0}", navigator.Name);
Console.WriteLine(navigator.OuterXml);
示例3: XPathDocument
XPathDocument document = new XPathDocument("contosoBooks.xml");
XPathNavigator navigator = document.CreateNavigator();
navigator.MoveToFollowing(XPathNodeType.Element);
Console.WriteLine("Position: {0}", navigator.Name);
Console.WriteLine(navigator.OuterXml);
示例4: XPathDocument
XPathDocument document = new XPathDocument("contosoBooks.xml");
XPathNavigator navigator = document.CreateNavigator();
navigator.MoveToFollowing("price", "http://www.contoso.com/books");
Console.WriteLine("Position: {0}", navigator.Name);
Console.WriteLine(navigator.OuterXml);