Hi Andreas,
Sorry, I overlooked that you had already specified the $category variable in your path annotation.
As I see in the XQM modules in the BaseX DBA application, it seems, that neither the '%rest:query-param' is needed
Exactly; it’s only needed if you want to pass on query parameters. The query parameter string starts with the optional question mark in an URL; see e.g.:
https://duckduckgo.com?q=BaseX
If you want to process query parameters, please take care that each annotation variable appears as separate parameter in your declared function. You might want to try the following version:
declare %rest:path("/list/{$category}") %rest:query-param("page:category", "{$page-category}") %output:method("html") function page:list( $page:category as xs:string, $page-category as xs:string? ) { (: etc :) };
Best, Christian
On Fri, Apr 27, 2018 at 11:07 PM, Andreas Mixich mixich.andreas@gmail.com wrote:
Hello Christian,
you wrote:
This should work:
function page:list($category as xs:string?) { };
Thanks, if I remove the 'rest:query-parameter()' annotation it works.
-- Goody Bye, Minden jót, Mit freundlichen Grüßen, Andreas Mixich