# Zorba

The XQuery Processor

- Documentation
- Live Demo
- Modules
- Download
- Tools
- Blog
- Code

# http://www.functx.com/

Module Description
Before using any of the functions below please remember to import the module namespace:

    import module namespace functx = "http://www.functx.com/";

-------------------------------- The FunctX XQuery Function Library -------------------------------- Copyright (C) 2007 Datypic This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA For more information on the FunctX XQuery library, contact contrib@functx.com.

Version:

1.0

Module Resources

- the XQuery module can be found here.

Related Documentation

For more details please also see:

- http://www.xqueryfunctions.com

Namespaces

functx | http://www.functx.com/

Function Summary

| `add-attributes ( $elements as element(*)*, $attrNames as xs:QName*, $attrValues as xs:anyAtomicType* ) as element(*)? Adds attributes to XML elements.`
| `add-months ( $date as xs:anyAtomicType?, $months as xs:integer ) as xs:date? Adds months to a date.`
| `add-or-update-attributes ( $elements as element(*)*, $attrNames as xs:QName*, $attrValues as xs:anyAtomicType* ) as element(*)? Adds attributes to XML elements.`
| `all-whitespace ( $arg as xs:string? ) as xs:boolean Whether a value is all whitespace or a zero-length string.`
| `are-distinct-values ( $seq as xs:anyAtomicType* ) as xs:boolean Whether all the values in a sequence are distinct.`
| `atomic-type ( $values as xs:anyAtomicType* ) as xs:string* The built-in type of an atomic value.`
| `avg-empty-is-zero ( $values as xs:anyAtomicType*, $allNodes as node()* ) as xs:double The average, counting "empty" values as zero.`
| `between-exclusive ( $value as xs:anyAtomicType?, $minValue as xs:anyAtomicType, $maxValue as xs:anyAtomicType ) as xs:boolean Whether a value is between two provided values.`
| `between-inclusive ( $value as xs:anyAtomicType?, $minValue as xs:anyAtomicType, $maxValue as xs:anyAtomicType ) as xs:boolean Whether a value is between two provided values, or equal to one of them.`
| `camel-case-to-words ( $arg as xs:string?, $delim as xs:string ) as xs:string Turns a camelCase string into space-separated words.`
| `capitalize-first ( $arg as xs:string? ) as xs:string? Capitalizes the first character of a string.`
| `change-element-names-deep ( $nodes as node()*, $oldNames as xs:QName*, $newNames as xs:QName* ) as node()* Changes the names of elements in an XML fragment.`
| `change-element-ns ( $elements as element(*)*, $newns as xs:string, $prefix as xs:string ) as element(*)? Changes the namespace of XML elements.`
| `change-element-ns-deep ( $nodes as node()*, $newns as xs:string, $prefix as xs:string ) as node()* Changes the namespace of XML elements and its descendants.`
| `chars ( $arg as xs:string? ) as xs:string* Converts a string to a sequence of characters.`
| `contains-any-of ( $arg as xs:string?, $searchStrings as xs:string* ) as xs:boolean Whether a string contains any of a sequence of strings.`
| `contains-case-insensitive ( $arg as xs:string?, $substring as xs:string ) as xs:boolean? Whether one string contains another, without regard to case.`
| `contains-word ( $arg as xs:string?, $word as xs:string ) as xs:boolean Whether one string contains another, as a separate word.`
| `copy-attributes ( $copyTo as element(*), $copyFrom as element(*) ) as element(*) Copies attributes from one element to another.`
| `date ( $year as xs:anyAtomicType, $month as xs:anyAtomicType, $day as xs:anyAtomicType ) as xs:date Construct a date from a year, month and day.`
| `dateTime ( $year as xs:anyAtomicType, $month as xs:anyAtomicType, $day as xs:anyAtomicType, $hour as xs:anyAtomicType, $minute as xs:anyAtomicType, $second as xs:anyAtomicType ) as xs:dateTime Construct a date/time from individual components.`
| `day-in-year ( $date as xs:anyAtomicType? ) as xs:integer? The day of the year (a number between 1 and 366).`
| `day-of-week ( $date as xs:anyAtomicType? ) as xs:integer? The day of the week, from a date.`
| `day-of-week-abbrev-en ( $date as xs:anyAtomicType? ) as xs:string? The abbreviated day of the week, from a date, in English.`
| `day-of-week-name-en ( $date as xs:anyAtomicType? ) as xs:string? The name of the day of the week, from a date, in English.`
| `dayTimeDuration ( $days as xs:decimal?, $hours as xs:decimal?, $minutes as xs:decimal?, $seconds as xs:decimal? ) as xs:dayTimeDuration Construct a dayTimeDuration from a number of days, hours, etc.`
| `days-in-month ( $date as xs:anyAtomicType? ) as xs:integer? Number of days in the month.`
| `depth-of-node ( $node as node()? ) as xs:integer The depth (level) of a node in an XML tree.`
| `distinct-attribute-names ( $nodes as node()* ) as xs:string* The distinct names of all attributes in an XML fragment.`
| `distinct-deep ( $nodes as node()* ) as node()* The XML nodes with distinct values, taking into account attributes and descendants.`
| `distinct-element-names ( $nodes as node()* ) as xs:string* The distinct names of all elements in an XML fragment.`
| `distinct-element-paths ( $nodes as node()* ) as xs:string* The distinct paths of all descendant elements in an XML fragment.`
| `distinct-nodes ( $nodes as node()* ) as node()* The distinct XML nodes in a sequence (by node identity).`
| `duration-from-timezone ( $timezone as xs:string ) as xs:dayTimeDuration Converts a timezone like "-05:00" or "Z" into xs:dayTimeDuration.`
| `dynamic-path ( $parent as node(), $path as xs:string ) as item()* Dynamically evaluates a simple XPath path.`
| `escape-for-regex ( $arg as xs:string? ) as xs:string Escapes regex special characters.`
| `exclusive-or ( $arg1 as xs:boolean?, $arg2 as xs:boolean? ) as xs:boolean? Whether one (and only one) of two boolean values is true.`
| `first-day-of-month ( $date as xs:anyAtomicType? ) as xs:date? The first day of the month of a date.`
| `first-day-of-year ( $date as xs:anyAtomicType? ) as xs:date? The first day of the year of a date.`
| `first-node ( $nodes as node()* ) as node()? The XML node in a sequence that appears first in document order.`
| `follows-not-descendant ( $a as node()?, $b as node()? ) as xs:boolean Whether an XML node follows another without being its descendant.`
| `format-as-title-en ( $titles as xs:string* ) as xs:string* Moves title words like "the" and "a" to the end of strings.`
| `fragment-from-uri ( $uri as xs:string? ) as xs:string? Returns the fragment from a URI.`
| `get-matches ( $string as xs:string?, $regex as xs:string ) as xs:string* Return the matching regions of a string.`
| `get-matches-and-non-matches ( $string as xs:string?, $regex as xs:string ) as element(*)* Splits a string into matching and non-matching regions.`
| `has-element-only-content ( $element as element(*) ) as xs:boolean Whether an element has element-only content.`
| `has-empty-content ( $element as element(*) ) as xs:boolean Whether an element has empty content.`
| `has-mixed-content ( $element as element(*) ) as xs:boolean Whether an element has mixed content.`
| `has-simple-content ( $element as element(*) ) as xs:boolean Whether an element has simple content.`
| `id-from-element ( $element as element(*)? ) as xs:string? Gets the ID of an XML element.`
| `id-untyped ( $node as node()*, $id as xs:anyAtomicType ) as element(*)* Gets XML element(s) that have an attribute with a particular value.`
| `if-absent ( $arg as item()*, $value as item()* ) as item()* The first argument if it is not empty, otherwise the second argument.`
| `if-empty ( $arg as item()?, $value as item()* ) as item()* The first argument if it is not blank, otherwise the second argument.`
| `index-of-deep-equal-node ( $nodes as node()*, $nodeToFind as node() ) as xs:integer* The position of a node in a sequence, based on contents and attributes.`
| `index-of-match-first ( $arg as xs:string?, $pattern as xs:string ) as xs:integer? The first position of a matching substring.`
| `index-of-node ( $nodes as node()*, $nodeToFind as node() ) as xs:integer* The position of a node in a sequence, based on node identity.`
| `index-of-string ( $arg as xs:string?, $substring as xs:string ) as xs:integer* The position(s) of a substring.`
| `index-of-string-first ( $arg as xs:string?, $substring as xs:string ) as xs:integer? The first position of a substring.`
| `index-of-string-last ( $arg as xs:string?, $substring as xs:string ) as xs:integer? The last position of a substring.`
| `insert-string ( $originalString as xs:string?, $stringToInsert as xs:string?, $pos as xs:integer ) as xs:string Inserts a string at a specified position.`
| `is-a-number ( $value as xs:anyAtomicType? ) as xs:boolean Whether a value is numeric.`
| `is-absolute-uri ( $uri as xs:string? ) as xs:boolean Whether a URI is absolute.`
| `is-ancestor ( $node1 as node(), $node2 as node() ) as xs:boolean Whether an XML node is an ancestor of another node.`
| `is-descendant ( $node1 as node(), $node2 as node() ) as xs:boolean Whether an XML node is a descendant of another node.`
| `is-leap-year ( $date as xs:anyAtomicType? ) as xs:boolean Whether a date falls in a leap year.`
| `is-node-among-descendants ( $node as node()?, $seq as node()* ) as xs:boolean Whether an XML node is among the descendants of a sequence, based on node identity.`
| `is-node-among-descendants-deep-equal ( $node as node()?, $seq as node()* ) as xs:boolean Whether an XML node is among the descendants of a sequence, based on contents and attributes.`
| `is-node-in-sequence ( $node as node()?, $seq as node()* ) as xs:boolean Whether an XML node is in a sequence, based on node identity.`
| `is-node-in-sequence-deep-equal ( $node as node()?, $seq as node()* ) as xs:boolean Whether an XML node is in a sequence, based on contents and attributes.`
| `is-value-in-sequence ( $value as xs:anyAtomicType?, $seq as xs:anyAtomicType* ) as xs:boolean Whether an atomic value appears in a sequence.`
| `last-day-of-month ( $date as xs:anyAtomicType? ) as xs:date? The last day of the month of a date.`
| `last-day-of-year ( $date as xs:anyAtomicType? ) as xs:date? The last day of the month of a date.`
| `last-node ( $nodes as node()* ) as node()? The XML node in a sequence that is last in document order.`
| `leaf-elements ( $root as node()? ) as element(*)* All XML elements that don't have any child elements.`
| `left-trim ( $arg as xs:string? ) as xs:string Trims leading whitespace.`
| `line-count ( $arg as xs:string? ) as xs:integer The number of lines.`
| `lines ( $arg as xs:string? ) as xs:string* Split a string into separate lines.`
| `max-depth ( $root as node()? ) as xs:integer? The maximum depth of elements in an XML tree.`
| `max-determine-type ( $seq as xs:anyAtomicType* ) as xs:anyAtomicType? The maximum value in a sequence, figuring out its type (numeric or string).`
| `max-line-length ( $arg as xs:string? ) as xs:integer The maximum line length.`
| `max-node ( $nodes as node()* ) as node()* The XML node whose typed value is the maximum.`
| `max-string ( $strings as xs:anyAtomicType* ) as xs:string? The maximum of a sequence of values, treating them like strings.`
| `min-determine-type ( $seq as xs:anyAtomicType* ) as xs:anyAtomicType? The minimum value in a sequence, figuring out its type (numeric or string).`
| `min-node ( $nodes as node()* ) as node()* The XML node whose typed value is the minimum.`
| `min-non-empty-string ( $strings as xs:string* ) as xs:string? The minimum of a sequence of strings, ignoring "empty" values.`
| `min-string ( $strings as xs:anyAtomicType* ) as xs:string? The minimum of a sequence of values, treating them like strings.`
| `mmddyyyy-to-date ( $dateString as xs:string? ) as xs:date? Converts a string with format MMDDYYYY (with any delimiters) to a date.`
| `month-abbrev-en ( $date as xs:anyAtomicType? ) as xs:string? The month of a date as an abbreviated word (Jan, Feb, etc.`
| `month-name-en ( $date as xs:anyAtomicType? ) as xs:string? The month of a date as a word (January, February, etc.`
| `name-test ( $testname as xs:string?, $names as xs:string* ) as xs:boolean Whether a name matches a list of names or name wildcards.`
| `namespaces-in-use ( $root as node()? ) as xs:anyURI* A list of namespaces used in element/attribute names in an XML fragment.`
| `next-day ( $date as xs:anyAtomicType? ) as xs:date? The next day.`
| `node-kind ( $nodes as node()* ) as xs:string* The XML node kind (element, attribute, text, etc.`
| `non-distinct-values ( $seq as xs:anyAtomicType* ) as xs:anyAtomicType* Returns any values that appear more than once in a sequence.`
| `number-of-matches ( $arg as xs:string?, $pattern as xs:string ) as xs:integer The number of regions that match a pattern.`
| `open-ref-document ( $refNode as node() ) as document() Resolves a relative URI and references it, returning an XML document.`
| `ordinal-number-en ( $num as xs:integer? ) as xs:string Reformats a number as an ordinal number, e.`
| `pad-integer-to-length ( $integerToPad as xs:anyAtomicType?, $length as xs:integer ) as xs:string Pads an integer to a desired length by adding leading zeros.`
| `pad-string-to-length ( $stringToPad as xs:string?, $padChar as xs:string, $length as xs:integer ) as xs:string Pads a string to a desired length.`
| `path-to-node ( $nodes as node()* ) as xs:string* A path to an XML node (or sequence of nodes).`
| `path-to-node-with-pos ( $node as node()? ) as xs:string A unique path to an XML node (or sequence of nodes).`
| `precedes-not-ancestor ( $a as node()?, $b as node()? ) as xs:boolean Whether an XML node precedes another without being its ancestor.`
| `previous-day ( $date as xs:anyAtomicType? ) as xs:date? The previous day.`
| `remove-attributes ( $elements as element(*)*, $names as xs:string* ) as element(*) Removes attributes from an XML element, based on name.`
| `remove-attributes-deep ( $nodes as node()*, $names as xs:string* ) as node()* Removes attributes from an XML fragment, based on name.`
| `remove-elements ( $elements as element(*)*, $names as xs:string* ) as element(*)* Removes child elements from an XML node, based on name.`
| `remove-elements-deep ( $nodes as node()*, $names as xs:string* ) as node()* Removes descendant elements from an XML node, based on name.`
| `remove-elements-not-contents ( $nodes as node()*, $names as xs:string* ) as node()* Removes descendant XML elements but keeps their content.`
| `repeat-string ( $stringToRepeat as xs:string?, $count as xs:integer ) as xs:string Repeats a string a given number of times.`
| `replace-beginning ( $arg as xs:string?, $pattern as xs:string, $replacement as xs:string ) as xs:string Replaces the beginning of a string, up to a matched pattern.`
| `replace-element-values ( $elements as element(*)*, $values as xs:anyAtomicType* ) as element(*)* Updates the content of one or more elements.`
| `replace-first ( $arg as xs:string?, $pattern as xs:string, $replacement as xs:string ) as xs:string Replaces the first match of a pattern.`
| `replace-multi ( $arg as xs:string?, $changeFrom as xs:string*, $changeTo as xs:string* ) as xs:string? Performs multiple replacements, using pairs of replace parameters.`
| `reverse-string ( $arg as xs:string? ) as xs:string Reverses the order of characters.`
| `right-trim ( $arg as xs:string? ) as xs:string Trims trailing whitespace.`
| `scheme-from-uri ( $uri as xs:string? ) as xs:string? Returns the scheme from a URI.`
| `sequence-deep-equal ( $seq1 as item()*, $seq2 as item()* ) as xs:boolean Whether two sequences have the same XML node content and/or values.`
| `sequence-node-equal ( $seq1 as node()*, $seq2 as node()* ) as xs:boolean Whether two sequences contain the same XML nodes, in the same order.`
| `sequence-node-equal-any-order ( $seq1 as node()*, $seq2 as node()* ) as xs:boolean Whether two sequences contain the same XML nodes, regardless of order.`
| `sequence-type ( $items as item()* ) as xs:string The sequence type that represents a sequence of nodes or values.`
| `siblings ( $node as node()? ) as node()* The siblings of an XML node.`
| `siblings-same-name ( $element as element(*)? ) as element(*)* The siblings of an XML element that have the same name.`
| `sort ( $seq as item()* ) as item()* Sorts a sequence of values or nodes.`
| `sort-as-numeric ( $seq as item()* ) as item()* Sorts a sequence of numeric values or nodes.`
| `sort-case-insensitive ( $seq as item()* ) as item()* Sorts a sequence of values or nodes regardless of capitalization.`
| `sort-document-order ( $seq as node()* ) as node()* Sorts a sequence of nodes in document order.`
| `substring-after-if-contains ( $arg as xs:string?, $delim as xs:string ) as xs:string? Performs substring-after, returning the entire string if it does not contain the delimiter.`
| `substring-after-last ( $arg as xs:string?, $delim as xs:string ) as xs:string The substring after the last occurrence of a delimiter.`
| `substring-after-last-match ( $arg as xs:string?, $regex as xs:string ) as xs:string The substring after the last text that matches a regex.`
| `substring-after-match ( $arg as xs:string?, $regex as xs:string ) as xs:string? The substring after the first text that matches a regex.`
| `substring-before-if-contains ( $arg as xs:string?, $delim as xs:string ) as xs:string? Performs substring-before, returning the entire string if it does not contain the delimiter.`
| `substring-before-last ( $arg as xs:string?, $delim as xs:string ) as xs:string The substring before the last occurrence of a delimiter.`
| `substring-before-last-match ( $arg as xs:string?, $regex as xs:string ) as xs:string? The substring after the first text that matches a regex.`
| `substring-before-match ( $arg as xs:string?, $regex as xs:string ) as xs:string The substring before the last text that matches a regex.`
| `time ( $hour as xs:anyAtomicType, $minute as xs:anyAtomicType, $second as xs:anyAtomicType ) as xs:time Construct a time from an hour, minute and second.`
| `timezone-from-duration ( $duration as xs:dayTimeDuration ) as xs:string Converts an xs:dayTimeDuration into a timezone like "-05:00" or "Z".`
| `total-days-from-duration ( $duration as xs:dayTimeDuration? ) as xs:decimal? The total number of days in a dayTimeDuration.`
| `total-hours-from-duration ( $duration as xs:dayTimeDuration? ) as xs:decimal? The total number of hours in a dayTimeDuration.`
| `total-minutes-from-duration ( $duration as xs:dayTimeDuration? ) as xs:decimal? The total number of minutes in a dayTimeDuration.`
| `total-months-from-duration ( $duration as xs:yearMonthDuration? ) as xs:decimal? The total number of months in a yearMonthDuration.`
| `total-seconds-from-duration ( $duration as xs:dayTimeDuration? ) as xs:decimal? The total number of seconds in a dayTimeDuration.`
| `total-years-from-duration ( $duration as xs:yearMonthDuration? ) as xs:decimal? The total number of years in a yearMonthDuration.`
| `trim ( $arg as xs:string? ) as xs:string Trims leading and trailing whitespace.`
| `update-attributes ( $elements as element(*)*, $attrNames as xs:QName*, $attrValues as xs:anyAtomicType* ) as element(*)? Updates the attribute value of an XML element.`
| `value-except ( $arg1 as xs:anyAtomicType*, $arg2 as xs:anyAtomicType* ) as xs:anyAtomicType* The values in one sequence that aren't in another sequence.`
| `value-intersect ( $arg1 as xs:anyAtomicType*, $arg2 as xs:anyAtomicType* ) as xs:anyAtomicType* The intersection of two sequences of values.`
| `value-union ( $arg1 as xs:anyAtomicType*, $arg2 as xs:anyAtomicType* ) as xs:anyAtomicType* The union of two sequences of values.`
| `word-count ( $arg as xs:string? ) as xs:integer The number of words.`
| `words-to-camel-case ( $arg as xs:string? ) as xs:string Turns a string of words into camelCase.`
| `wrap-values-in-elements ( $values as xs:anyAtomicType*, $elementName as xs:QName ) as element(*)* Wraps a sequence of atomic values in XML elements.`
| `yearMonthDuration ( $years as xs:decimal?, $months as xs:integer? ) as xs:yearMonthDuration Construct a yearMonthDuration from a number of years and months.`

