[xquery-talk] How to Reverse an Array

Ghislain Fourny g at 28.io
Fri Jul 17 06:31:37 PDT 2015


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 <ekimber at contrext.com> 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
>
>
>
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk


More information about the talk mailing list