Christian,
Looks promising. Will dive into this in the weekend.
Many thanks,
Rob -----Oorspronkelijk bericht----- Van: Christian GrĂ¼n [mailto:christian.gruen@gmail.com] Verzonden: woensdag 21 februari 2018 14:25 Aan: Rob Stapper CC: BaseX Onderwerp: Re: [basex-talk] inspect:functions does not return updating functions
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