Loading TOC...

MarkLogic 10 Product Documentation
fn functions (Sequence)

These built-in functions are XQuery functions defined to operate on sequences. They are defined in XQuery 1.0 and XPath 2.0 Functions and Operators.

27 functions
Function name Description
fn:avg Returns the average of the values in the input sequence $arg, that is, the sum of the values divided by the number of values.
fn:boolean Computes the effective boolean value of the sequence $arg.
fn:collection Returns all of the documents that belong to the specified collection(s).
fn:count Returns the number of items in the value of $arg.
fn:deep-equal This function assesses whether two sequences are deep-equal to each other.
fn:distinct-nodes [0.9-ml only] Returns the sequence resulting from removing from the input sequence all but one of a set of nodes that have the same identity as one another.
fn:distinct-values Returns the sequence that results from removing from $arg all but one of a set of values that are eq to one other.
fn:doc Returns the document(s) stored in the database at the specified URI(s).
fn:doc-available If fn:doc($uri) returns a document node, this function returns true.
fn:empty If the value of $arg is the empty sequence, the function returns true; otherwise, the function returns false.
fn:exactly-one Returns $arg if it contains exactly one item.
fn:exists If the value of $arg is not the empty sequence, the function returns true; otherwise, the function returns false.
fn:head Returns the first item in a sequence.
fn:id Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg.
fn:idref Returns the sequence of element or attribute nodes that have an IDREF value matching the value of one or more of the ID values supplied in $arg.
fn:index-of Returns a sequence of positive integers giving the positions within the sequence $seqParam of items that are equal to $srchParam.
fn:insert-before Returns a new sequence constructed from the value of $target with the value of $inserts inserted at the position specified by the value of $position.
fn:max Selects an item from the input sequence $arg whose value is greater than or equal to the value of every other item in the input sequence.
fn:min Selects an item from the input sequence $arg whose value is less than or equal to the value of every other item in the input sequence.
fn:one-or-more Returns $arg if it contains one or more items.
fn:remove Returns a new sequence constructed from the value of $target with the item at the position specified by the value of $position removed.
fn:reverse Reverses the order of items in a sequence.
fn:subsequence Returns the contiguous sequence of items in the value of $sourceSeq beginning at the position indicated by the value of $startingLoc and continuing for the number of items indicated by the value of $length.
fn:sum Returns a value obtained by adding together the values in $arg.
fn:tail Returns all but the first item in a sequence.
fn:unordered Returns the items of $sourceSeq in an implementation dependent order.
fn:zero-or-one Returns $arg if it contains zero or one items.