Functions
add-attributes

    declare function functx:add-attributes (
                $elements as element(*)*,
                $attrNames as xs:QName*,
                $attrValues as xs:anyAtomicType*
    ) as element(*)?

Adds attributes to XML elements

Parameters:

- $elements the element(s) to which you wish to add the attribute
- $attrNames the name(s) of the attribute(s) to add
- $attrValues the value(s) of the attribute(s) to add

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_add-attributes.html

add-months

    declare function functx:add-months (
                $date as xs:anyAtomicType?,
                $months as xs:integer
    ) as xs:date?

Adds months to a date

Parameters:

- $date the date
- $months the number of months to add

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_add-months.html

add-or-update-attributes

    declare function functx:add-or-update-attributes (
                $elements as element(*)*,
                $attrNames as xs:QName*,
                $attrValues as xs:anyAtomicType*
    ) as element(*)?

Adds attributes to XML elements

Parameters:

- $elements the element(s) to which you wish to add the attribute
- $attrNames the name(s) of the attribute(s) to add
- $attrValues the value(s) of the attribute(s) to add

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_add-or-update-attributes.html

all-whitespace

    declare function functx:all-whitespace (
                $arg as xs:string?
    ) as xs:boolean

Whether a value is all whitespace or a zero-length string

Parameters:

