Reputation: 530
I am trying to understand the usage of
cts:element-values($element-names as xs:QName*,[$start as xs:anyAtomicType?])
I was under the impression that the above function returns values from the specified element value lexicon, starting with $start. On Querying:
cts:element-values(xs:QName("ts:title"), "He")
I was expecting results starting with "He" only, but I have also got results such as:
(as I scroll down) I Feel Fine
I Get Around
I would like to know what exactly does $start specify ?
Upvotes: 0
Views: 108
Reputation: 7132
Think of $start
not as a starting prefix but as a starting location in the list. You're getting all the values from that point onward.
To limit by prefix you want to use cts:element-value-match
which accepts a $pattern
. http://docs.marklogic.com/cts:element-value-match
Upvotes: 4
Reputation: 20414
cts:element-values
and the like return values greater or equal to $start
value. It really is just a start place for all values, until limit is depleted.
If you are looking for a function that returns values matching a particular pattern, you probably want to use cts:element-value-match
instead:
cts:element-value-match(xs:QName("title"), "He*")
HTH!
Upvotes: 1