Hi Eliot, Forget what I said: there is actually a function for this :-)
array:reverse($array). http://www.w3.org/TR/xpath-functions-31/#func-array-reverse But the approach in the other query works for any other function. Kind regards, Ghislain On Fri, Jul 17, 2015 at 3:31 PM, Ghislain Fourny <[email protected]> wrote: > Hi Eliot, > > I'd just go to the sequence space and back: > > array { reverse(array:flatten($array)) } > > Kind regards, > Ghislain > > > On Fri, Jul 17, 2015 at 3:26 PM, Eliot Kimber <[email protected]> wrote: >> I'm still getting my head around dynamic functions and arrays in XQuery >> 3.1. >> >> My question for today: easiest/best/most-efficient/cleverest way to >> reverse an array. >> >> You can't just use reverse() on an array, so how to produce a new array >> that is the reverse of the input array? >> >> Thanks, >> >> Eliot >> >> ---- >> Eliot Kimber, Owner >> Contrext, LLC >> http://contrext.com >> >> >> >> _______________________________________________ >> [email protected] >> http://x-query.com/mailman/listinfo/talk _______________________________________________ [email protected] http://x-query.com/mailman/listinfo/talk
