| Author |
or condition in (Element)XPathAPI.selectSingleNode,
|
Vallaru smitha
Ranch Hand
Joined: Aug 19, 2008
Posts: 87
|
|
Hi
i am extracting keywods from jsp using
node2=(Element)XPathAPI.selectSingleNode(rawDoc, "//meta[@name=\"keywords\"]");
but i want to check for keywords with "K" and "k". if else condition does not work as the first contidition fails sit goes to catch block.
Can any one please suggest if there is any way we could check
Thanks
smitha.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16487
|
|
Yes, absolutely, just like you suggest, an "or" condition would do the trick. Was your question how to express "or" in XPath? Because you express "or" as "or" in XPath.
Or was your question something else?
|
 |
Vallaru smitha
Ranch Hand
Joined: Aug 19, 2008
Posts: 87
|
|
Thanks Paul, I was trying with piping operator "||".
node2=(Element)XPathAPI.selectSingleNode(rawDoc, "//meta[@name=\"keywords\"]" or "//meta[@name=\"Keywords\"]");
I tried the above line but it failed.
Any suggestions....
|
 |
Santhosh Kalisamy
Ranch Hand
Joined: Apr 15, 2008
Posts: 55
|
|
This will do it.
|
 |
 |
|
|
subject: or condition in (Element)XPathAPI.selectSingleNode,
|
|
|