CreateNavigator() публичный Метод

public CreateNavigator ( ) : XPathNavigator
Результат System.Xml.XPath.XPathNavigator
Пример #1
0
 public void TestMoveToId()
 {
     using (GumboWrapper gumbo = new GumboWrapper(TestHtml))
     {
         var nav = gumbo.CreateNavigator();
         nav.MoveToId("tag123");
         Assert.AreEqual("p", nav.Name);
     }
 }
Пример #2
0
 public void TestSelectSingleNodeForElement()
 {
     using (GumboWrapper gumbo = new GumboWrapper(TestHtml))
     {
         var nav = gumbo.CreateNavigator();
         var node = nav.SelectSingleNode("/html/body/span");
         Assert.AreEqual("Pillz here!", node.Value);
         Assert.AreEqual("span", node.Name);
         Assert.AreEqual("span", node.LocalName);
     }
 }
Пример #3
0
 public void TestSelectSingleNodeAttribute()
 {
     using (GumboWrapper gumbo = new GumboWrapper(TestHtml))
     {
         var nav = gumbo.CreateNavigator();
         var node = nav.SelectSingleNode("/html/body/@class");
         Assert.AreEqual("gumbo", node.Value);
         Assert.AreEqual("class", node.Name);
         Assert.AreEqual("class", node.LocalName);
     }
 }