The current sorting mechanism rise an error when there is no key 'sorting' in the request.
for $content in $contents
order by (: @see http://jaketrent.com/post/xquery-dynamic-order/ :)
if ($order = 'descending') then map:get($content, $sorting) else () ascending,
if ($order = 'descending') then () else map:get($content, $sorting) descending
as the dynamic sorting can be tricky, how to solve it ?
The current sorting mechanism rise an error when there is no key 'sorting' in the request.
as the dynamic sorting can be tricky, how to solve it ?
see http://en.wikibooks.org/wiki/XQuery/Searching,Paging_and_Sorting