Hello Michael,

This Xquery:

declare namespace fi = "my_namespace";

(: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 : function fi:get()
 :
 : return
 :
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :)
declare function fi:get($Ec, $Body, $Num)
{

                if ($Body//@channel = "1") then
                (
                        $as[1]
                )
                else if ($Body//@channel = "2") then
                (
                        if ($as[2]) then ($as[2])
                        else (
                        )
                )
                else if ($Body//@channel = "3") then
                (
                        if ($as[3]) then ($as[3])
                        else (
                        )
                )
                else ( $as )
};

(: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 : function fi:check()
 :
 : return
 :
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :)
declare function fi:check($a, $Body, $ListStr, $Ecu, $Num)
{
        let $List := fi:get($Ec, $Body, $Num)
Line 40>>return<<
                if (exists($List)) then (
                        for $Na in $List
                        return $Na
                ) else (
                )
};

(: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 : main loop
 :
 :
 :
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :)
<a>
</a>

Generate an error with saxon7-8 :

<<<
java net.sf.saxon.Query bugFuncDecl.xq

Syntax error at line 40:
Function get has not been declared
Query processing failed
>>>

Though it did not with saxon7-7. I'm really puzzled, and any help is welcome :)

Many thanks,

-- Marco [billemaz@cadence.com]
   Cadence Design Systems
   R&D Paris
   voice +331 3488 5330