Your query has a syntax error. return
is only valid following a for
, let
, where
or order by
clause. Remove the word return
.
Secondly, {
and }
are only valid inside node content, and so should be removed.
Finally functions and variables cannot be declared in the XQuery functions namespace, so these functions and variables will have to be declared in another namespace.
Surely the compiler errors should have told you all this?
declare namespace test = "http://www.example.org/test";
declare function test:con($s1 as xs:anyAtomicType, $s2 as xs:anyAtomicType) as xs:string
{
concat($s1, $s2)
};
declare variable $test:str1 as xs:string:="samah";
declare variable $test:str2 as xs:string:="sama";
declare variable $test:comstring:=test:con($test:str1 ,$test:str2 );
$test:comstring