- $arg the string (or node) to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_all-whitespace.html

are-distinct-values

    declare function functx:are-distinct-values (
                $seq as xs:anyAtomicType*
    ) as xs:boolean

Whether all the values in a sequence are distinct

Parameters:

- $seq the sequence of values

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_are-distinct-values.html

atomic-type

    declare function functx:atomic-type (
                $values as xs:anyAtomicType*
    ) as xs:string*

The built-in type of an atomic value

Parameters:

- $values the value(s) whose type you want to determine

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_atomic-type.html

avg-empty-is-zero

    declare function functx:avg-empty-is-zero (
                $values as xs:anyAtomicType*,
                $allNodes as node()*
    ) as xs:double

The average, counting "empty" values as zero

Parameters:

- $values the values to be averaged
- $allNodes the sequence of all nodes to find the average over

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_avg-empty-is-zero.html

between-exclusive

    declare function functx:between-exclusive (
                $value as xs:anyAtomicType?,
                $minValue as xs:anyAtomicType,
                $maxValue as xs:anyAtomicType
    ) as xs:boolean

Whether a value is between two provided values

Parameters:

- $value the value to be tested
- $minValue the minimum value
- $maxValue the maximum value

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_between-exclusive.html

between-inclusive

    declare function functx:between-inclusive (
                $value as xs:anyAtomicType?,
                $minValue as xs:anyAtomicType,
                $maxValue as xs:anyAtomicType
    ) as xs:boolean

