Hi!

//profile[username='Jeff' and pwd='JeffsPwd']

should work

Krzysztof Kowalczykiewicz



----- Original Message -----
From: "�yvind Vestavik" <[EMAIL PROTECTED]>
To: <[email protected]>
Cc: "Marius Mikalsen" <[EMAIL PROTECTED]>
Sent: Monday, February 18, 2002 12:29 PM
Subject: newbie xpath question




Could someone give me a tip as to how to iclude AND OR and NOT
in a xpath querystring testing on different elements in a document?
Or maybe pass on a reference to where to look for info??

My actual problem is:

I have a sample xml doc in my Xindice.

<profile>
  <username>Jeff</username>
  <pwd>JeffsPwd</pwd>
  ......
</profile>

I want to check login for registered user. If the user enters a valid
combination of�username and password (eg there exists a profile for the
given combination of username and pwd) the users will be logged in.

To look for profiles matches I try to use something like

   String xpath ="//profile/username[text='Jeff']";

which finds documents where the username if 'Jeff', but how do I find
documents where the username is 'Jeff' AND the pwd is 'JeffsPwd"????

I have tried with

   String
xpath="//profile/username[text='Jeff']&&//profile/pwd[text='JeffsPwd]=";

but this doesn't return the test document


Any hints would be appreciated.

�yvind





Reply via email to