Solved

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

Posted on 2006-10-20
3
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

623 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