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);
     }
 }