Whether a value is between two provided values, or equal to one of them

Parameters:

- $value the value to be tested
- $minValue the minimum value
- $maxValue the maximum value

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_between-inclusive.html

camel-case-to-words

    declare function functx:camel-case-to-words (
                $arg as xs:string?,
                $delim as xs:string
    ) as xs:string

Turns a camelCase string into space-separated words

Parameters:

- $arg the string to modify
- $delim the delimiter for the words (e.g. a space)

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_camel-case-to-words.html

capitalize-first

    declare function functx:capitalize-first (
                $arg as xs:string?
    ) as xs:string?

Capitalizes the first character of a string

Parameters:

- $arg the word or phrase to capitalize

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_capitalize-first.html

change-element-names-deep

    declare function functx:change-element-names-deep (
                $nodes as node()*,
                $oldNames as xs:QName*,
                $newNames as xs:QName*
    ) as node()*

Changes the names of elements in an XML fragment

Parameters:

- $nodes the element(s) to change
- $oldNames the sequence of names to change from
- $newNames the sequence of names to change to

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_change-element-names-deep.html

change-element-ns

    declare function functx:change-element-ns (
                $elements as element(*)*,
                $newns as xs:string,
                $prefix as xs:string
    ) as element(*)?

Changes the namespace of XML elements

Parameters:

- $elements the elements to change
- $newns the new namespace
- $prefix the prefix to use for the new namespace

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_change-element-ns.html

change-element-ns-deep

    declare function functx:change-element-ns-deep (
                $nodes as node()*,
                $newns as xs:string,
                $prefix as xs:string
    ) as node()*

Changes the namespace of XML elements and its descendants

Parameters:

- $nodes the nodes to change
- $newns the new namespace
- $prefix the prefix to use for the new namespace

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_change-element-ns-deep.html

chars

    declare function functx:chars (
                $arg as xs:string?
    ) as xs:string*

Converts a string to a sequence of characters

Parameters:

- $arg the string to split

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_chars.html

contains-any-of

    declare function functx:contains-any-of (
                $arg as xs:string?,
                $searchStrings as xs:string*
    ) as xs:boolean

Whether a string contains any of a sequence of strings

Parameters:

- $arg the string to test
- $searchStrings the strings to look for

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_contains-any-of.html

contains-case-insensitive

    declare function functx:contains-case-insensitive (
                $arg as xs:string?,
                $substring as xs:string
    ) as xs:boolean?

Whether one string contains another, without regard to case

Parameters:

- $arg the string to search
- $substring the substring to find

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_contains-case-insensitive.html

contains-word

    declare function functx:contains-word (
                $arg as xs:string?,
                $word as xs:string
    ) as xs:boolean

Whether one string contains another, as a separate word

Parameters:

- $arg the string to search
- $word the word to find

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_contains-word.html

copy-attributes

    declare function functx:copy-attributes (
                $copyTo as element(*),
                $copyFrom as element(*)
    ) as element(*)

Copies attributes from one element to another

Parameters:

- $copyTo the element to copy attributes to
- $copyFrom the element to copy attributes from

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_copy-attributes.html

date

    declare function functx:date (
                $year as xs:anyAtomicType,
                $month as xs:anyAtomicType,
                $day as xs:anyAtomicType
    ) as xs:date

Construct a date from a year, month and day

Parameters:

- $year the year
- $month the month
- $day the day

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_date.html

dateTime

    declare function functx:dateTime (
                $year as xs:anyAtomicType,
                $month as xs:anyAtomicType,
                $day as xs:anyAtomicType,
                $hour as xs:anyAtomicType,
                $minute as xs:anyAtomicType,
                $second as xs:anyAtomicType
    ) as xs:dateTime

Construct a date/time from individual components

Parameters:

- $year the year
- $month the month
- $day the day
- $hour the hour
- $minute the minute
- $second the second

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_datetime.html

day-in-year

    declare function functx:day-in-year (
                $date as xs:anyAtomicType?
    ) as xs:integer?

The day of the year (a number between 1 and 366)

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_day-in-year.html

day-of-week

    declare function functx:day-of-week (
                $date as xs:anyAtomicType?
    ) as xs:integer?

The day of the week, from a date

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_day-of-week.html

day-of-week-abbrev-en

    declare function functx:day-of-week-abbrev-en (
                $date as xs:anyAtomicType?
    ) as xs:string?

The abbreviated day of the week, from a date, in English

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_day-of-week-abbrev-en.html

day-of-week-name-en

    declare function functx:day-of-week-name-en (
                $date as xs:anyAtomicType?
    ) as xs:string?

The name of the day of the week, from a date, in English

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_day-of-week-name-en.html

dayTimeDuration

    declare function functx:dayTimeDuration (
                $days as xs:decimal?,
                $hours as xs:decimal?,
                $minutes as xs:decimal?,
                $seconds as xs:decimal?
    ) as xs:dayTimeDuration

Construct a dayTimeDuration from a number of days, hours, etc.

Parameters:

- $days the number of days
- $hours the number of hours
- $minutes the number of minutes
- $seconds the number of seconds

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_daytimeduration.html

days-in-month

    declare function functx:days-in-month (
                $date as xs:anyAtomicType?
    ) as xs:integer?

Number of days in the month

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_days-in-month.html

depth-of-node

    declare function functx:depth-of-node (
                $node as node()?
    ) as xs:integer

The depth (level) of a node in an XML tree

Parameters:

- $node the node to check

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_depth-of-node.html

distinct-attribute-names

    declare function functx:distinct-attribute-names (
                $nodes as node()*
    ) as xs:string*

The distinct names of all attributes in an XML fragment

Parameters:

- $nodes the root to start from

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_distinct-attribute-names.html

distinct-deep

    declare function functx:distinct-deep (
                $nodes as node()*
    ) as node()*

The XML nodes with distinct values, taking into account attributes and descendants

Parameters:

- $nodes the sequence of nodes to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_distinct-deep.html

distinct-element-names

    declare function functx:distinct-element-names (
                $nodes as node()*
    ) as xs:string*

The distinct names of all elements in an XML fragment

Parameters:

- $nodes the root(s) to start from

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_distinct-element-names.html

distinct-element-paths

    declare function functx:distinct-element-paths (
                $nodes as node()*
    ) as xs:string*

The distinct paths of all descendant elements in an XML fragment

Parameters:

- $nodes the root(s) to start from

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_distinct-element-paths.html

distinct-nodes

    declare function functx:distinct-nodes (
                $nodes as node()*
    ) as node()*

The distinct XML nodes in a sequence (by node identity)

Parameters:

- $nodes the node sequence

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_distinct-nodes.html

duration-from-timezone

    declare function functx:duration-from-timezone (
                $timezone as xs:string
    ) as xs:dayTimeDuration

Converts a timezone like "-05:00" or "Z" into xs:dayTimeDuration

Parameters:

- $timezone the time zone, in (+|-)HH:MM format

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_duration-from-timezone.html

