View Single Post
  #1 (permalink)  
Old January 5th, 2010, 07:09 PM
geek.shrek geek.shrek is offline
Authorized User
 
Join Date: Nov 2007
Location: , , .
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
Question XPath multiple conditional statement

Hi,

I'm using xpath 2.0 and trying to use a conditional statement. But it seems like the conditional only gone through
[CODE]
if conditionA then result
else if conditionB then result
else result
[CODE]

I would like to achieve something like
[CODE]
if conditionA then result
else if conditionB then result
else if conditionC then result
else if conditionD then result
else if conditionE then result
else result
[CODE]

Here is my code:
[CODE]

if ($start-time >= xs:time('01:00:00') and $start-time <= xs:time('09:00:00')) then 'Morning'
else if ($start-time > xs:time('09:00:00') and $start-time <= xs:time('17:00:00')) then 'Afternoon'
else if ($start-time > xs:time('17:00:00') and $start-time <= xs:time('24:00:00')) then 'Night'
else if ($start-time > xs:time('00:00:00') and $start-time < xs:time('01:00:00')) then 'In between Night and Day'
else 'Continue or Undefined'

[CODE]

Can someone tell me what is wrong with my conditional statement.

Thanks,
Reply With Quote