本文整理汇总了C#中System.Xml.XPath.XPathNavigator.MoveToFollowing方法的典型用法代码示例。如果您正苦于以下问题:C# XPathNavigator.MoveToFollowing方法的具体用法?C# XPathNavigator.MoveToFollowing怎么用?C# XPathNavigator.MoveToFollowing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XPath.XPathNavigator
的用法示例。
在下文中一共展示了XPathNavigator.MoveToFollowing方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GrabBackDropUrls
public IList<string> GrabBackDropUrls(XPathNavigator nav)
{
List<string> urls = new List<string>();
XPathNodeIterator nIter = nav.SelectChildren("backdrop", "");
if (nav.MoveToFollowing("backdrop", ""))
{
XPathNavigator localNav = nav.CreateNavigator();
nav.MoveToParent();
for (int i = 0; i < nIter.Count; i++)
{
if (localNav.GetAttribute("size", "").ToUpperInvariant().Equals("original".ToUpperInvariant()))
urls.Add(localNav.Value);
localNav.MoveToNext();
}
}
return urls;
}
示例2: MoveToFollowing
/// <summary>
/// Reposition the navigator on the next following element with a matching name.
/// </summary>
public override bool MoveToFollowing(XPathNavigator navigator, XPathNavigator navEnd) {
return navigator.MoveToFollowing(this.localName, this.namespaceUri, navEnd);
}
示例3: GetXmlNamespaceManager
/// <summary>
/// Reads an XPathNavigator object and returns an XmlNamespaceManager containing all namespaces found within it. The default namespace is x.
/// </summary>
/// <param name="xpn">The XPathNavigator to be assessed for namespaces</param>
/// <returns></returns>
public static XmlNamespaceManager GetXmlNamespaceManager(XPathNavigator xpn)
{
xpn.MoveToFollowing(XPathNodeType.Element);
XmlNamespaceManager xmlnsm = new XmlNamespaceManager(xpn.NameTable);
xmlnsm.AddNamespace("x", xpn.NamespaceURI);
foreach (KeyValuePair<string, string> xns in xpn.GetNamespacesInScope(XmlNamespaceScope.All))
xmlnsm.AddNamespace(xns.Key, xns.Value);
return xmlnsm;
}