MoveToFollowing() public method

public MoveToFollowing ( XPathNodeType type ) : bool
type XPathNodeType
return bool
        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;
        }
Ejemplo n.º 2
0
 /// <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);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Reposition the navigator on the next following node.
 /// </summary>
 public override bool MoveToFollowing(XPathNavigator navigator, XPathNavigator navEnd) {
     return navigator.MoveToFollowing(XPathNodeType.All, navEnd);
 }
Ejemplo n.º 4
0
        /// <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;
        }