Loading TOC...

fn functions

The table below lists all the fn built-in functions (in this namespace: http://www.w3.org/2005/xpath-functions).

You can also view these functions broken down by category:

122 functions
Function nameDescription
fn.absReturns the absolute value of $arg.
fn.adjustDateTimeToTimezoneAdjusts an xs:dateTime value to a specific timezone, or to no timezone at all.
fn.adjustDateToTimezoneAdjusts an xs:date value to a specific timezone, or to no timezone at all.
fn.adjustTimeToTimezoneAdjusts an xs:time value to a specific timezone, or to no timezone at all.
fn.analyzeStringThe 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.
fn.avgReturns the average of the values in the input sequence $arg, that is, the sum of the values divided by the number of values.
fn.baseUriReturns the value of the base-uri property for the specified node.
fn.booleanComputes the effective boolean value of the sequence $arg.
fn.ceilingReturns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of $arg.
fn.codepointEqualReturns true if the specified parameters are the same Unicode code point, otherwise returns false.
fn.codepointsToStringCreates an xs:string from a sequence of Unicode code points.
fn.collectionReturns all of the documents that belong to the specified collection(s).
fn.compareReturns -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.
fn.concatReturns the xs:string that is the concatenation of the values of the specified parameters.
fn.containsReturns true if the first parameter contains the string from the second parameter, otherwise returns false.
fn.countReturns the number of items in the value of $arg.
fn.currentDateReturns xs:date(fn:current-dateTime()).
fn.currentDateTimeReturns the current dateTime value (with timezone) from the dynamic context.
fn.currentTimeReturns xs:time(fn:current-dateTime()).
fn.dataTakes a sequence of items and returns a sequence of atomic values.
fn.dayFromDateReturns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
fn.dayFromDateTimeReturns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
fn.daysFromDurationReturns an xs:integer representing the days component in the canonical lexical representation of the value of $arg.
fn.deepEqualThis function assesses whether two sequences are deep-equal to each other.
fn.defaultCollationReturns the value of the default collation property from the static context.
fn.distinctValuesReturns the sequence that results from removing from $arg all but one of a set of values that are eq to one other.
fn.docReturns the document(s) stored in the database at the specified URI(s).
fn.docAvailableIf fn:doc($uri) returns a document node, this function returns true.
fn.documentReturns the document(s) stored in the database at the specified URI(s).
fn.documentUriReturns the value of the document-uri property for the specified node.
fn.emptyIf the value of $arg is the empty sequence, the function returns true; otherwise, the function returns false.
fn.encodeForUriInvertible function that escapes characters required to be escaped inside path segments of URIs.
fn.endsWithReturns true if the first parameter ends with the string from the second parameter, otherwise returns false.
fn.error[1.0 and 1.0-ml only, 0.9-ml has a different signature] Throw the given error.
fn.escapeHtmlUri%-escapes everything except printable ASCII characters.
fn.exactlyOneReturns $arg if it contains exactly one item.
fn.existsIf the value of $arg is not the empty sequence, the function returns true; otherwise, the function returns false.
fn.falseReturns the xs:boolean value false.
fn.floorReturns the largest (closest to positive infinity) number with no fractional part that is not greater than the value of $arg.
fn.formatDateReturns a formatted date value based on the picture argument.
fn.formatDateTimeReturns a formatted dateTime value based on the picture argument.
fn.formatNumberReturns a formatted string representation of value argument based on the supplied picture.
fn.formatTimeReturns a formatted time value based on the picture argument.
fn.functionAvailableReturns true if and only if there is an XQuery or XSLT function whose name and optionally arity matches the value of the $function-name and the optional $arity arguments.
fn.functionLookupReturns a function with the given name and arity, or the empty sequence if none exists.
fn.generateIdReturns a string that uniquely identifies a given node.
fn.headReturns the first item in a sequence.
fn.hoursFromDateTimeReturns an xs:integer between 0 and 23, both inclusive, representing the hours component in the localized value of $arg.
fn.hoursFromDurationReturns an xs:integer representing the hours component in the canonical lexical representation of the value of $arg.
fn.hoursFromTimeReturns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
fn.idReturns 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.idrefReturns 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.implicitTimezoneReturns the value of the implicit timezone property from the dynamic context.
fn.indexOfReturns a sequence of positive integers giving the positions within the sequence $seqParam of items that are equal to $srchParam.
fn.inScopePrefixesReturns the prefixes of the in-scope namespaces for $element.
fn.insertBeforeReturns 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.iriToUriIdempotent function that escapes non-URI characters.
fn.langThis 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.
fn.localNameReturns 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.
fn.localNameFromQNameReturns an xs:NCName representing the local part of $arg.
fn.lowerCaseReturns the specified string converting all of the characters to lower-case characters.
fn.matchesReturns true if the specified $input matches the specified $pattern, otherwise returns false.
fn.maxSelects 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.minSelects 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.minutesFromDateTimeReturns an xs:integer value between 0 and 59, both inclusive, representing the minute component in the localized value of $arg.
fn.minutesFromDurationReturns an xs:integer representing the minutes component in the canonical lexical representation of the value of $arg.
fn.minutesFromTimeReturns an xs:integer value between 0 to 59, both inclusive, representing the value of the minutes component in the localized value of $arg.
fn.monthFromDateReturns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
fn.monthFromDateTimeReturns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
fn.monthsFromDurationReturns an xs:integer representing the months component in the canonical lexical representation of the value of $arg.
fn.nameReturns 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.
fn.namespaceUriReturns the namespace URI of the xs:QName of the node specified by $arg.
fn.namespaceUriForPrefixReturns the namespace URI of one of the in-scope namespaces for $element, identified by its namespace prefix.
fn.namespaceUriFromQNameReturns the namespace URI for $arg as an xs:string.
fn.nilledSummary: Returns an xs:boolean indicating whether the argument node is "nilled".
fn.nodeNameReturns an expanded-QName for node kinds that can have names.
fn.normalizeSpaceReturns 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).
fn.normalizeUnicodeReturn the argument normalized according to the normalization criteria for a normalization form identified by the value of $normalizationForm.
fn.notReturns true if the effective boolean value is false, and false if the effective boolean value is true.
fn.numberReturns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an xs:double.
fn.oneOrMoreReturns $arg if it contains one or more items.
fn.prefixFromQNameReturns an xs:NCName representing the prefix of $arg.
fn.QNameReturns an xs:QName with the namespace URI given in $paramURI.
fn.removeReturns a new sequence constructed from the value of $target with the item at the position specified by the value of $position removed.
fn.replaceReturns a string constructed by replacing the specified $pattern on the $input string with the specified $replacement string.
fn.resolveQNameReturns 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.
fn.resolveUriResolves a relative URI against an absolute URI.
fn.reverseReverses the order of items in a sequence.
fn.rootReturns the root of the tree to which $arg belongs.
fn.roundReturns the number with no fractional part that is closest to the argument.
fn.roundHalfToEvenThe value returned is the nearest (that is, numerically closest) numeric to $arg that is a multiple of ten to the power of minus $precision.
fn.secondsFromDateTimeReturns an xs:decimal value between 0 and 60.999..., both inclusive representing the seconds and fractional seconds in the localized value of $arg.
fn.secondsFromDurationReturns an xs:decimal representing the seconds component in the canonical lexical representation of the value of $arg.
fn.secondsFromTimeReturns an xs:decimal value between 0 and 60.999..., both inclusive, representing the seconds and fractional seconds in the localized value of $arg.
fn.startsWithReturns true if the first parameter starts with the string from the second parameter, otherwise returns false.
fn.staticBaseUriReturns the value of the base-uri property from the static context.
fn.stringReturns the value of $arg represented as an xs:string.
fn.stringJoinReturns an xs:string created by concatenating the members of the $parameter1 sequence using $parameter2 as a separator.
fn.stringLengthReturns an integer representing the length of the specified string.
fn.stringToCodepointsReturns the sequence of Unicode code points that constitute an xs:string.
fn.subsequenceReturns 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.substringReturns a substring starting from the $startingLoc and continuing for $length characters.
fn.substringAfterReturns the substring created by taking all of the input characters that occur after the specified $after characters.
fn.substringBeforeReturns the substring created by taking all of the input characters that occur before the specified $before characters.
fn.sumReturns a value obtained by adding together the values in $arg.
fn.tailReturns all but the first item in a sequence.
fn.timezoneFromDateReturns the timezone component of $arg if any.
fn.timezoneFromDateTimeReturns the timezone component of $arg if any.
fn.timezoneFromTimeReturns the timezone component of $arg if any.
fn.tokenizeReturns a sequence of strings contructed by breaking the specified input into substrings separated by the specified $pattern.
fn.traceReturn the input $value unchanged and, if $label is the name of an enabled server event, log event to the App Server log file <install_dir>/Logs/<port>_ErrorLog.txt; where <install_dir> is the MarkLogic install directory, and <port> is the port number of the current App Server or "TaskServer" if the current request is running on the Task Server.
fn.translateReturns 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.
fn.trueReturns the xs:boolean value true.
fn.typeAvailableReturns true if and only if there is a type whose name matches the value of the $type-name argument is present in the static context.
fn.unorderedReturns the items of $sourceSeq in an implementation dependent order.
fn.unparsedTextReads a file stored in the database as either text or binary file and returns its contents as a string.
fn.unparsedTextAvailableReturns true if a call to unparsed-text would succeed with identical arguments.
fn.upperCaseReturns the specified string converting all of the characters to upper-case characters.
fn.yearFromDateReturns an xs:integer representing the year component in the localized value of $arg.
fn.yearFromDateTimeReturns an xs:integer representing the year component in the localized value of $arg.
fn.yearsFromDurationReturns an xs:integer representing the years component in the canonical lexical representation of the value of $arg.
fn.zeroOrOneReturns $arg if it contains zero or one items.
Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy