this is my actual dispatcher code.
So this means you are invoking the function, and it will always be updating?
To invoke updating functions, you need the 'updating' keyword:
let $f := function() { db:output('1') } return updating $f()
Hope this helps, Christian
declare %rest:path("/DB") %rest:POST("{$specifications}") %input:json("format=xquery")
%output:method("adaptive") %output:indent("no") %updating function _:dispatch ( $specifications as array(*) ) { _:response( update:apply( function( $requester as xs:string , $objectType as xs:string , $transaction as xs:string , $specifications as array(*) ) { inspect:functions()[ namespace-uri-from-QName( function-name(.)) = $objectType and local-name-from-QName( function-name(.)) = $transaction ]( $specifications) } , $specifications ) ) } ;
I want a flexible client-server configuration for prototyping. Performance is not an issue here. This is what I ended up with. Pretty creative. isn't it?
So no loop, but a filter.
Hope this gives you any insight in my madness ;-)
Rob