qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qexo-general] function return value


From: Jun Yu
Subject: [Qexo-general] function return value
Date: Sun, 7 Mar 2004 19:08:10 +0100 (MET)

Hello everybody,
I met a problem about Function which can return value. here is my XML
document "session.xml".
   <login>
     <username>administrator</username>
     <password>12345</password>
   </login>

My XQuery program "test.xql" is like this:

define function authenticate($username,$password) as boolean {
let $s:=document("session.xml")/login
return
  if ($s/username=$username and $s/password=$password) then
     true
  else
     false
}

<html>
<body>
{
let $login_user:=request-parameter("username"),
    $login_password:=request-parameter("password")
return
    if (authenticate($login_user,$login_password)=true) then (...)
    else ()
}
</body></html>

Why I always get such result:
test.xql:6:3: node test when focus is undefined
test.xql:8:1: node test when focus is undefined

This is just a small problem. I do not know what is its problem. Thanks
for your idea.

Regards,
Jun Yu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]