public void SelectorExample2() { var selector = new NamePathSelector(new string[] {"case", "shelf", "book"}); var result = selector.Match(_root); Assert.That(result.Count, Is.EqualTo(1)); foreach (var resultNode in result) { Debug.WriteLine(string.Format("Match: {0}", resultNode.Output())); } }
public void SelectorExample1() { var selector = new NamePathSelector(new[] { "animal" }); var result = selector.Match(_root); Assert.That(result.Count, Is.EqualTo(2)); foreach (var resultNode in result) { Debug.WriteLine(string.Format("Match: {0}", resultNode.Output())); } }
public static void Main(string[] args) { var root = NodeTrees.ExampleFromOriginalProblem; var selector = new NamePathSelector(new string[] { "case", "book" }); var result = selector.Match(root); foreach (var resultNode in result) { Console.WriteLine(String.Format("Match: {0}", resultNode.Output())); } selector = new NamePathSelector(new string[] { "case", "shelf", "book" }); result = selector.Match(root); foreach (var resultNode in result) { Console.WriteLine(String.Format("Match: {0}", resultNode.Output())); } }