|
From: Harris, B. T. (GSFC-5870) <ber...@na...> - 2023-03-16 10:44:24
|
Is it possible to pass a string value to %test:args() (or %test:arg()) that contains a comma? For example,
declare
%test:args("0.0.0.1, 0.0.0.2")
%test:assertEquals("0.0.0.1")
function spasexq:getHttpClient(
$fwdForHdr as xs:string*)
as xs:string
{
let $hops := if (count($fwdForHdr) > 0)
then tokenize($fwdForHdr[1], ", ")
else ()
return
if ($hops)
then
$hops[1]
else
"unknown"
};
The test case fails with
<testcase name="getHttpClient" class="spasexq:getHttpClient">
<error type="err:FORG0006" message="Invalid argument type. effectiveBooleanValue: first item of '(0.0.0.1, 0.0.0.2)' is not a node, and sequence length > 1"/>
</testcase>
Is there an escape mechanism to prevent the interpretation of the comma character? All my attempts have failed. Thanks.
Bernie Harris
|