Two methods:
First, use the selectnodes method. The following example shows how to use this method.
Second, use the XQuery method.
''' <Summary>
''' Get the language value of the corresponding ID from the XML file
''' </Summary>
''' <Param name = "textid"> input id </param>
''' <Returns> </returns>
''' <Remarks> </remarks>
Private shared function getcancagetextfromxml (byval textid as string) as langtext
Dim _ return as langtext = nothing
Try
If not isnothing (_ xmldoc) then
Dim nodelist as xmlnodelist
Nodelist = _ xmldoc. selectnodes ("// item [@ text_id = '" & textid. tolower & "']")
Dim node as xmlnode
Dim _ languageid as string '= IIF (Language = elanguage. English, "eng", "CHN ")
For each node in nodelist
_ Languageid = node. attributes ("language"). value. toupper
Select case _ languageid
Case "eng"
_ Return. Eng = node. innerxml
Case "CHN"
_ Return. CHN = node. innerxml
End select
Next
Else
_ Return = nothing
End if
Catch
_ Return = nothing
Finally
End try
Return _ return
End Function