"The Clansman" <Not His Real Name> wrote in message news:ef**************@TK2MSFTNGP12.phx.gbl...
I want to get the path of the xmlNo:
i.e.
Categories\Video games\Nintendo 64\Games\
I take it there is a Categories node beneath Games that is the one
you selected? (btw, element names can't include spaces.)
- - - ParentNodePath.vb (excerpt)
' . . .
Dim xn As XmlNode = xmlDoc.SelectSingleNode( "//Category")
If ( xn Is Not Nothing ) Then
' Import StringBuilder from System.Text
Dim buf As StringBuilder = New StringBuilder( 256)
xn = xn.ParentNode
While ( ( xn Is Not Nothing ) And ( xn.ParentNode Is Not Nothing ) )
buf.Insert( 0, '\')
buf.Insert( 0, xn.Name)
n = n.ParentNode
End While
End If
Dim parentPath As String = buf.ToString( )
' . . .
- - -
Assuming it finds a Category element in a node tree resembling your
example, parentPath will easily contain:
Categories\VideoGames\Nintendo64\Games\
Derek Harmon