XPATH Query String - Finding Duplicate Nodes

P

pg_11

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
 
P

pg_11

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
 
P

pg_11

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top