Dim doc = New XPathDocument(Server.MapPath("Demo.xml"))
Dim nav = doc.CreateNavigator()
Dim xpathExpress = nav.Compile("//bk:Book[position()" + Me.ddownlist.SelectedValue.Trim() + Me.txtNum.Text.Trim() + "]")
'use AddNamespace
Dim xmlManager = New XmlNamespaceManager(nav.NameTable)
xmlManager.AddNamespace("bk", "http://myserver/myschemas/Books")
xpathExpress.SetContext(xmlManager)
Dim xIterator = nav.Select(xpathExpress)
Me.TextBox1.Text = ""
Me.TextBox1.ForeColor = System.Drawing.Color.Empty
Do While xIterator.MoveNext()
Me.TextBox1.Text = Me.TextBox1.Text + ControlChars.CrLf + xIterator.Current.Value
Loop
If (xIterator.Count.Equals(0)) Then
Me.TextBox1.Text = "There is no xml data in the condition."
Me.TextBox1.ForeColor = System.Drawing.Color.Red
End If
End Sub