Namespace: fn

planBuilder. fn

Builds expressions to call functions in the fn server library for a row pipeline.
Since:
  • 2.1.1

Methods


QName(paramURI, paramQName) → {XsQName}

Returns an xs:QName with the namespace URI given in paramURI. If paramURI is the zero-length string or the empty sequence, it represents "no namespace"; in this case, if the value of paramQName contains a colon (:), an error is raised [err:FOCA0002]. The prefix (or absence of a prefix) in paramQName is retained in the returned xs:QName value. The local name in the result is taken from the local part of paramQName. Provides a client interface to a server function. See fn.QName
Parameters:
Name Type Argument Description
paramURI XsString <optional>
A namespace URI, as a string.
paramQName XsString <optional>
A lexical qualified name (xs:QName), a string of the form "prefix:localname" or "localname".
Since:
  • 2.1.1
Returns:
Type
XsQName

abs(arg) → {XsNumeric}

Returns the absolute value of arg. If arg is negative returns -arg otherwise returns arg. If type of arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of arg. If the type of arg is a type derived from one of the numeric types, the result is an instance of the base numeric type. Provides a client interface to a server function. See fn.abs
Parameters:
Name Type Argument Description
arg XsNumeric <optional>
A numeric value.
Since:
  • 2.1.1
Returns:
Type
XsNumeric

adjustDateTimeToTimezone(arg, timezone) → {XsDateTime}

Adjusts an xs:dateTime value to a specific timezone, or to no timezone at all. If timezone is the empty sequence, returns an xs:dateTime without a timezone. Otherwise, returns an xs:dateTime with a timezone. Provides a client interface to a server function. See fn.adjustDateTimeToTimezone
Parameters:
Name Type Argument Description
arg XsDateTime <optional>
The dateTime to adjust to the new timezone.
timezone XsDayTimeDuration <optional>
The new timezone for the dateTime.
Since:
  • 2.1.1
Returns:
Type
XsDateTime

adjustDateToTimezone(arg, timezone) → {XsDate}

Adjusts an xs:date value to a specific timezone, or to no timezone at all. If timezone is the empty sequence, returns an xs:date without a timezone. Otherwise, returns an xs:date with a timezone. For purposes of timezone adjustment, an xs:date is treated as an xs:dateTime with time 00:00:00. Provides a client interface to a server function. See fn.adjustDateToTimezone
Parameters:
Name Type Argument Description
arg XsDate <optional>
The date to adjust to the new timezone.
timezone XsDayTimeDuration <optional>
The new timezone for the date.
Since:
  • 2.1.1
Returns:
Type
XsDate

adjustTimeToTimezone(arg, timezone) → {XsTime}

Adjusts an xs:time value to a specific timezone, or to no timezone at all. If timezone is the empty sequence, returns an xs:time without a timezone. Otherwise, returns an xs:time with a timezone. Provides a client interface to a server function. See fn.adjustTimeToTimezone
Parameters:
Name Type Argument Description
arg XsTime <optional>
The time to adjust to the new timezone.
timezone XsDayTimeDuration <optional>
The new timezone for the date.
Since:
  • 2.1.1
Returns:
Type
XsTime

analyzeString(in, regex, flags) → {ElementNode}

The result of the function is a new element node whose string value is the original string, but which contains markup to show which parts of the input match the regular expression. Provides a client interface to a server function. See fn.analyzeString
Parameters:
Name Type Argument Description
in XsString <optional>
The string to start with.
regex XsString <optional>
The regular expression pattern to match.
flags XsString <optional>
The flag representing how to interpret the regular expression. One of "s", "m", "i", or "x", as defined in http://www.w3.org/TR/xpath-functions/#flags.
Since:
  • 2.1.1
Returns:
Type
ElementNode

avg(arg) → {XsAnyAtomicType}

Returns the average of the values in the input sequence arg, that is, the sum of the values divided by the number of values. Provides a client interface to a server function. See fn.avg
Parameters:
Name Type Argument Description
arg XsAnyAtomicType <optional>
The sequence of values to average.
Since:
  • 2.1.1
Returns:
Type
XsAnyAtomicType

baseUri(arg) → {XsAnyURI}

Returns the value of the base-uri property for the specified node. If the node is part of a document and does not have a base-uri attribute explicitly set, fn:base-uri typically returns the URI of the document in which the node resides. Provides a client interface to a server function. See fn.baseUri
Parameters:
Name Type Argument Description
arg Node <optional>
The node whose base-uri is to be returned.
Since:
  • 2.1.1
Returns:
Type
XsAnyURI

boolean(arg) → {XsBoolean}

Computes the effective boolean value of the sequence arg. See Section 2.4.3 Effective Boolean Value[XP]. Provides a client interface to a server function. See fn.boolean
Parameters:
Name Type Argument Description
arg Item <optional>
A sequence of items.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

ceiling(arg) → {XsNumeric}

Returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of arg. If type of arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of arg. If the type of arg is a type derived from one of the numeric types, the result is an instance of the base numeric type. Provides a client interface to a server function. See fn.ceiling
Parameters:
Name Type Argument Description
arg XsNumeric <optional>
A numeric value.
Since:
  • 2.1.1
Returns:
Type
XsNumeric

codepointEqual(comparand1, comparand2) → {XsBoolean}

