An error occurred – err:XPTY0004
Full error details:
It is a type error if, during the static analysis phase, an expression is found to have a static type that is not appropriate for the context in which the expression occurs, or during the dynamic evaluation phase, the dynamic type of a value does not match a required type as specified by the matching rules in 2.5.4 SequenceType Matching. checking function parameter 1 in call map:merge((
$mergedConfig, vapi:load-context-data($mergedConfig, $frontmatter), map {"doc" : map {"content" : $data, "fragment" : page:fragment(map {"request" : $request}, $data, untyped-value-check[xs:string, $config?view], untyped-value-check[xs:string, $path], untyped-value-check[xs:string, ])?data, "path" : $path, "odd" : {http://www.w3.org/2005/xpath-functions}replace(untyped-value-check[xs:string, $config?odd], "^(.*)\.odd", "$1"), "view" : $config?view, "type" : $config?type, "transform" : page:transform(?, ?, $config?odd), "transform-with" : page:transform#3}, "template" : $templateName, "media" : if (
map:contains($config, "media")
) then
$config?media
else
}
)): XPTY0004: The actual cardinality for parameter 2 does not match the cardinality declared in the function's signature: nav:get-section-for-node($config as map(*), $node as element()) as item()*. Expected cardinality: exactly one, got 0.