« Return to Thread: Sequence of numbers -

Re: Sequence of numbers -

by Michael Sokolov-2 :: Rate this Message:

Reply to Author | View in Thread

This is really much easier than all that:

$min to $max

is what you want I think

-Mike

PencilEd wrote:

> I know this isn't really what xQuery is for, but it would be helpful if I
> could find a relatively easy way of doing this with xQuery.
>
> I need to create a sequence of integers.  I start with a min and max value -
> need to fill in the rest.
>
> example:
> declare function fill_in_the_blanks($min as xs:integer, $max as xs:integer)
> as xs:sequence {
>   ... do something to get
>   $full_sequence := xs:sequence($min, $min+1, $min+2, $min+3... $max)
>   return $full_sequence
> };
>
> I've spent an afternoon searching and playing with recursion and think I
> might be able to create something, but I'm hoping there's an easier way that
> I just haven't found.
>
> Thanks>
>  

------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

 « Return to Thread: Sequence of numbers -