I am trying to return a string, but somehow this function just wouldn't compile. I am a bit lost!
declare function local:findValue($vrf as xs:string?, $namefirst as element()*, $schoolfirst as element()*, $namesecond as element()*, $schoolsecond as element()*) as xs:string? {
return (
if (not(fn:empty($namefirst) or fn:empty($schoolfirst))) then (
if ($vrf) then (
"SCHOOL"
) else (
"HIGHSCHOOL"
)
) else if (not(fn:empty($namesecond) or fn:empty($schoolsecond))) then (
if ($vrf) then (
"SCHOOL"
) else (
"HIGSCHOOL"
)
) else ()
)
};
The compile just wouldn't go through. It throws the exception mentioned in the title, any quick help would be great!