XPATH Query String - Finding Duplicate Nodes

Discussion in 'XML' started by pg_11@rediffmail.com, Dec 25, 2004.

  1. Guest

    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
    , Dec 25, 2004
    #1
    1. Advertising

  2. Guest

    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
    , Dec 25, 2004
    #2
    1. Advertising

  3. Guest

    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
    , Dec 25, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asd
    Replies:
    3
    Views:
    435
    Arnaud Berger
    May 23, 2005
  2. Replies:
    0
    Views:
    507
  3. Replies:
    2
    Views:
    390
  4. David Gordon

    xpath query query

    David Gordon, May 18, 2005, in forum: XML
    Replies:
    2
    Views:
    786
    David Gordon
    May 18, 2005
  5. Replies:
    3
    Views:
    736
Loading...

Share This Page