Solved

Xpath search for username?

Posted on 2011-09-27
2
229 Views
Last Modified: 2012-05-12
Given the XML file shown below, is there a way that I can write an xpath query that will search if a particular username exists?  Say 'jglazer"?   Should be case insensitive.

Thanks!
<Users>
  <User>
    <UserName>jglazer</UserName>
      </User>
  <User>
    <UserName>hiram</UserName>
      </User>
</Users>

Open in new window

0
Comment
Question by:jglazer63
2 Comments
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 500 total points
ID: 36714407
//Users/User/UserName[text()="your text here"]

case insensitive is a bit tricky and the following link explains that
http://www.exampledepot.com/egs/org.w3c.dom/xpath_GetElemByText.html
0
 

Author Closing Comment

by:jglazer63
ID: 37083646
worked
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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…

821 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