Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XPATH Query String - Finding Duplicate Nodes

Reply
Thread Tools

XPATH Query String - Finding Duplicate Nodes

 
 
pg_11@rediffmail.com
Guest
Posts: n/a
 
      12-25-2004
The xml looks like this
<users>
<user><username>User1</username></user>
<user><username>User2</username></user>
<user><username>User3</username></user>
<user><username>User4</username></user>
<user><username>User1</username></user>
<user><username>User2</username></user>
<user><username>User5</username></user>
</users>

I am trying for a xpath query that would tell me whether there are any
duplicate user\username node in the xml. I dont event want what are
they. I just need whether there are any duplicates.
Can any one help me please

 
Reply With Quote
 
 
 
 
pg_11@rediffmail.com
Guest
Posts: n/a
 
      12-25-2004
0 != count(/ns1:Users/ns1:User[ns1:UserName =
preceding-sibling::ns1:User/ns1:UserName])

This works. but this is case sensitive. If I have 'user1' and 'USER1',
this wont catch it.
Actually I need a case-insensitive search. I am using msxml parser. I

 
Reply With Quote
 
 
 
 
pg_11@rediffmail.com
Guest
Posts: n/a
 
      12-25-2004
0 != count(/ns1:Users/ns1:User[ns1:UserName =
preceding-sibling::ns1:User/ns1:UserName])

This works. but this is case sensitive. If I have 'user1' and 'USER1',
this wont catch it.
Actually I need a case-insensitive search. I am using msxml parser. I

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XPath query help with getting parent nodes mike@pmbtech.com XML 3 01-05-2007 03:32 PM
Text nodes and element nodes query asd Java 3 05-23-2005 10:01 AM
finding nodes that don't match other nodes mlybarger@gmail.com XML 2 01-27-2005 07:26 PM
XPATH Query String - Finding Duplicate Nodes pg_11@rediffmail.com XML 0 12-25-2004 04:38 PM
Problem selecting a node with XPATH if attribute value contains backslashes - how to force XPATH string to be treated as literal? Alastair Cameron XML 1 07-08-2003 07:24 PM



Advertisments