dynamic-path

    declare function functx:dynamic-path (
                $parent as node(),
                $path as xs:string
    ) as item()*

Dynamically evaluates a simple XPath path

Parameters:

- $parent the root to start from
- $path the path expression

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_dynamic-path.html

escape-for-regex

    declare function functx:escape-for-regex (
                $arg as xs:string?
    ) as xs:string

Escapes regex special characters

Parameters:

- $arg the string to escape

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_escape-for-regex.html

exclusive-or

    declare function functx:exclusive-or (
                $arg1 as xs:boolean?,
                $arg2 as xs:boolean?
    ) as xs:boolean?

Whether one (and only one) of two boolean values is true

Parameters:

- $arg1 the first boolean value
- $arg2 the second boolean value

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_exclusive-or.html

first-day-of-month

    declare function functx:first-day-of-month (
                $date as xs:anyAtomicType?
    ) as xs:date?

The first day of the month of a date

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_first-day-of-month.html

first-day-of-year

    declare function functx:first-day-of-year (
                $date as xs:anyAtomicType?
    ) as xs:date?

The first day of the year of a date

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_first-day-of-year.html

first-node

    declare function functx:first-node (
                $nodes as node()*
    ) as node()?

The XML node in a sequence that appears first in document order

Parameters:

- $nodes the sequence of nodes

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_first-node.html

follows-not-descendant

    declare function functx:follows-not-descendant (
                $a as node()?,
                $b as node()?
    ) as xs:boolean

Whether an XML node follows another without being its descendant

Parameters:

- $a the first node
- $b the second node

Version:

1.0

Author:

W3C XML Query Working Group

See:

- http://www.xqueryfunctions.com/xq/functx_follows-not-descendant.html

format-as-title-en

    declare function functx:format-as-title-en (
                $titles as xs:string*
    ) as xs:string*

Moves title words like "the" and "a" to the end of strings

Parameters:

- $titles the titles to format

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_format-as-title-en.html

fragment-from-uri

    declare function functx:fragment-from-uri (
                $uri as xs:string?
    ) as xs:string?

Returns the fragment from a URI

Parameters:

- $uri the URI

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_fragment-from-uri.html

get-matches

    declare function functx:get-matches (
                $string as xs:string?,
                $regex as xs:string
    ) as xs:string*

Return the matching regions of a string

Parameters:

- $string the string to split
- $regex the pattern

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_get-matches.html

get-matches-and-non-matches

    declare function functx:get-matches-and-non-matches (
                $string as xs:string?,
                $regex as xs:string
    ) as element(*)*

Splits a string into matching and non-matching regions

Parameters:

- $string the string to split
- $regex the pattern

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_get-matches-and-non-matches.html

has-element-only-content

    declare function functx:has-element-only-content (
                $element as element(*)
    ) as xs:boolean

Whether an element has element-only content

Parameters:

- $element the XML element to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_has-element-only-content.html

has-empty-content

    declare function functx:has-empty-content (
                $element as element(*)
    ) as xs:boolean

Whether an element has empty content

Parameters:

- $element the XML element to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_has-empty-content.html

has-mixed-content

    declare function functx:has-mixed-content (
                $element as element(*)
    ) as xs:boolean

Whether an element has mixed content

Parameters:

- $element the XML element to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_has-mixed-content.html

has-simple-content

    declare function functx:has-simple-content (
                $element as element(*)
    ) as xs:boolean

Whether an element has simple content

Parameters:

- $element the XML element to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_has-simple-content.html

id-from-element

    declare function functx:id-from-element (
                $element as element(*)?
    ) as xs:string?

Gets the ID of an XML element

Parameters:

- $element the element

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_id-from-element.html

id-untyped

    declare function functx:id-untyped (
                $node as node()*,
                $id as xs:anyAtomicType
    ) as element(*)*

Gets XML element(s) that have an attribute with a particular value

Parameters:

- $node the root node(s) to start from
- $id the "id" to find

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_id-untyped.html

if-absent

    declare function functx:if-absent (
                $arg as item()*,
                $value as item()*
    ) as item()*

The first argument if it is not empty, otherwise the second argument

Parameters:

- $arg the item(s) that may be absent
- $value the item(s) to use if the item is absent

Version:

1.0

Author:

W3C XML Query WG

See:

- http://www.xqueryfunctions.com/xq/functx_if-absent.html

if-empty

    declare function functx:if-empty (
                $arg as item()?,
                $value as item()*
    ) as item()*

The first argument if it is not blank, otherwise the second argument

Parameters:

- $arg the node that may be empty
- $value the item(s) to use if the node is empty

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_if-empty.html

index-of-deep-equal-node

    declare function functx:index-of-deep-equal-node (
                $nodes as node()*,
                $nodeToFind as node()
    ) as xs:integer*

The position of a node in a sequence, based on contents and attributes

Parameters:

- $nodes the node sequence
- $nodeToFind the node to find in the sequence

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_index-of-deep-equal-node.html

index-of-match-first

    declare function functx:index-of-match-first (
                $arg as xs:string?,
                $pattern as xs:string
    ) as xs:integer?

The first position of a matching substring

Parameters:

- $arg the string
- $pattern the pattern to match

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_index-of-match-first.html

index-of-node

    declare function functx:index-of-node (
                $nodes as node()*,
                $nodeToFind as node()
    ) as xs:integer*

The position of a node in a sequence, based on node identity

Parameters:

- $nodes the node sequence
- $nodeToFind the node to find in the sequence

Version:

1.0

Author:

W3C XML Query Working Group

See:

- http://www.xqueryfunctions.com/xq/functx_index-of-node.html

index-of-string

    declare function functx:index-of-string (
                $arg as xs:string?,
                $substring as xs:string
    ) as xs:integer*

The position(s) of a substring

Parameters:

- $arg the string
- $substring the substring to find

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_index-of-string.html

index-of-string-first

    declare function functx:index-of-string-first (
                $arg as xs:string?,
                $substring as xs:string
    ) as xs:integer?

The first position of a substring

Parameters:

- $arg the string
- $substring the substring to find

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_index-of-string-first.html

index-of-string-last

    declare function functx:index-of-string-last (
                $arg as xs:string?,
                $substring as xs:string
    ) as xs:integer?

The last position of a substring

Parameters:

- $arg the string
- $substring the substring to find

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_index-of-string-last.html

insert-string

    declare function functx:insert-string (
                $originalString as xs:string?,
                $stringToInsert as xs:string?,
                $pos as xs:integer
    ) as xs:string

Inserts a string at a specified position

Parameters:

- $originalString the original string to insert into
- $stringToInsert the string to insert
- $pos the position

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_insert-string.html

is-a-number

    declare function functx:is-a-number (
                $value as xs:anyAtomicType?
    ) as xs:boolean

Whether a value is numeric

Parameters:

- $value the value to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_is-a-number.html

is-absolute-uri

    declare function functx:is-absolute-uri (
                $uri as xs:string?
    ) as xs:boolean

Whether a URI is absolute

Parameters:

- $uri the URI to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_is-absolute-uri.html

is-ancestor

    declare function functx:is-ancestor (
                $node1 as node(),
                $node2 as node()
    ) as xs:boolean

Whether an XML node is an ancestor of another node

Parameters:

- $node1 the first node
- $node2 the second node

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_is-ancestor.html

is-descendant

    declare function functx:is-descendant (
                $node1 as node(),
                $node2 as node()
    ) as xs:boolean

Whether an XML node is a descendant of another node

Parameters:

- $node1 the first node
- $node2 the second node

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_is-descendant.html

is-leap-year

    declare function functx:is-leap-year (
                $date as xs:anyAtomicType?
    ) as xs:boolean

