subsequence function
The fn:subsequence function returns a subsequence of a sequence.
Syntax
- source-sequence
- The sequence from which the subsequence is retrieved.
source-sequence is any sequence, including the empty sequence.
- start
- The starting position in source-sequence of the subsequence.
The first position of source-sequence is 1. If start<=0, start is
set to 1.
start has the xs:double data type.
- length
- The number of items in the subsequence. The default for length is
the number of items in source-sequence. If start+length-1
is greater than the length of source-sequence, length is
set to (length of source-sequence)-start+1.
length has the xs:double data type.
Returned value
If source-sequence is not the empty sequence, the returned value is a subsequence of source-sequence that starts at position start and contains length items.
If source-sequence is the empty sequence, the empty sequence is returned.
Example
The following function returns three
items from the sequence ('T','e','s','t',' ','s','e','q','u','e','n','c','e'),
starting at the sixth item.
fn:subsequence(('T','e','s','t',' ','s','e','q','u','e','n','c','e'),6,3)The returned value is ('s','e','q').
