Link to home
Start Free TrialLog in
Avatar of brokeMyLegBiking
brokeMyLegBiking

asked on

xpath query that will search for a node with a certain value.

I need to search my xmlDocument for a <loginAction> node such that the value of <username> is equal to a certain value, and <action_name> is equal to a certain value. Here is the routine I need to complete:

    Public Shared Function can_do(ByVal action_name As String) As Boolean
        If xSecurity.DocumentElement.SelectSingleNode("need an xpath statement here") IsNot Nothing Then
            Return True
        Else
            Return False
        End If
    End Function


Here is the xmlDocument:

<SecurityDataset>
  <loginAction>
    <username>mylogin</username>
    <action_name>not-run_funding_reports</action_name>
  </loginAction>
</SecurityDataset>

ASKER CERTIFIED SOLUTION
Avatar of Mohamed Zedan
Mohamed Zedan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
any qustions just ask :)
Avatar of brokeMyLegBiking
brokeMyLegBiking

ASKER

ok, interesting, didn't know you could use an and statement in xpath, cool.