Solved

Xpath search for username?

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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