Returns true if the specified parameters are the same Unicode code point, otherwise returns false. The codepoints are compared according to the Unicode code point collation (http://www.w3.org/2005/xpath-functions/collation/codepoint). Provides a client interface to a server function. See fn.codepointEqual
Parameters:
Name Type Argument Description
comparand1 XsString <optional>
A string to be compared.
comparand2 XsString <optional>
A string to be compared.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

codepointsToString(arg) → {XsString}

Creates an xs:string from a sequence of Unicode code points. Returns the zero-length string if arg is the empty sequence. If any of the code points in arg is not a legal XML character, an error is raised. Provides a client interface to a server function. See fn.codepointsToString
Parameters:
Name Type Argument Description
arg XsInteger <optional>
A sequence of Unicode code points.
Since:
  • 2.1.1
Returns:
Type
XsString

compare(comparand1, comparand2, collation) → {XsInteger}

Returns -1, 0, or 1, depending on whether the value of the comparand1 is respectively less than, equal to, or greater than the value of comparand2, according to the rules of the collation that is used. Provides a client interface to a server function. See fn.compare
Parameters:
Name Type Argument Description
comparand1 XsString <optional>
A string to be compared.
comparand2 XsString <optional>
A string to be compared.
collation XsString <optional>
The optional name of a valid collation URI. For information on the collation URI syntax, see the Search Developer's Guide.
Since:
  • 2.1.1
Returns:
Type
XsInteger

concat(parameter1) → {XsString}

Returns the xs:string that is the concatenation of the values of the specified parameters. Accepts two or more xs:anyAtomicType arguments and casts them to xs:string. If any of the parameters is the empty sequence, the parameter is treated as the zero-length string. Provides a client interface to a server function. See fn.concat
Parameters:
Name Type Argument Description
parameter1 XsAnyAtomicType <optional>
A value.
Since:
  • 2.1.1
Returns:
Type
XsString

contains(parameter1, parameter2, collation) → {XsBoolean}

Returns true if the first parameter contains the string from the second parameter, otherwise returns false. Provides a client interface to a server function. See fn.contains
Parameters:
Name Type Argument Description
parameter1 XsString <optional>
The string from which to test.
parameter2 XsString <optional>
The string to test for existence in the first parameter.
collation XsString <optional>
The optional name of a valid collation URI. For information on the collation URI syntax, see the Search Developer's Guide.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

count(arg, maximum) → {XsInteger}

Returns the number of items in the value of arg. Provides a client interface to a server function. See fn.count
Parameters:
Name Type Argument Description
arg Item <optional>
The sequence of items to count.
maximum XsDouble <optional>
The maximum value of the count to return. MarkLogic Server will stop count when the $maximum value is reached and return the $maximum value. This is an extension to the W3C standard fn:count function.
Since:
  • 2.1.1
Returns:
Type
XsInteger

currentDate() → {XsDate}

Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is *stable*. The precise instant during the query or transformation represented by the value of fn:current-date() is *implementation dependent*. Provides a client interface to a server function. See fn.currentDate
Since:
  • 2.1.1
Returns:
Type
XsDate

currentDateTime() → {XsDateTime}

Returns the current dateTime value (with timezone) from the dynamic context. (See Section C.2 Dynamic Context Components[XP].) This is an xs:dateTime that is current at some time during the evaluation of a query or transformation in which fn:current-dateTime() is executed. This function is *stable*. The precise instant during the query or transformation represented by the value of fn:current-dateTime() is *implementation dependent*. Provides a client interface to a server function. See fn.currentDateTime
Since:
  • 2.1.1
Returns:
Type
XsDateTime

currentTime() → {XsTime}

Returns xs:time(fn:current-dateTime()). This is an xs:time (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-time() is executed. This function is *stable*. The precise instant during the query or transformation represented by the value of fn:current-time() is *implementation dependent*. Provides a client interface to a server function. See fn.currentTime
Since:
  • 2.1.1
Returns:
Type
XsTime

dateTime(arg1, arg2) → {XsDateTime}

Returns an xs:dateTime value created by combining an xs:date and an xs:time. Provides a client interface to a server function. See fn.dateTime
Parameters:
Name Type Argument Description
arg1 XsDate <optional>
The date to be combined with the time argument.
arg2 XsTime <optional>
The time to be combined with the date argument.
Since:
  • 2.1.1
Returns:
Type
XsDateTime

dayFromDate(arg) → {XsInteger}

Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of arg. Provides a client interface to a server function. See fn.dayFromDate
Parameters:
Name Type Argument Description
arg XsDate <optional>
The date whose day component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

dayFromDateTime(arg) → {XsInteger}

Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of arg. Provides a client interface to a server function. See fn.dayFromDateTime
Parameters:
Name Type Argument Description
arg XsDateTime <optional>
The dateTime whose day component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

daysFromDuration(arg) → {XsInteger}

Returns an xs:integer representing the days component in the canonical lexical representation of the value of arg. The result may be negative. Provides a client interface to a server function. See fn.daysFromDuration
Parameters:
Name Type Argument Description
arg XsDuration <optional>
The duration whose day component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

deepEqual(parameter1, parameter2, collation) → {XsBoolean}

This function assesses whether two sequences are deep-equal to each other. To be deep-equal, they must contain items that are pairwise deep-equal; and for two items to be deep-equal, they must either be atomic values that compare equal, or nodes of the same kind, with the same name, whose children are deep-equal. This is defined in more detail below. The collation argument identifies a collation which is used at all levels of recursion when strings are compared (but not when names are compared), according to the rules in 7.3.1 Collations. Provides a client interface to a server function. See fn.deepEqual
Parameters:
Name Type Argument Description
parameter1 Item <optional>
The first sequence of items, each item should be an atomic value or node.
parameter2 Item <optional>
The sequence of items to compare to the first sequence of items, again each item should be an atomic value or node.
collation XsString <optional>
The optional name of a valid collation URI. For information on the collation URI syntax, see the Search Developer's Guide.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

defaultCollation() → {XsString}

Returns the value of the default collation property from the static context. Components of the static context are discussed in Section C.1 Static Context Components[XP]. Provides a client interface to a server function. See fn.defaultCollation
Since:
  • 2.1.1
Returns:
Type
XsString

distinctValues(arg, collation) → {XsAnyAtomicType}

Returns the sequence that results from removing from arg all but one of a set of values that are eq to one other. Values that cannot be compared, i.e. the eq operator is not defined for their types, are considered to be distinct. Values of type xs:untypedAtomic are compared as if they were of type xs:string. The order in which the sequence of values is returned is implementation dependent. Provides a client interface to a server function. See fn.distinctValues
Parameters:
Name Type Argument Description
arg XsAnyAtomicType <optional>
A sequence of items.
collation XsString <optional>
The optional name of a valid collation URI. For information on the collation URI syntax, see the Search Developer's Guide.
Since:
  • 2.1.1
Returns:
Type
XsAnyAtomicType

documentUri(arg) → {XsAnyURI}

Returns the value of the document-uri property for the specified node. If the node is a document node, then the value returned is the URI of the document. If the node is not a document node, then fn:document-uri returns the empty sequence. Provides a client interface to a server function. See fn.documentUri
Parameters:
Name Type Argument Description
arg Node <optional>
The node whose document-uri is to be returned.
Since:
  • 2.1.1
Returns:
Type
XsAnyURI

empty(arg) → {XsBoolean}

If the value of arg is the empty sequence, the function returns true; otherwise, the function returns false. Provides a client interface to a server function. See fn.empty
Parameters:
Name Type Argument Description
arg Item <optional>
A sequence to test.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

encodeForUri(uriPart) → {XsString}

Invertible function that escapes characters required to be escaped inside path segments of URIs. Provides a client interface to a server function. See fn.encodeForUri
Parameters:
Name Type Argument Description
uriPart XsString <optional>
A string representing an unescaped URI.
Since:
  • 2.1.1
Returns:
Type
XsString

endsWith(parameter1, parameter2, collation) → {XsBoolean}

Returns true if the first parameter ends with the string from the second parameter, otherwise returns false. Provides a client interface to a server function. See fn.endsWith
Parameters:
Name Type Argument Description
parameter1 XsString <optional>
The parameter from which to test.
parameter2 XsString <optional>
The string to test whether it is at the end of the first parameter.
collation XsString <optional>
The optional name of a valid collation URI. For information on the collation URI syntax, see the Search Developer's Guide.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

escapeHtmlUri(uriPart) → {XsString}

%-escapes everything except printable ASCII characters. Provides a client interface to a server function. See fn.escapeHtmlUri
Parameters:
Name Type Argument Description
uriPart XsString <optional>
A string representing an unescaped URI.
Since:
  • 2.1.1
Returns:
Type
XsString

exists(arg) → {XsBoolean}

If the value of arg is not the empty sequence, the function returns true; otherwise, the function returns false. Provides a client interface to a server function. See fn.exists
Parameters:
Name Type Argument Description
arg Item <optional>
A sequence to test.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

false() → {XsBoolean}

Returns the xs:boolean value false. Equivalent to xs:boolean("0"). Provides a client interface to a server function. See fn.false
Since:
  • 2.1.1
Returns:
Type
XsBoolean

floor(arg) → {XsNumeric}

Returns the largest (closest to positive infinity) number with no fractional part that is not greater than the value of arg. If type of arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of arg. If the type of arg is a type derived from one of the numeric types, the result is an instance of the base numeric type. Provides a client interface to a server function. See fn.floor
Parameters:
Name Type Argument Description
arg XsNumeric <optional>
A numeric value.
Since:
  • 2.1.1
Returns:
Type
XsNumeric

formatDate(value, picture, language, calendar, country) → {XsString}

Returns a formatted date value based on the picture argument. This is an XSLT function, and it is available in XSLT, XQuery 1.0-ml, and Server-Side JavaScript. Provides a client interface to a server function. See fn.formatDate
Parameters:
Name Type Argument Description
value XsDate <optional>
The given date $value that needs to be formatted.
picture XsString <optional>
The desired string representation of the given date $value. The picture string is a sequence of characters, in which the characters represent variables such as, decimal-separator-sign, grouping-sign, zero-digit-sign, digit-sign, pattern-separator, percent sign and per-mille-sign. For details on the picture string, see http://www.w3.org/TR/xslt20/#date-picture-string.
language XsString <optional>
The desired language for string representation of the date $value.
calendar XsString <optional>
The only calendar supported at this point is "Gregorian" or "AD".
country XsString <optional>
$country is used the specification to take into account country specific string representation.
Since:
  • 2.1.1
Returns:
Type
XsString

formatDateTime(value, picture, language, calendar, country) → {XsString}

Returns a formatted dateTime value based on the picture argument. This is an XSLT function, and it is available in XSLT, XQuery 1.0-ml, and Server-Side JavaScript. Provides a client interface to a server function. See fn.formatDateTime
Parameters:
Name Type Argument Description
value XsDateTime <optional>
The given dateTime $value that needs to be formatted.
picture XsString <optional>
The desired string representation of the given dateTime $value. The picture string is a sequence of characters, in which the characters represent variables such as, decimal-separator-sign, grouping-sign, zero-digit-sign, digit-sign, pattern-separator, percent sign and per-mille-sign. For details on the picture string, see http://www.w3.org/TR/xslt20/#date-picture-string.
language XsString <optional>
The desired language for string representation of the dateTime $value.
calendar XsString <optional>
The only calendar supported at this point is "Gregorian" or "AD".
country XsString <optional>
$country is used the specification to take into account country specific string representation.
Since:
  • 2.1.1
Returns:
Type
XsString

formatNumber(value, picture, decimalFormatName) → {XsString}

Returns a formatted string representation of value argument based on the supplied picture. An optional decimal format name may also be supplied for interpretation of the picture string. This is an XSLT function, and it is available in XSLT, XQuery 1.0-ml, and Server-Side JavaScript. Provides a client interface to a server function. See fn.formatNumber
Parameters:
Name Type Argument Description
value XsNumeric <optional>
The given numeric $value that needs to be formatted.
picture XsString <optional>
The desired string representation of the given number $value. The picture string is a sequence of characters, in which the characters represent variables such as, decimal-separator-sign, grouping-sign, zero-digit-sign, digit-sign, pattern-separator, percent sign and per-mille-sign. For details on the format-number picture string, see http://www.w3.org/TR/xslt20/#function-format-number.
decimalFormatName XsString <optional>
Represents a named instruction. It is used to assign values to the variables mentioned above based on the picture string.
Since:
  • 2.1.1
Returns:
Type
XsString

formatTime(value, picture, language, calendar, country) → {XsString}

Returns a formatted time value based on the picture argument. This is an XSLT function, and it is available in XSLT, XQuery 1.0-ml, and Server-Side JavaScript. Provides a client interface to a server function. See fn.formatTime
Parameters:
Name Type Argument Description
value XsTime <optional>
The given time $value that needs to be formatted.
picture XsString <optional>
The desired string representation of the given time $value. The picture string is a sequence of characters, in which the characters represent variables such as, decimal-separator-sign, grouping-sign, zero-digit-sign, digit-sign, pattern-separator, percent sign and per-mille-sign. For details on the picture string, see http://www.w3.org/TR/xslt20/#date-picture-string.
language XsString <optional>
The desired language for string representation of the time $value.
calendar XsString <optional>
The only calendar supported at this point is "Gregorian" or "AD".
country XsString <optional>
$country is used the specification to take into account country specific string representation.
Since:
  • 2.1.1
Returns:
Type
XsString

generateId(node) → {XsString}

Returns a string that uniquely identifies a given node. Provides a client interface to a server function. See fn.generateId
Parameters:
Name Type Argument Description
node Node <optional>
The node whose ID will be generated.
Since:
  • 2.1.1
Returns:
Type
XsString

Returns the first item in a sequence. For more details, see XPath 3.0 Functions and Operators. Provides a client interface to a server function. See fn.head
Parameters:
Name Type Argument Description
seq Item <optional>
A sequence of items.
Since:
  • 2.1.1
Returns:
Type
Item

hoursFromDateTime(arg) → {XsInteger}

Returns an xs:integer between 0 and 23, both inclusive, representing the hours component in the localized value of arg. Provides a client interface to a server function. See fn.hoursFromDateTime
Parameters:
Name Type Argument Description
arg XsDateTime <optional>
The dateTime whose hours component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

hoursFromDuration(arg) → {XsInteger}

Returns an xs:integer representing the hours component in the canonical lexical representation of the value of arg. The result may be negative. Provides a client interface to a server function. See fn.hoursFromDuration
Parameters:
Name Type Argument Description
arg XsDuration <optional>
The duration whose hour component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

hoursFromTime(arg) → {XsInteger}

Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of arg. Provides a client interface to a server function. See fn.hoursFromTime
Parameters:
Name Type Argument Description
arg XsTime <optional>
The time whose hours component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

implicitTimezone() → {XsDayTimeDuration}

Returns the value of the implicit timezone property from the dynamic context. Components of the dynamic context are discussed in Section C.2 Dynamic Context Components[XP]. Provides a client interface to a server function. See fn.implicitTimezone
Since:
  • 2.1.1
Returns:
Type
XsDayTimeDuration

inScopePrefixes(element) → {XsString}

Returns the prefixes of the in-scope namespaces for element. For namespaces that have a prefix, it returns the prefix as an xs:NCName. For the default namespace, which has no prefix, it returns the zero-length string. Provides a client interface to a server function. See fn.inScopePrefixes
Parameters:
Name Type Argument Description
element ElementNode <optional>
The element whose in-scope prefixes will be returned.
Since:
  • 2.1.1
Returns:
Type
XsString

indexOf(seqParam, srchParam, collationLiteral) → {XsInteger}

Returns a sequence of positive integers giving the positions within the sequence seqParam of items that are equal to srchParam. Provides a client interface to a server function. See fn.indexOf
Parameters:
Name Type Argument Description
seqParam XsAnyAtomicType <optional>
A sequence of values.
srchParam XsAnyAtomicType <optional>
A value to find on the list.
collationLiteral XsString <optional>
A collation identifier.
Since:
  • 2.1.1
Returns:
Type
XsInteger

insertBefore(target, position, inserts) → {Item}

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. (The value of target is not affected by the sequence construction.) Provides a client interface to a server function. See fn.insertBefore
Parameters:
Name Type Argument Description
target Item <optional>
The sequence of items into which new items will be inserted.
position XsInteger <optional>
The position in the target sequence at which the new items will be added.
inserts Item <optional>
The items to insert into the target sequence.
Since:
  • 2.1.1
Returns:
Type
Item

iriToUri(uriPart) → {XsString}

Idempotent function that escapes non-URI characters. Provides a client interface to a server function. See fn.iriToUri
Parameters:
Name Type Argument Description
uriPart XsString <optional>
A string representing an unescaped URI.
Since:
  • 2.1.1
Returns:
Type
XsString

lang(testlang, node) → {XsBoolean}

This function tests whether the language of node, or the context node if the second argument is omitted, as specified by xml:lang attributes is the same as, or is a sublanguage of, the language specified by testlang. The language of the argument node, or the context node if the second argument is omitted, is determined by the value of the xml:lang attribute on the node, or, if the node has no such attribute, by the value of the xml:lang attribute on the nearest ancestor of the node that has an xml:lang attribute. If there is no such ancestor, then the function returns false Provides a client interface to a server function. See fn.lang
Parameters:
Name Type Argument Description
testlang XsString <optional>
The language against which to test the node.
node Node <optional>
The node to test.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

localName(arg) → {XsString}

Returns the local part of the name of arg as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName. Provides a client interface to a server function. See fn.localName
Parameters:
Name Type Argument Description
arg Node <optional>
The node whose local name is to be returned.
Since:
  • 2.1.1
Returns:
Type
XsString

localNameFromQName(arg) → {XsNCName}

Returns an xs:NCName representing the local part of arg. If arg is the empty sequence, returns the empty sequence. Provides a client interface to a server function. See fn.localNameFromQName
Parameters:
Name Type Argument Description
arg XsQName <optional>
A qualified name.
Since:
  • 2.1.1
Returns:
Type
XsNCName

lowerCase(string) → {XsString}

Returns the specified string converting all of the characters to lower-case characters. If a character does not have a corresponding lower-case character, then the original character is returned. The lower-case characters are determined using the Unicode Case Mappings. Provides a client interface to a server function. See fn.lowerCase
Parameters:
Name Type Argument Description
string XsString <optional>
The string to convert.
Since:
  • 2.1.1
Returns:
Type
XsString

matches(input, pattern, flags) → {XsBoolean}

Returns true if the specified input matches the specified pattern, otherwise returns false. Provides a client interface to a server function. See fn.matches
Parameters:
Name Type Argument Description
input XsString <optional>
The input from which to match.
pattern XsString <optional>
The regular expression to match.
flags XsString <optional>
The flag representing how to interpret the regular expression. One of "s", "m", "i", or "x", as defined in http://www.w3.org/TR/xpath-functions/#flags.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

max(arg, collation) → {XsAnyAtomicType}

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. If there are two or more such items, then the specific item whose value is returned is implementation dependent. Provides a client interface to a server function. See fn.max
Parameters:
Name Type Argument Description
arg XsAnyAtomicType <optional>
The sequence of values whose maximum will be returned.
collation XsString <optional>
The optional name of a valid collation URI. For information on the collation URI syntax, see the Search Developer's Guide.
Since:
  • 2.1.1
Returns:
Type
XsAnyAtomicType

min(arg, collation) → {XsAnyAtomicType}

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. If there are two or more such items, then the specific item whose value is returned is implementation dependent. Provides a client interface to a server function. See fn.min
Parameters:
Name Type Argument Description
arg XsAnyAtomicType <optional>
The sequence of values whose minimum will be returned.
collation XsString <optional>
The optional name of a valid collation URI. For information on the collation URI syntax, see the Search Developer's Guide.
Since:
  • 2.1.1
Returns:
Type
XsAnyAtomicType

minutesFromDateTime(arg) → {XsInteger}

Returns an xs:integer value between 0 and 59, both inclusive, representing the minute component in the localized value of arg. Provides a client interface to a server function. See fn.minutesFromDateTime
Parameters:
Name Type Argument Description
arg XsDateTime <optional>
The dateTime whose minutes component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

minutesFromDuration(arg) → {XsInteger}

Returns an xs:integer representing the minutes component in the canonical lexical representation of the value of arg. The result may be negative. Provides a client interface to a server function. See fn.minutesFromDuration
Parameters:
Name Type Argument Description
arg XsDuration <optional>
The duration whose minute component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

minutesFromTime(arg) → {XsInteger}

Returns an xs:integer value between 0 to 59, both inclusive, representing the value of the minutes component in the localized value of arg. Provides a client interface to a server function. See fn.minutesFromTime
Parameters:
Name Type Argument Description
arg XsTime <optional>
The time whose minutes component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

monthFromDate(arg) → {XsInteger}

Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of arg. Provides a client interface to a server function. See fn.monthFromDate
Parameters:
Name Type Argument Description
arg XsDate <optional>
The date whose month component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

monthFromDateTime(arg) → {XsInteger}

Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of arg. Provides a client interface to a server function. See fn.monthFromDateTime
Parameters:
Name Type Argument Description
arg XsDateTime <optional>
The dateTime whose month component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

monthsFromDuration(arg) → {XsInteger}

Returns an xs:integer representing the months component in the canonical lexical representation of the value of arg. The result may be negative. Provides a client interface to a server function. See fn.monthsFromDuration
Parameters:
Name Type Argument Description
arg XsDuration <optional>
The duration whose month component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

name(arg) → {XsString}

Returns the name of a node, as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName. Provides a client interface to a server function. See fn.name
Parameters:
Name Type Argument Description
arg Node <optional>
The node whose name is to be returned.
Since:
  • 2.1.1
Returns:
Type
XsString

namespaceUri(arg) → {XsAnyURI}

Returns the namespace URI of the xs:QName of the node specified by arg. Provides a client interface to a server function. See fn.namespaceUri
Parameters:
Name Type Argument Description
arg Node <optional>
The node whose namespace URI is to be returned.
Since:
  • 2.1.1
Returns:
Type
XsAnyURI

namespaceUriForPrefix(prefix, element) → {XsAnyURI}

Returns the namespace URI of one of the in-scope namespaces for element, identified by its namespace prefix. Provides a client interface to a server function. See fn.namespaceUriForPrefix
Parameters:
Name Type Argument Description
prefix XsString <optional>
A namespace prefix to look up.
element ElementNode <optional>
An element node providing namespace context.
Since:
  • 2.1.1
Returns:
Type
XsAnyURI

namespaceUriFromQName(arg) → {XsAnyURI}

Returns the namespace URI for arg as an xs:string. If arg is the empty sequence, the empty sequence is returned. If arg is in no namespace, the zero-length string is returned. Provides a client interface to a server function. See fn.namespaceUriFromQName
Parameters:
Name Type Argument Description
arg XsQName <optional>
A qualified name.
Since:
  • 2.1.1
Returns:
Type
XsAnyURI

nilled(arg) → {XsBoolean}

Summary: Returns an xs:boolean indicating whether the argument node is "nilled". If the argument is not an element node, returns the empty sequence. If the argument is the empty sequence, returns the empty sequence. For element nodes, true() is returned if the element is nilled, otherwise false(). Provides a client interface to a server function. See fn.nilled
Parameters:
Name Type Argument Description
arg Node <optional>
The node to test for nilled status.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

nodeName(arg) → {XsQName}

Returns an expanded-QName for node kinds that can have names. For other kinds of nodes it returns the empty sequence. If arg is the empty sequence, the empty sequence is returned. Provides a client interface to a server function. See fn.nodeName
Parameters:
Name Type Argument Description
arg Node <optional>
The node whose name is to be returned.
Since:
  • 2.1.1
Returns:
Type
XsQName

normalizeSpace(input) → {XsString}

Returns the specified string with normalized whitespace, which strips off any leading or trailing whitespace and replaces any other sequences of more than one whitespace characters with a single space character (#x20). Provides a client interface to a server function. See fn.normalizeSpace
Parameters:
Name Type Argument Description
input XsString <optional>
The string from which to normalize whitespace.
Since:
  • 2.1.1
Returns:
Type
XsString

normalizeUnicode(arg, normalizationForm) → {XsString}

Return the argument normalized according to the normalization criteria for a normalization form identified by the value of normalizationForm. The effective value of the normalizationForm is computed by removing leading and trailing blanks, if present, and converting to upper case. Provides a client interface to a server function. See fn.normalizeUnicode
Parameters:
Name Type Argument Description
arg XsString <optional>
The string to normalize.
normalizationForm XsString <optional>
The form under which to normalize the specified string: NFC, NFD, NFKC, or NFKD.
Since:
  • 2.1.1
Returns:
Type
XsString

not(arg) → {XsBoolean}

Returns true if the effective boolean value is false, and false if the effective boolean value is true. The arg parameter is first reduced to an effective boolean value by applying the fn:boolean function. Provides a client interface to a server function. See fn.not
Parameters:
Name Type Argument Description
arg Item <optional>
The expression to negate.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

number(arg) → {XsDouble}

Returns the value indicated by arg or, if arg is not specified, the context item after atomization, converted to an xs:double. If arg is the empty sequence or if arg or the context item cannot be converted to an xs:double, the xs:double value NaN is returned. If the context item is undefined an error is raised: [err:XPDY0002]. Provides a client interface to a server function. See fn.number
Parameters:
Name Type Argument Description
arg XsAnyAtomicType <optional>
The value to be returned as an xs:double value.
Since:
  • 2.1.1
Returns:
Type
XsDouble

prefixFromQName(arg) → {XsNCName}

Returns an xs:NCName representing the prefix of arg. The empty sequence is returned if arg is the empty sequence or if the value of arg contains no prefix. Provides a client interface to a server function. See fn.prefixFromQName
Parameters:
Name Type Argument Description
arg XsQName <optional>
A qualified name.
Since:
  • 2.1.1
Returns:
Type
XsNCName

remove(target, position) → {Item}

Returns a new sequence constructed from the value of target with the item at the position specified by the value of position removed. Provides a client interface to a server function. See fn.remove
Parameters:
Name Type Argument Description
target Item <optional>
The sequence of items from which items will be removed.
position XsInteger <optional>
The position in the target sequence from which the items will be removed.
Since:
  • 2.1.1
Returns:
Type
Item

replace(input, pattern, replacement, flags) → {XsString}

Returns a string constructed by replacing the specified pattern on the input string with the specified replacement string. Provides a client interface to a server function. See fn.replace
Parameters:
Name Type Argument Description
input XsString <optional>
The string to start with.
pattern XsString <optional>
The regular expression pattern to match. If the pattern does not match the $input string, the function will return the $input string unchanged.
replacement XsString <optional>
The regular expression pattern to replace the $pattern with. It can also be a capture expression (for more details, see http://www.w3.org/TR/xpath-functions/#func-replace).
flags XsString <optional>
The flag representing how to interpret the regular expression. One of "s", "m", "i", or "x", as defined in http://www.w3.org/TR/xpath-functions/#flags.
Since:
  • 2.1.1
Returns:
Type
XsString

resolveQName(qname, element) → {XsQName}

Returns an xs:QName value (that is, an expanded QName) by taking an xs:string that has the lexical form of an xs:QName (a string in the form "prefix:local-name" or "local-name") and resolving it using the in-scope namespaces for a given element. Provides a client interface to a server function. See fn.resolveQName
Parameters:
Name Type Argument Description
qname XsString <optional>
A string of the form "prefix:local-name".
element ElementNode <optional>
An element providing the in-scope namespaces to use to resolve the qualified name.
Since:
  • 2.1.1
Returns:
Type
XsQName

resolveUri(relative, base) → {XsAnyURI}

Resolves a relative URI against an absolute URI. If base is specified, the URI is resolved relative to that base. If base is not specified, the base is set to the base-uri property from the static context, if the property exists; if it does not exist, an error is thrown. Provides a client interface to a server function. See fn.resolveUri
Parameters:
Name Type Argument Description
relative XsString <optional>
A URI reference to resolve against the base.
base XsString <optional>
An absolute URI to use as the base of the resolution.
Since:
  • 2.1.1
Returns:
Type
XsAnyURI

reverse(target) → {Item}

Reverses the order of items in a sequence. If arg is the empty sequence, the empty sequence is returned. Provides a client interface to a server function. See fn.reverse
Parameters:
Name Type Argument Description
target Item <optional>
The sequence of items to be reversed.
Since:
  • 2.1.1
Returns:
Type
Item

root(arg) → {Node}

Returns the root of the tree to which arg belongs. This will usually, but not necessarily, be a document node. Provides a client interface to a server function. See fn.root
Parameters:
Name Type Argument Description
arg Node <optional>
The node whose root node will be returned.
Since:
  • 2.1.1
Returns:
Type
Node

round(arg) → {XsNumeric}

Returns the number with no fractional part that is closest to the argument. If there are two such numbers, then the one that is closest to positive infinity is returned. If type of arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of arg. If the type of arg is a type derived from one of the numeric types, the result is an instance of the base numeric type. Provides a client interface to a server function. See fn.round
Parameters:
Name Type Argument Description
arg XsNumeric <optional>
A numeric value to round.
Since:
  • 2.1.1
Returns:
Type
XsNumeric

roundHalfToEven(arg, precision) → {XsNumeric}

The value returned is the nearest (that is, numerically closest) numeric to arg that is a multiple of ten to the power of minus precision. If two such values are equally near (e.g. if the fractional part in arg is exactly .500...), returns the one whose least significant digit is even. If type of arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of arg. If the type of arg is a type derived from one of the numeric types, the result is an instance of the base numeric type. Provides a client interface to a server function. See fn.roundHalfToEven
Parameters:
Name Type Argument Description
arg XsNumeric <optional>
A numeric value to round.
precision XsInteger <optional>
The precision to which to round the value.
Since:
  • 2.1.1
Returns:
Type
XsNumeric

secondsFromDateTime(arg) → {XsDecimal}

Returns an xs:decimal value between 0 and 60.999..., both inclusive representing the seconds and fractional seconds in the localized value of arg. Note that the value can be greater than 60 seconds to accommodate occasional leap seconds used to keep human time synchronized with the rotation of the planet. Provides a client interface to a server function. See fn.secondsFromDateTime
Parameters:
Name Type Argument Description
arg XsDateTime <optional>
The dateTime whose seconds component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsDecimal

secondsFromDuration(arg) → {XsDecimal}

Returns an xs:decimal representing the seconds component in the canonical lexical representation of the value of arg. The result may be negative. Provides a client interface to a server function. See fn.secondsFromDuration
Parameters:
Name Type Argument Description
arg XsDuration <optional>
The duration whose minute component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsDecimal

secondsFromTime(arg) → {XsDecimal}

Returns an xs:decimal value between 0 and 60.999..., both inclusive, representing the seconds and fractional seconds in the localized value of arg. Note that the value can be greater than 60 seconds to accommodate occasional leap seconds used to keep human time synchronized with the rotation of the planet. Provides a client interface to a server function. See fn.secondsFromTime
Parameters:
Name Type Argument Description
arg XsTime <optional>
The time whose seconds component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsDecimal

startsWith(parameter1, parameter2, collation) → {XsBoolean}

Returns true if the first parameter starts with the string from the second parameter, otherwise returns false. Provides a client interface to a server function. See fn.startsWith
Parameters:
Name Type Argument Description
parameter1 XsString <optional>
The string from which to test.
parameter2 XsString <optional>
The string to test whether it is at the beginning of the first parameter.
collation XsString <optional>
The optional name of a valid collation URI. For information on the collation URI syntax, see the Search Developer's Guide.
Since:
  • 2.1.1
Returns:
Type
XsBoolean

string(arg) → {XsString}

Returns the value of arg represented as an xs:string. If no argument is supplied, this function returns the string value of the context item (.). Provides a client interface to a server function. See fn.string
Parameters:
Name Type Argument Description
arg Item <optional>
The item to be rendered as a string.
Since:
  • 2.1.1
Returns:
Type
XsString

stringJoin(parameter1, parameter2) → {XsString}

Returns an xs:string created by concatenating the members of the parameter1 sequence using parameter2 as a separator. If the value of arg2 is the zero-length string, then the members of parameter1 are concatenated without a separator. Provides a client interface to a server function. See fn.stringJoin
Parameters:
Name Type Argument Description
parameter1 XsString <optional>
A sequence of strings.
parameter2 XsString <optional>
A separator string to concatenate between the items in $parameter1.
Since:
  • 2.1.1
Returns:
Type
XsString

stringLength(sourceString) → {XsInteger}

Returns an integer representing the length of the specified string. The length is 1-based, so a string that is one character long returns a value of 1. Provides a client interface to a server function. See fn.stringLength
Parameters:
Name Type Argument Description
sourceString XsString <optional>
The string to calculate the length.
Since:
  • 2.1.1
Returns:
Type
XsInteger

stringToCodepoints(arg) → {XsInteger}

Returns the sequence of Unicode code points that constitute an xs:string. If arg is a zero-length string or the empty sequence, the empty sequence is returned. Provides a client interface to a server function. See fn.stringToCodepoints
Parameters:
Name Type Argument Description
arg XsString <optional>
A string.
Since:
  • 2.1.1
Returns:
Type
XsInteger

subsequence(sourceSeq, startingLoc, length) → {Item}

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. Provides a client interface to a server function. See fn.subsequence
Parameters:
Name Type Argument Description
sourceSeq Item <optional>
The sequence of items from which a subsequence will be selected.
startingLoc XsNumeric <optional>
The starting position of the start of the subsequence.
length XsNumeric <optional>
The length of the subsequence.
Since:
  • 2.1.1
Returns:
Type
Item

substring(sourceString, startingLoc, length) → {XsString}

Returns a substring starting from the startingLoc and continuing for length characters. Provides a client interface to a server function. See fn.substring
Parameters:
Name Type Argument Description
sourceString XsString <optional>
The string from which to create a substring.
startingLoc XsNumeric <optional>
The number of characters from the start of the $sourceString.
length XsNumeric <optional>
The number of characters beyond the $startingLoc.
Since:
  • 2.1.1
Returns:
Type
XsString

substringAfter(input, after, collation) → {XsString}

Returns the substring created by taking all of the input characters that occur after the specified after characters. Provides a client interface to a server function. See fn.substringAfter
Parameters:
Name Type Argument Description
input XsString <optional>
The string from which to create the substring.
after XsString <optional>
The string after which the substring is created.
collation XsString <optional>
The optional name of a valid collation URI. For information on the collation URI syntax, see the Search Developer's Guide.
Since:
  • 2.1.1
Returns:
Type
XsString

substringBefore(input, before, collation) → {XsString}

Returns the substring created by taking all of the input characters that occur before the specified before characters. Provides a client interface to a server function. See fn.substringBefore
Parameters:
Name Type Argument Description
input XsString <optional>
The string from which to create the substring.
before XsString <optional>
The string before which the substring is created.
collation XsString <optional>
The optional name of a valid collation URI. For information on the collation URI syntax, see the Search Developer's Guide.
Since:
  • 2.1.1
Returns:
Type
XsString

sum(arg, zero) → {XsAnyAtomicType}

Returns a value obtained by adding together the values in arg. If zero is not specified, then the value returned for an empty sequence is the xs:integer value 0. If zero is specified, then the value returned for an empty sequence is zero. Provides a client interface to a server function. See fn.sum
Parameters:
Name Type Argument Description
arg XsAnyAtomicType <optional>
The sequence of values to be summed.
zero XsAnyAtomicType <optional>
The value to return as zero if the input sequence is the empty sequence. This parameter is not available in the 0.9-ml XQuery dialect.
Since:
  • 2.1.1
Returns:
Type
XsAnyAtomicType

tail(seq) → {Item}

Returns all but the first item in a sequence. For more details, see XPath 3.0 Functions and Operators. Provides a client interface to a server function. See fn.tail
Parameters:
Name Type Argument Description
seq Item <optional>
The function value.
Since:
  • 2.1.1
Returns:
Type
Item

timezoneFromDate(arg) → {XsDayTimeDuration}

Returns the timezone component of arg if any. If arg has a timezone component, then the result is an xs:dayTimeDuration that indicates deviation from UTC; its value may range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty sequence. Provides a client interface to a server function. See fn.timezoneFromDate
Parameters:
Name Type Argument Description
arg XsDate <optional>
The date whose timezone component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsDayTimeDuration

timezoneFromDateTime(arg) → {XsDayTimeDuration}

Returns the timezone component of arg if any. If arg has a timezone component, then the result is an xs:dayTimeDuration that indicates deviation from UTC; its value may range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty sequence. Provides a client interface to a server function. See fn.timezoneFromDateTime
Parameters:
Name Type Argument Description
arg XsDateTime <optional>
The dateTime whose timezone component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsDayTimeDuration

timezoneFromTime(arg) → {XsDayTimeDuration}

Returns the timezone component of arg if any. If arg has a timezone component, then the result is an xs:dayTimeDuration that indicates deviation from UTC; its value may range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty sequence. Provides a client interface to a server function. See fn.timezoneFromTime
Parameters:
Name Type Argument Description
arg XsTime <optional>
The time whose timezone component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsDayTimeDuration

tokenize(input, pattern, flags) → {XsString}

Returns a sequence of strings constructed by breaking the specified input into substrings separated by the specified pattern. The specified pattern is not returned as part of the returned items. Provides a client interface to a server function. See fn.tokenize
Parameters:
Name Type Argument Description
input XsString <optional>
The string to tokenize.
pattern XsString <optional>
The regular expression pattern from which to separate the tokens.
flags XsString <optional>
The flag representing how to interpret the regular expression. One of "s", "m", "i", or "x", as defined in http://www.w3.org/TR/xpath-functions/#flags.
Since:
  • 2.1.1
Returns:
Type
XsString

translate(src, mapString, transString) → {XsString}

Returns a string where every character in src that occurs in some position in the mapString is translated into the transString character in the corresponding location of the mapString character. Provides a client interface to a server function. See fn.translate
Parameters:
Name Type Argument Description
src XsString <optional>
The string to translate characters.
mapString XsString <optional>
The string representing characters to be translated.
transString XsString <optional>
The string representing the characters to which the $mapString characters are translated.
Since:
  • 2.1.1
Returns:
Type
XsString

true() → {XsBoolean}

Returns the xs:boolean value true. Equivalent to xs:boolean("1"). Provides a client interface to a server function. See fn.true
Since:
  • 2.1.1
Returns:
Type
XsBoolean

unordered(sourceSeq) → {Item}

Returns the items of sourceSeq in an implementation dependent order. Provides a client interface to a server function. See fn.unordered
Parameters:
Name Type Argument Description
sourceSeq Item <optional>
The sequence of items.
Since:
  • 2.1.1
Returns:
Type
Item

upperCase(string) → {XsString}

Returns the specified string converting all of the characters to upper-case characters. If a character does not have a corresponding upper-case character, then the original character is returned. The upper-case characters are determined using the Unicode Case Mappings. Provides a client interface to a server function. See fn.upperCase
Parameters:
Name Type Argument Description
string XsString <optional>
The string to upper-case.
Since:
  • 2.1.1
Returns:
Type
XsString

yearFromDate(arg) → {XsInteger}

Returns an xs:integer representing the year component in the localized value of arg. The result may be negative. Provides a client interface to a server function. See fn.yearFromDate
Parameters:
Name Type Argument Description
arg XsDate <optional>
The date whose year component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

yearFromDateTime(arg) → {XsInteger}

Returns an xs:integer representing the year component in the localized value of arg. The result may be negative. Provides a client interface to a server function. See fn.yearFromDateTime
Parameters:
Name Type Argument Description
arg XsDateTime <optional>
The dateTime whose year component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger

yearsFromDuration(arg) → {XsInteger}

Returns an xs:integer representing the years component in the canonical lexical representation of the value of arg. The result may be negative. Provides a client interface to a server function. See fn.yearsFromDuration
Parameters:
Name Type Argument Description
arg XsDuration <optional>
The duration whose year component will be returned.
Since:
  • 2.1.1
Returns:
Type
XsInteger
Copyright (c) 2020 MarkLogic Corporation Documentation generated by JSDoc 4.0.0 on 2024-08-19T23:06:48-07:00 using the DocStrap template.