Solved

Xpath search for username?

Posted on 2011-09-27
2
224 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

762 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now