Hi,
I cannot guess, why some XPath expressions in my code returns false and some
even errors, while the others returne true as I expected. I'am workin with VS
2008 Express Edition.
Dim xEl As XElement = <root><child1><child2/></child1></root>
Dim nav As XPathNavigator = xEl.CreateNavigator
nav.MoveToRoot()
Console.WriteLine(nav.Matches("*")) 'returns FALSE
Console.WriteLine(nav.Matches("root")) 'returns FALSE
Console.WriteLine(nav.Matches("/root")) 'returns FALSE
Console.WriteLine("--------------------------")
nav.MoveToFirstChild()
Console.WriteLine(nav.Matches("*")) 'OK, returns TRUE
Console.WriteLine(nav.Matches("child1")) 'OK, returns TRUE
Console.WriteLine(nav.Matches("child1[parent::root]")) 'OK, returns TRUE
Console.WriteLine(nav.Matches("//root/child1")) 'returns FALSE
Console.WriteLine(nav.Matches("*[self::child1]")) 'OK, returns TRUE
'Console.WriteLine(nav.Matches("self::child1")) 'raise error
'Console.WriteLine(nav.Matches("*/self::child1")) 'raise error
Console.ReadLine()