Solved

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

Posted on 2006-10-20
3
171 Views
Last Modified: 2010-04-23
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>

0
Comment
Question by:brokeMyLegBiking
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
Mohamed Zedan earned 500 total points
ID: 17780450
this xpath should work for you :
"/SecurityDataset/loginAction[username='mylogin' and action_name='not-run_funding_reports']"
0
 
LVL 7

Expert Comment

by:Mohamed Zedan
ID: 17780453
any qustions just ask :)
0
 
LVL 4

Author Comment

by:brokeMyLegBiking
ID: 17780657
ok, interesting, didn't know you could use an and statement in xpath, cool.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question