Hi,
I have a query regarding the if-else statement in query.the code below 
describes the query:

let $entryid="1"
let $entry1:="1"
let $entry2:="2"

for $entry in doc("uri")//root/entry
where $entry/@id = $entryid
return
if (empty($entry))
then
 $entry1
else
$entry2

Now if there is a entry with entryid=1 then it gives $entry2=2 . whereas if no 
entry exists with entryid=1 then it gives "no results". Please suggest me some 
other way to check the if condition so that I can get the desired result.

Thanks,
Pragya
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to