Hi Rob,
So, my request is to extend the map-key to allow multiple key-values and XML-elements.
General XQuery feature requests should probably go to the W3 Bugzilla tracker [1], as our intention is to stick as closely as possible to the official spec. I remember that the new issues this would bring along have been discussed before, so you may get more helpful feedback on that specific request by writing to the talk@x-query.com mailing list [2].
Hope this helps, Christian
[1] https://www.w3.org/Bugs/Public/ [2] http://x-query.com/mailman/listinfo/talk
Well, now we’re on it; why not allow closures as key-values. In that case we’ve our solution for the previous multiple key value request.
How do you feel about this?
Oh, now we’re on the map-module; an update-function would be great. While processing XML-data one needs to update its lookup-tables often.
I use the code below in a module. Maybe it’s a candidate for an embedded map-module function.
declare function XQR.map:update
( $map as map(*) , $key as xs:anyAtomicType , $init.data as item() , $updateFunction as function(*) ) { map:put( $map , $key , $updateFunction( let $go := function( $entry.data ) { if ( exists( $entry.data)) then $entry.data else $init.data } return $go( map:get( $map, $key)) ) ) } ;
Kind regards,
Rob Stapper
Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware. www.avast.com