Whether a date falls in a leap year

Parameters:

- $date the date or year

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_is-leap-year.html

is-node-among-descendants

    declare function functx:is-node-among-descendants (
                $node as node()?,
                $seq as node()*
    ) as xs:boolean

Whether an XML node is among the descendants of a sequence, based on node identity

Parameters:

- $node the node to test
- $seq the sequence of nodes to search

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_is-node-among-descendants.html

is-node-among-descendants-deep-equal

    declare function functx:is-node-among-descendants-deep-equal (
                $node as node()?,
                $seq as node()*
    ) as xs:boolean

Whether an XML node is among the descendants of a sequence, based on contents and attributes

Parameters:

- $node the node to test
- $seq the sequence of nodes to search

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_is-node-among-descendants-deep-equal.html

is-node-in-sequence

    declare function functx:is-node-in-sequence (
                $node as node()?,
                $seq as node()*
    ) as xs:boolean

Whether an XML node is in a sequence, based on node identity

Parameters:

- $node the node to test
- $seq the sequence of nodes to search

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_is-node-in-sequence.html

is-node-in-sequence-deep-equal

    declare function functx:is-node-in-sequence-deep-equal (
                $node as node()?,
                $seq as node()*
    ) as xs:boolean

Whether an XML node is in a sequence, based on contents and attributes

Parameters:

- $node the node to test
- $seq the sequence of nodes to search

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_is-node-in-sequence-deep-equal.html

is-value-in-sequence

    declare function functx:is-value-in-sequence (
                $value as xs:anyAtomicType?,
                $seq as xs:anyAtomicType*
    ) as xs:boolean

Whether an atomic value appears in a sequence

Parameters:

- $value the atomic value to test
- $seq the sequence of values to search

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_is-value-in-sequence.html

last-day-of-month

    declare function functx:last-day-of-month (
                $date as xs:anyAtomicType?
    ) as xs:date?

The last day of the month of a date

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_last-day-of-month.html

last-day-of-year

    declare function functx:last-day-of-year (
                $date as xs:anyAtomicType?
    ) as xs:date?

The last day of the month of a date

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_last-day-of-year.html

last-node

    declare function functx:last-node (
                $nodes as node()*
    ) as node()?

The XML node in a sequence that is last in document order

Parameters:

- $nodes the sequence of nodes

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_last-node.html

leaf-elements

    declare function functx:leaf-elements (
                $root as node()?
    ) as element(*)*

All XML elements that don't have any child elements

Parameters:

- $root the root

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_leaf-elements.html

left-trim

    declare function functx:left-trim (
                $arg as xs:string?
    ) as xs:string

Trims leading whitespace

Parameters:

- $arg the string to trim

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_left-trim.html

line-count

    declare function functx:line-count (
                $arg as xs:string?
    ) as xs:integer

The number of lines

Parameters:

- $arg the string to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_line-count.html

lines

    declare function functx:lines (
                $arg as xs:string?
    ) as xs:string*

Split a string into separate lines

Parameters:

- $arg the string to split

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_lines.html

max-depth

    declare function functx:max-depth (
                $root as node()?
    ) as xs:integer?

The maximum depth of elements in an XML tree

Parameters:

- $root the root to start from

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_max-depth.html

max-determine-type

    declare function functx:max-determine-type (
                $seq as xs:anyAtomicType*
    ) as xs:anyAtomicType?

The maximum value in a sequence, figuring out its type (numeric or string)

Parameters:

- $seq the sequence of values to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_max-determine-type.html

max-line-length

    declare function functx:max-line-length (
                $arg as xs:string?
    ) as xs:integer

The maximum line length

Parameters:

- $arg the string to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_max-line-length.html

max-node

    declare function functx:max-node (
                $nodes as node()*
    ) as node()*

The XML node whose typed value is the maximum

Parameters:

- $nodes the sequence of nodes to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_max-node.html

max-string

    declare function functx:max-string (
                $strings as xs:anyAtomicType*
    ) as xs:string?

The maximum of a sequence of values, treating them like strings

Parameters:

- $strings the sequence of values

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_max-string.html

min-determine-type

    declare function functx:min-determine-type (
                $seq as xs:anyAtomicType*
    ) as xs:anyAtomicType?

The minimum value in a sequence, figuring out its type (numeric or string)

Parameters:

- $seq the sequence of values to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_min-determine-type.html

min-node

    declare function functx:min-node (
                $nodes as node()*
    ) as node()*

The XML node whose typed value is the minimum

Parameters:

- $nodes the sequence of nodes to test

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_min-node.html

min-non-empty-string

    declare function functx:min-non-empty-string (
                $strings as xs:string*
    ) as xs:string?

The minimum of a sequence of strings, ignoring "empty" values

Parameters:

- $strings the sequence of strings to search

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_min-non-empty-string.html

min-string

    declare function functx:min-string (
                $strings as xs:anyAtomicType*
    ) as xs:string?

The minimum of a sequence of values, treating them like strings

Parameters:

- $strings the sequence of strings

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_min-string.html

mmddyyyy-to-date

    declare function functx:mmddyyyy-to-date (
                $dateString as xs:string?
    ) as xs:date?

Converts a string with format MMDDYYYY (with any delimiters) to a date

Parameters:

- $dateString the MMDDYYYY string

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_mmddyyyy-to-date.html

month-abbrev-en

    declare function functx:month-abbrev-en (
                $date as xs:anyAtomicType?
    ) as xs:string?

The month of a date as an abbreviated word (Jan, Feb, etc.)

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_month-abbrev-en.html

month-name-en

    declare function functx:month-name-en (
                $date as xs:anyAtomicType?
    ) as xs:string?

The month of a date as a word (January, February, etc.)

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_month-name-en.html

name-test

    declare function functx:name-test (
                $testname as xs:string?,
                $names as xs:string*
    ) as xs:boolean

Whether a name matches a list of names or name wildcards

Parameters:

- $testname the name to test
- $names the list of names or name wildcards

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_name-test.html

namespaces-in-use

    declare function functx:namespaces-in-use (
                $root as node()?
    ) as xs:anyURI*

A list of namespaces used in element/attribute names in an XML fragment

Parameters:

- $root the root node to start from

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_namespaces-in-use.html

next-day

    declare function functx:next-day (
                $date as xs:anyAtomicType?
    ) as xs:date?

The next day

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_next-day.html

node-kind

    declare function functx:node-kind (
                $nodes as node()*
    ) as xs:string*

The XML node kind (element, attribute, text, etc.)

Parameters:

- $nodes the node(s) whose kind you want to determine

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_node-kind.html

non-distinct-values

    declare function functx:non-distinct-values (
                $seq as xs:anyAtomicType*
    ) as xs:anyAtomicType*

Returns any values that appear more than once in a sequence

Parameters:

- $seq the sequence of values

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_non-distinct-values.html

number-of-matches

    declare function functx:number-of-matches (
                $arg as xs:string?,
                $pattern as xs:string
    ) as xs:integer

The number of regions that match a pattern

Parameters:

- $arg the string to test
- $pattern the regular expression

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_number-of-matches.html

open-ref-document

    declare function functx:open-ref-document (
                $refNode as node()
    ) as document()

Resolves a relative URI and references it, returning an XML document

Parameters:

- $refNode a node whose value is a relative URI reference

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_open-ref-document.html

ordinal-number-en

    declare function functx:ordinal-number-en (
                $num as xs:integer?
    ) as xs:string

Reformats a number as an ordinal number, e.g. 1st, 2nd, 3rd.

Parameters:

- $num the number

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_ordinal-number-en.html

