本文整理匯總了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;
}