pad-integer-to-length

    declare function functx:pad-integer-to-length (
                $integerToPad as xs:anyAtomicType?,
                $length as xs:integer
    ) as xs:string

Pads an integer to a desired length by adding leading zeros

Parameters:

- $integerToPad the integer to pad
- $length the desired length

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_pad-integer-to-length.html

pad-string-to-length

    declare function functx:pad-string-to-length (
                $stringToPad as xs:string?,
                $padChar as xs:string,
                $length as xs:integer
    ) as xs:string

Pads a string to a desired length

Parameters:

- $stringToPad the string to pad
- $padChar the character(s) to use as padding
- $length the desired length

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_pad-string-to-length.html

path-to-node

    declare function functx:path-to-node (
                $nodes as node()*
    ) as xs:string*

A path to an XML node (or sequence of nodes)

Parameters:

- $nodes the node sequence

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_path-to-node.html

path-to-node-with-pos

    declare function functx:path-to-node-with-pos (
                $node as node()?
    ) as xs:string

A unique path to an XML node (or sequence of nodes)

Parameters:

- $node the node sequence

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_path-to-node-with-pos.html

precedes-not-ancestor

    declare function functx:precedes-not-ancestor (
                $a as node()?,
                $b as node()?
    ) as xs:boolean

Whether an XML node precedes another without being its ancestor

Parameters:

- $a the first node
- $b the second node

Version:

1.0

Author:

W3C XML Query Working Group

See:

- http://www.xqueryfunctions.com/xq/functx_precedes-not-ancestor.html

previous-day

    declare function functx:previous-day (
                $date as xs:anyAtomicType?
    ) as xs:date?

The previous day

Parameters:

- $date the date

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_previous-day.html

remove-attributes

    declare function functx:remove-attributes (
                $elements as element(*)*,
                $names as xs:string*
    ) as element(*)

Removes attributes from an XML element, based on name

Parameters:

- $elements the element(s) from which to remove the attributes
- $names the names of the attributes to remove, or * for all attributes

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_remove-attributes.html

remove-attributes-deep

    declare function functx:remove-attributes-deep (
                $nodes as node()*,
                $names as xs:string*
    ) as node()*

Removes attributes from an XML fragment, based on name

Parameters:

- $nodes the root(s) to start from
- $names the names of the attributes to remove, or * for all attributes

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_remove-attributes-deep.html

remove-elements

    declare function functx:remove-elements (
                $elements as element(*)*,
                $names as xs:string*
    ) as element(*)*

Removes child elements from an XML node, based on name

Parameters:

- $elements the element(s) from which you wish to remove the children
- $names the names of the child elements to remove

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_remove-elements.html

remove-elements-deep

    declare function functx:remove-elements-deep (
                $nodes as node()*,
                $names as xs:string*
    ) as node()*

Removes descendant elements from an XML node, based on name

Parameters:

- $nodes root(s) to start from
- $names the names of the elements to remove

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_remove-elements-deep.html

remove-elements-not-contents

    declare function functx:remove-elements-not-contents (
                $nodes as node()*,
                $names as xs:string*
    ) as node()*

Removes descendant XML elements but keeps their content

Parameters:

- $nodes the root(s) to start from
- $names the names of the elements to remove

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_remove-elements-not-contents.html

repeat-string

    declare function functx:repeat-string (
                $stringToRepeat as xs:string?,
                $count as xs:integer
    ) as xs:string

Repeats a string a given number of times

Parameters:

- $stringToRepeat the string to repeat
- $count the desired number of copies

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_repeat-string.html

replace-beginning

    declare function functx:replace-beginning (
                $arg as xs:string?,
                $pattern as xs:string,
                $replacement as xs:string
    ) as xs:string

Replaces the beginning of a string, up to a matched pattern

Parameters:

- $arg the entire string to change
- $pattern the pattern of characters to replace up to
- $replacement the replacement string

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_replace-beginning.html

replace-element-values

    declare function functx:replace-element-values (
                $elements as element(*)*,
                $values as xs:anyAtomicType*
    ) as element(*)*

Updates the content of one or more elements

Parameters:

- $elements the elements whose content you wish to replace
- $values the replacement values

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_replace-element-values.html

replace-first

    declare function functx:replace-first (
                $arg as xs:string?,
                $pattern as xs:string,
                $replacement as xs:string
    ) as xs:string

Replaces the first match of a pattern

Parameters:

- $arg the entire string to change
- $pattern the pattern of characters to replace
- $replacement the replacement string

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_replace-first.html

replace-multi

    declare function functx:replace-multi (
                $arg as xs:string?,
                $changeFrom as xs:string*,
                $changeTo as xs:string*
    ) as xs:string?

Performs multiple replacements, using pairs of replace parameters

Parameters:

- $arg the string to manipulate
- $changeFrom the sequence of strings or patterns to change from
- $changeTo the sequence of strings to change to

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_replace-multi.html

reverse-string

    declare function functx:reverse-string (
                $arg as xs:string?
    ) as xs:string

Reverses the order of characters

Parameters:

- $arg the string to reverse

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_reverse-string.html

right-trim

    declare function functx:right-trim (
                $arg as xs:string?
    ) as xs:string

Trims trailing whitespace

Parameters:

- $arg the string to trim

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_right-trim.html

scheme-from-uri

    declare function functx:scheme-from-uri (
                $uri as xs:string?
    ) as xs:string?

Returns the scheme from a URI

Parameters:

- $uri the URI

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_scheme-from-uri.html

sequence-deep-equal

    declare function functx:sequence-deep-equal (
                $seq1 as item()*,
                $seq2 as item()*
    ) as xs:boolean

Whether two sequences have the same XML node content and/or values

Parameters:

- $seq1 the first sequence
- $seq2 the second sequence

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_sequence-deep-equal.html

sequence-node-equal

    declare function functx:sequence-node-equal (
                $seq1 as node()*,
                $seq2 as node()*
    ) as xs:boolean

Whether two sequences contain the same XML nodes, in the same order

Parameters:

- $seq1 the first sequence of nodes
- $seq2 the second sequence of nodes

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_sequence-node-equal.html

sequence-node-equal-any-order

    declare function functx:sequence-node-equal-any-order (
                $seq1 as node()*,
                $seq2 as node()*
    ) as xs:boolean

Whether two sequences contain the same XML nodes, regardless of order

Parameters:

- $seq1 the first sequence of nodes
- $seq2 the second sequence of nodes

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_sequence-node-equal-any-order.html

sequence-type

    declare function functx:sequence-type (
                $items as item()*
    ) as xs:string

The sequence type that represents a sequence of nodes or values

Parameters:

- $items the items whose sequence type you want to determine

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_sequence-type.html

siblings

    declare function functx:siblings (
                $node as node()?
    ) as node()*

The siblings of an XML node

Parameters:

- $node the node

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_siblings.html

siblings-same-name

    declare function functx:siblings-same-name (
                $element as element(*)?
    ) as element(*)*

The siblings of an XML element that have the same name

Parameters:

- $element the node

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_siblings-same-name.html

sort

    declare function functx:sort (
                $seq as item()*
    ) as item()*

Sorts a sequence of values or nodes

Parameters:

- $seq the sequence to sort

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_sort.html

sort-as-numeric

    declare function functx:sort-as-numeric (
                $seq as item()*
    ) as item()*

Sorts a sequence of numeric values or nodes

Parameters:

- $seq the sequence to sort

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_sort-as-numeric.html

sort-case-insensitive

    declare function functx:sort-case-insensitive (
                $seq as item()*
    ) as item()*

Sorts a sequence of values or nodes regardless of capitalization

Parameters:

- $seq the sequence to sort

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_sort-case-insensitive.html

sort-document-order

    declare function functx:sort-document-order (
                $seq as node()*
    ) as node()*

Sorts a sequence of nodes in document order

Parameters:

- $seq the sequence to sort

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_sort-document-order.html

substring-after-if-contains

    declare function functx:substring-after-if-contains (
                $arg as xs:string?,
                $delim as xs:string
    ) as xs:string?

Performs substring-after, returning the entire string if it does not contain the delimiter

Parameters:

- $arg the string to substring
- $delim the delimiter

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_substring-after-if-contains.html

substring-after-last

    declare function functx:substring-after-last (
                $arg as xs:string?,
                $delim as xs:string
    ) as xs:string

The substring after the last occurrence of a delimiter

Parameters:

- $arg the string to substring
- $delim the delimiter

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_substring-after-last.html

substring-after-last-match

    declare function functx:substring-after-last-match (
                $arg as xs:string?,
                $regex as xs:string
    ) as xs:string

The substring after the last text that matches a regex

Parameters:

- $arg the string to substring
- $regex the regular expression

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_substring-after-last-match.html

substring-after-match

    declare function functx:substring-after-match (
                $arg as xs:string?,
                $regex as xs:string
    ) as xs:string?

The substring after the first text that matches a regex

Parameters:

- $arg the string to substring
- $regex the regular expression

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_substring-after-match.html

substring-before-if-contains

    declare function functx:substring-before-if-contains (
                $arg as xs:string?,
                $delim as xs:string
    ) as xs:string?

Performs substring-before, returning the entire string if it does not contain the delimiter

Parameters:

- $arg the string to substring
- $delim the delimiter

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_substring-before-if-contains.html

substring-before-last

    declare function functx:substring-before-last (
                $arg as xs:string?,
                $delim as xs:string
    ) as xs:string

The substring before the last occurrence of a delimiter

Parameters:

- $arg the string to substring
- $delim the delimiter

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_substring-before-last.html

substring-before-last-match

    declare function functx:substring-before-last-match (
                $arg as xs:string?,
                $regex as xs:string
    ) as xs:string?

The substring after the first text that matches a regex

Parameters:

- $arg the string to substring
- $regex the regular expression

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_substring-before-last-match.html

substring-before-match

    declare function functx:substring-before-match (
                $arg as xs:string?,
                $regex as xs:string
    ) as xs:string

The substring before the last text that matches a regex

Parameters:

- $arg the string to substring
- $regex the regular expression

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_substring-before-match.html

time

    declare function functx:time (
                $hour as xs:anyAtomicType,
                $minute as xs:anyAtomicType,
                $second as xs:anyAtomicType
    ) as xs:time

Construct a time from an hour, minute and second

Parameters:

- $hour the hour
- $minute the minute
- $second the second

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_time.html

timezone-from-duration

    declare function functx:timezone-from-duration (
                $duration as xs:dayTimeDuration
    ) as xs:string

Converts an xs:dayTimeDuration into a timezone like "-05:00" or "Z"

Parameters:

- $duration the duration

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_timezone-from-duration.html

total-days-from-duration

    declare function functx:total-days-from-duration (
                $duration as xs:dayTimeDuration?
    ) as xs:decimal?

The total number of days in a dayTimeDuration

Parameters:

- $duration the duration

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_total-days-from-duration.html

total-hours-from-duration

    declare function functx:total-hours-from-duration (
                $duration as xs:dayTimeDuration?
    ) as xs:decimal?

The total number of hours in a dayTimeDuration

Parameters:

- $duration the duration

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_total-hours-from-duration.html

total-minutes-from-duration

    declare function functx:total-minutes-from-duration (
                $duration as xs:dayTimeDuration?
    ) as xs:decimal?

The total number of minutes in a dayTimeDuration

Parameters:

- $duration the duration

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_total-minutes-from-duration.html

total-months-from-duration

    declare function functx:total-months-from-duration (
                $duration as xs:yearMonthDuration?
    ) as xs:decimal?

The total number of months in a yearMonthDuration

Parameters:

- $duration the duration

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_total-months-from-duration.html

total-seconds-from-duration

    declare function functx:total-seconds-from-duration (
                $duration as xs:dayTimeDuration?
    ) as xs:decimal?

The total number of seconds in a dayTimeDuration

Parameters:

- $duration the duration

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_total-seconds-from-duration.html

total-years-from-duration

    declare function functx:total-years-from-duration (
                $duration as xs:yearMonthDuration?
    ) as xs:decimal?

The total number of years in a yearMonthDuration

Parameters:

- $duration the duration

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_total-years-from-duration.html

trim

    declare function functx:trim (
                $arg as xs:string?
    ) as xs:string

Trims leading and trailing whitespace

Parameters:

- $arg the string to trim

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_trim.html

update-attributes

    declare function functx:update-attributes (
                $elements as element(*)*,
                $attrNames as xs:QName*,
                $attrValues as xs:anyAtomicType*
    ) as element(*)?

Updates the attribute value of an XML element

Parameters:

- $elements the element(s) for which you wish to update the attribute
- $attrNames the name(s) of the attribute(s) to add
- $attrValues the value(s) of the attribute(s) to add

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_update-attributes.html

value-except

    declare function functx:value-except (
                $arg1 as xs:anyAtomicType*,
                $arg2 as xs:anyAtomicType*
    ) as xs:anyAtomicType*

The values in one sequence that aren't in another sequence

Parameters:

- $arg1 the first sequence
- $arg2 the second sequence

Version:

1.0

Author:

W3C XML Query Working Group

See:

- http://www.xqueryfunctions.com/xq/functx_value-except.html

value-intersect

    declare function functx:value-intersect (
                $arg1 as xs:anyAtomicType*,
                $arg2 as xs:anyAtomicType*
    ) as xs:anyAtomicType*

The intersection of two sequences of values

Parameters:

- $arg1 the first sequence
- $arg2 the second sequence

Version:

1.0

Author:

W3C XML Query Working Group

See:

- http://www.xqueryfunctions.com/xq/functx_value-intersect.html

value-union

    declare function functx:value-union (
                $arg1 as xs:anyAtomicType*,
                $arg2 as xs:anyAtomicType*
    ) as xs:anyAtomicType*

The union of two sequences of values

Parameters:

- $arg1 the first sequence
- $arg2 the second sequence

Version:

1.0

Author:

W3C XML Query Working Group

See:

- http://www.xqueryfunctions.com/xq/functx_value-union.html

word-count

    declare function functx:word-count (
                $arg as xs:string?
    ) as xs:integer

The number of words

Parameters:

- $arg the string to measure

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_word-count.html

words-to-camel-case

    declare function functx:words-to-camel-case (
                $arg as xs:string?
    ) as xs:string

Turns a string of words into camelCase

Parameters:

- $arg the string to modify

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_words-to-camel-case.html

wrap-values-in-elements

    declare function functx:wrap-values-in-elements (
                $values as xs:anyAtomicType*,
                $elementName as xs:QName
    ) as element(*)*

Wraps a sequence of atomic values in XML elements

Parameters:

- $values the values to wrap in elements
- $elementName the name of the elements to construct

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_wrap-values-in-elements.html

yearMonthDuration

    declare function functx:yearMonthDuration (
                $years as xs:decimal?,
                $months as xs:integer?
    ) as xs:yearMonthDuration

Construct a yearMonthDuration from a number of years and months

Parameters:

- $years the number of years
- $months the number of months

Version:

1.0

Author:

Priscilla Walmsley, Datypic

See:

- http://www.xqueryfunctions.com/xq/functx_yearmonthduration.html

blog comments powered by Disqus