From e0ba28815bfcfe9e7f9454f489a9d9b94e92f7cf Mon Sep 17 00:00:00 2001 From: widlam Date: Thu, 13 Apr 2023 11:20:54 +0200 Subject: [PATCH] finished writing XPath --- Frontend/tools/xpath.html | 3459 ++++++++++++++++++++++++++++++++++++- 1 file changed, 3421 insertions(+), 38 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 85469af..9b98399 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -712,6 +712,279 @@
+ fn:outermost($seq as node()*) as node()* +
+ Returns the outermost nodes of the input sequence that are not ancestors of any other + node in the input sequence
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()*Sequence of nodes
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:outermost(//chapter)Sequence of outermost chapter nodes
fn:outermost(/book//*)Sequence of outermost nodes in the book

+ W3C Documentation reference: outermost +
+ + + fn:innermost($seq as node()*) as node()* +
+ Returns the innermost nodes of the input sequence that are not descendants of any other + node in the input sequence
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()*Sequence of nodes
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:innermost(//chapter)Sequence of innermost chapter nodes
fn:innermost(/book//*)Sequence of innermost nodes in the book

+ W3C Documentation reference: innermost +
+ + + fn:has-children($arg as node()?) as xs:boolean +
+ Returns true if the specified node has one or more children, otherwise returns false
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:has-children(/book/chapter[1])true
fn:has-children(/book/chapter[1]/title)false

+ W3C Documentation reference: has-children +
+ + + fn:path($arg as node()?) as xs:string +
+ Returns a string that represents the path of the specified node within the XML + document
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:path(/book/chapter[1])/book/chapter[1]
fn:path(/book/chapter[2]/title)/book/chapter[2]/title

+ W3C Documentation reference: path +
+ + + fn:root($arg as node()?) as node()? +
+ Returns the root node of the tree that contains the specified node
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:root(/book/chapter)<book> element (root node)
fn:root(/book/chapter[1])<book> element (root node)

+ W3C Documentation reference: root +
+ + + fn:namespace-uri($srcval as node()?) as xs:anyURI +
+ Returns the namespace URI of the specified node
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:namespace-uri(/example:root)"http://www.example.com/ns"
fn:namespace-uri(/a/b)""

+ W3C Documentation reference: namespace-uri +
+ + + fn:local-name($srcval as node()?) as xs:string +
+ Returns the local part of the name of the specified node
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:local-name(/a/b)"b"
fn:local-name(/example:root)"root"

+ W3C Documentation reference: local-name +
+ + fn:name($node as node()?) as xs:string +
+ Returns the expanded QName of the specified node as a string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:name(/a/b)"b"
fn:name(/example:root)"example:root"

+ W3C Documentation reference: name +
+ W3C Documentation reference: Node-Name
- fn:last() -
- Returns the position of the last item in the current context sequence
- Arguments and return type: - - - - - - - - - -
TypeDescription
NoneReturns the position of the last item in the current context sequence
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
/library/fiction:book[position() = last()]Returns the last fiction:book element in the library
/library/fiction:book[last()]Returns the last fiction:book element in the library

- W3C Documentation reference: Last -
-
@@ -1024,6 +1264,125 @@
+ fn:unparsed-text-available($uri as xs:string?, $encoding as xs:string?) as xs:boolean +
+ Determines if an unparsed text resource identified by a URI can be read using the given + encoding
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the unparsed text resource
xs:string?The encoding to be used for reading the resource
xs:booleanIndicates if the resource can be read using the given encoding
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:unparsed-text-available("http://www.example.com/text.txt", "UTF-8")Returns true if the text resource identified by the specified URI can be + read using the specified encoding, otherwise false

+ W3C Documentation reference: unparsed-text-available +
+ + + fn:unparsed-text-lines($uri as xs:string?, $encoding as xs:string?) as xs:string* +
+ Returns the contents of an unparsed text resource identified by a URI, split into + lines
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the unparsed text resource
xs:string?The encoding to be used for reading the resource
xs:string*The lines of the unparsed text resource
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:unparsed-text-lines("http://www.example.com/text.txt", "UTF-8")Returns the lines of the text resource identified by the specified URI, + using the specified encoding

+ W3C Documentation reference: unparsed-text-lines +
+ + + fn:unparsed-text($uri as xs:string?, $encoding as xs:string?) as xs:string? +
+ Returns the contents of an unparsed text resource identified by a URI
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the unparsed text resource
xs:string?The encoding to be used for reading the resource
xs:string?The contents of the unparsed text resource
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:unparsed-text("http://www.example.com/text.txt", "UTF-8")Returns the contents of the text resource identified by the specified URI, + using the specified encoding

+ W3C Documentation reference: unparsed-text +
+ + fn:escape-html-uri($uri as xs:string?) as xs:string
@@ -2440,6 +2799,1077 @@
+ fn:fold-right($sourceSeq as item()*, $zero as item()*, $processingFunc as function(item(), item()*) as item()*) as item()* +
+ Applies a processing function cumulatively to the items of a sequence from right to + left, so as to reduce the sequence to a single value
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
item()*The initial value, also known as the zero value
function(item(), item()*)The processing function used to accumulate the items
item()*The resulting single value after applying the processing function
+ Examples:
+ + + + + + + + + +
ExpressionResult
fold-right((1, 2, 3, 4), 0, function($current, $accumulator) { $accumulator + - $current })Returns the result of subtracting each number in the input sequence from + right to left: -2

+ W3C Documentation reference: fold-right +
+ + + fn:fold-left($sourceSeq as item()*, $zero as item()*, $processingFunc as function(item()*, item()) as item()*) as item()* +
+ Applies a processing function cumulatively to the items of a sequence from left to + right, so as to reduce the sequence to a single value
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
item()*The initial value, also known as the zero value
function(item()*, item())The processing function used to accumulate the items
item()*The resulting single value after applying the processing function
+ Examples:
+ + + + + + + + + +
ExpressionResult
fold-left((1, 2, 3, 4), 0, function($accumulator, $current) { $accumulator + + $current })Returns the sum of the numbers in the input sequence: 10

+ W3C Documentation reference: fold-left +
+ + + + + fn:last() +
+ Returns the position of the last item in the current context sequence
+ Arguments and return type: + + + + + + + + + +
TypeDescription
NoneReturns the position of the last item in the current context sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
/library/fiction:book[position() = last()]Returns the last fiction:book element in the library
/library/fiction:book[last()]Returns the last fiction:book element in the library

+ W3C Documentation reference: Last +
+ + fn:position() as xs:integer +
+ Returns the context position of the context item in the sequence currently being + processed
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:integerThe position of the context item in the sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
<items><item>Item 1</item><item>Item + 2</item></items>/item[position()=2]Returns '<item>Item 2</item>'
<items><item>Item 1</item><item>Item + 2</item></items>/item[position()=1]Returns '<item>Item 1</item>'

+ W3C Documentation reference: position +
+ + + fn:collection($uri as xs:string?) as xs:anyAtomicType* +
+ Returns a sequence of documents in a collection identified by a URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the collection of documents
xs:anyAtomicType*A sequence of documents in the collection
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:collection("http://www.example.com/collection/")Returns a sequence of documents in the collection identified by the + specified URI
fn:collection()Returns a sequence of documents in the default collection, if one is defined +

+ W3C Documentation reference: collection +
+ + + fn:sum($seq as xs:anyAtomicType*, $zero as xs:anyAtomicType?) as xs:anyAtomicType? +
+ Returns the sum of a sequence of numeric values
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of numeric values
xs:anyAtomicType?Value to return if the sequence is empty (optional)
xs:anyAtomicType?Sum of the input sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:sum((10, 20, 30, 40, 50))150
fn:sum((), 0)0

+ W3C Documentation reference: sum +
+ + + fn:min($seq as xs:anyAtomicType*, $collation as xs:string) as xs:anyAtomicType? +
+ Returns the minimum value from a sequence of values
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of values
xs:stringCollation to use when comparing strings
xs:anyAtomicType?Minimum value in the input sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:min((10, 20, 30, 40, 50))10
fn:min(("apple", "banana", "cherry"), + "http://www.w3.org/2005/xpath-functions/collation/codepoint")"apple"
fn:min(())empty sequence

+ W3C Documentation reference: min +
+ + + fn:max($seq as xs:anyAtomicType*, $collation as xs:string) as xs:anyAtomicType? +
+ Returns the maximum value from a sequence of values
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of values
xs:stringCollation to use when comparing strings
xs:anyAtomicType?Maximum value in the input sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:max((10, 20, 30, 40, 50))50
fn:max(("apple", "banana", "cherry"), + "http://www.w3.org/2005/xpath-functions/collation/codepoint")"cherry"
fn:max(())empty sequence

+ W3C Documentation reference: max +
+ + + fn:avg($seq as xs:anyAtomicType*) as xs:anyAtomicType? +
+ Computes the average of the numeric values in the input sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of numeric values
xs:anyAtomicType?Average of the numeric values in the input sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:avg((10, 20, 30, 40, 50))30
fn:avg((2.5, 3.5, 4.5))3.5
fn:avg(())empty sequence

+ W3C Documentation reference: avg +
+ + + fn:count($seq as item()*) as xs:integer +
+ Returns the number of items in the input sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
xs:integerNumber of items in the input sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:count(('apple', 'banana', 'orange'))3
fn:count(())0
fn:count((1, 2, 3, 4, 5))5

+ W3C Documentation reference: count +
+ + + fn:exactly-one($srcval as item()*) as item() +
+ Returns the single item in the input sequence or raises an error if the sequence is + empty or contains more than one item
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()Single item from the input sequence, otherwise an error is raised
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:exactly-one(('apple'))'apple'
fn:exactly-one(('apple', 'banana'))Error (more than one item)
fn:exactly-one(())Error (empty sequence)

+ W3C Documentation reference: exactly-one +
+ + + fn:one-or-more($srcval as item()*) as item()+ +
+ Returns the input sequence if it contains one or more items, otherwise raises an + error
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()+Sequence containing one or more items, otherwise an error is raised
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:one-or-more(('apple', 'banana'))('apple', 'banana')
fn:one-or-more(('pear'))('pear')

+ W3C Documentation reference: one-or-more +
+ + + fn:zero-or-one($srcval as item()*) as item()? +
+ Returns the input sequence if it contains zero or one items, otherwise raises an + error
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()?Sequence containing zero or one item, otherwise an error is raised
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:zero-or-one(('apple'))('apple')
fn:zero-or-one(())()

+ W3C Documentation reference: zero-or-one +
+ + + fn:deep-equal($parameter1 as item()* , $parameter2 as item()*) as xs:boolean +
+ Returns true if the two input sequences are deep-equal, meaning that they have the same + structure and atomic values
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*First input sequence
item()*Second input sequence
xs:booleanTrue if the input sequences are deep-equal, otherwise false
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:deep-equal((1, 2, 3), (1, 2, 3))true
fn:deep-equal((1, 2, 3), (1, 2, 4))false

+ W3C Documentation reference: deep-equal +
+ + + fn:index-of($sequence as xs:anyAtomicType*, $search as xs:anyAtomicType) as xs:integer* +
+ Returns a sequence of integers indicating the positions of items in the input sequence + that are equal to the search item
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of atomic values
xs:anyAtomicTypeSearch item to find in the input sequence
xs:integer*Sequence of integers representing the positions of the search item in the + input sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:index-of((3, 1, 4, 1, 5, 9, 2, 2, 3), 1)(2, 4)
fn:index-of(('apple', 'banana', 'orange', 'apple', 'grape', 'orange'), + 'apple')(1, 4)

+ W3C Documentation reference: index-of +
+ + + fn:distinct-values($arg as xs:anyAtomicType*) as xs:anyAtomicType* +
+ Returns a sequence of distinct atomic values from the input sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*Input sequence of atomic values
xs:anyAtomicType*Distinct sequence of atomic values
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:distinct-values((3, 1, 4, 1, 5, 9, 2, 2, 3))(3, 1, 4, 5, 9, 2)
fn:distinct-values(('apple', 'banana', 'orange', 'apple', 'grape', + 'orange'))('apple', 'banana', 'orange', 'grape')

+ W3C Documentation reference: distinct-values +
+ + + fn:unordered($sourceSeq as item()*) as item()* +
+ Returns the items of a sequence in an implementation-dependent order
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()*Unordered sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:unordered((3, 1, 4, 1, 5, 9, 2))(1, 2, 3, 4, 5, 9, 1) (example result; actual order may vary)
fn:unordered(('apple', 'banana', 'orange', 'grape'))('banana', 'apple', 'orange', 'grape') (example result; actual order may + vary)

+ W3C Documentation reference: unordered +
+ + + fn:subsequence($sourceSeq as item()*, $startingLoc as xs:double, $length as xs:double) as item()* +
+ Returns a subsequence of a given sequence starting at a specified position with a + specified length
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
xs:doubleStarting position
xs:doubleLength of subsequence
item()*Subsequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:subsequence((1, 2, 3, 4, 5), 2, 3)(2, 3, 4)
fn:subsequence(('apple', 'banana', 'orange', 'grape'), 1, 2)('apple', 'banana')
fn:subsequence(('red', 'blue', 'green', 'yellow'), 3)('green', 'yellow')

+ W3C Documentation reference: subsequence +
+ + + fn:reverse($sequence as item()*) as item()* +
+ Reverses the order of items in a sequence
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Input sequence
item()*Reversed sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:reverse((1, 2, 3, 4))(4, 3, 2, 1)
fn:reverse(('apple', 'banana', 'orange'))('orange', 'banana', 'apple')
fn:reverse(('red', 'blue', 'green'))('green', 'blue', 'red')

+ W3C Documentation reference: reverse +
+ + + fn:remove($target as item()*, $position as xs:integer) as item()* +
+ Removes an item from a sequence at the specified position
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*Target sequence
xs:integerPosition of the item to remove
item()*New sequence with the item removed
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:remove((1, 2, 3, 4), 2)(1, 3, 4)
fn:remove(('apple', 'banana', 'orange'), 3)('apple', 'banana')
fn:remove((10, 20, 30), 1)(20, 30)

+ W3C Documentation reference: remove +
+ + + fn:insert-before($target as item()*, $position as xs:integer, $inserts as item()*) as item()* +
+ Inserts items from the specified sequence into another sequence at a given position
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*Target sequence
xs:integerPosition at which to insert the items
item()*Sequence of items to insert
item()*New sequence with items inserted
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:insert-before((1, 3, 4), 2, (2))(1, 2, 3, 4)
fn:insert-before(('apple', 'orange'), 1, ('banana'))('banana', 'apple', 'orange')
fn:insert-before((10, 20, 30), 4, (40))(10, 20, 30, 40)

+ W3C Documentation reference: insert-before +
+ + + fn:tail($seq as item()*) as item()* +
+ Returns all items of the input sequence except the first one, or an empty sequence if + the input is empty or contains only one item
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
item()*All items except the first one, or an empty sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:tail((1, 2, 3))(2, 3)
fn:tail((1))()
fn:tail(/books/book/author)All authors in the "books" element except the first one

+ W3C Documentation reference: tail +
+ + + fn:head($seq as item()*) as item()? +
+ Returns the first item of the input sequence, or an empty sequence if the input is + empty
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
item()?The first item of the sequence, or an empty sequence
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:head((1, 2, 3))1
fn:head(())()
fn:head(/books/book[1]/author)The first author of the first book in the "books" element

+ W3C Documentation reference: head +
+ + + fn:exists($seq as item()*) as xs:boolean +
+ Returns true if the input sequence is not empty, otherwise returns false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
xs:booleanResult of the test (true or false)
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:exists((1, 2, 3))true
fn:exists(())false
fn:exists(//chapter[5])true if there are at least 5 chapters, otherwise false

+ W3C Documentation reference: exists +
+ + + fn:empty($seq as item()*) as xs:boolean +
+ Returns true if the input sequence is empty, otherwise returns false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Sequence of items
xs:booleanResult of the test (true or false)
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:empty((1, 2, 3))false
fn:empty(())true
fn:empty(//chapter[100])true if there are less than 100 chapters, otherwise false

+ W3C Documentation reference: empty +
+ +
- + + + fn:implicit-timezone() as xs:dayTimeDuration +
+ Returns the implicit timezone as an xs:dayTimeDuration
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:dayTimeDurationThe implicit timezone as a dayTimeDuration
+ Examples:
+ + + + + + + + + +
ExpressionResult
implicit-timezone()Returns the implicit timezone as an xs:dayTimeDuration, e.g., '-PT7H' +

+ W3C Documentation reference: implicit-timezone +
+ + + fn:current-time() as xs:time +
+ Returns the current time with timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:timeThe current time with timezone
+ Examples:
+ + + + + + + + + +
ExpressionResult
current-time()Returns the current time with timezone, e.g., '13:45:30.123-07:00'

+ W3C Documentation reference: current-time +
+ + + fn:current-date() as xs:date +
+ Returns the current date with timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:dateThe current date with timezone
+ Examples:
+ + + + + + + + + +
ExpressionResult
current-date()Returns the current date with timezone, e.g., '2023-03-29-07:00'

+ W3C Documentation reference: current-date +
+ + + fn:current-dateTime() as xs:dateTime +
+ Returns the current date and time with timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:dateTimeThe current date and time with timezone
+ Examples:
+ + + + + + + + + +
ExpressionResult
current-dateTime()Returns the current date and time with timezone, e.g., + '2023-03-29T12:34:56.789-07:00'

+ W3C Documentation reference: current-dateTime +
+ + + fn:format-time($value as xs:time?, $picture as xs:string, $language as xs:string?, $calendar as xs:string?, $country as xs:string?) as xs:string? +
+ Formats a time value using the provided picture string and optional language, + calendar, and country settings
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:time?Time value
xs:stringPicture string
xs:string?Language
xs:string?Calendar
xs:string?Country
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:format-time(xs:time('14:30:15'), '[H01]:[m01]:[s01]')14:30:15
fn:format-time(xs:time('14:30:15'), '[h01] [P] [ZN,*-3]')02 PM UTC

+ W3C Documentation reference: Format-Time +
+ + + fn:format-date($value as xs:date?, $picture as xs:string, $language as xs:string?, $calendar as xs:string?, $country as xs:string?) as xs:string? +
+ Formats a date value using the provided picture string and optional language, + calendar, and country settings
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:date?Date value
xs:stringPicture string
xs:string?Language
xs:string?Calendar
xs:string?Country
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:format-date(xs:date('2023-04-01'), '[Y0001]-[M01]-[D01]')2023-04-01
fn:format-date(xs:date('2023-04-01'), '[MNn,*-3] [D], [Y]')Apr 1, 2023

+ W3C Documentation reference: Format-Date +
+ + + fn:format-dateTime($value as xs:dateTime?, $picture as xs:string, $language as xs:string?, $calendar as xs:string?, $country as xs:string?) as xs:string? +
+ Formats a dateTime value using the provided picture string and optional language, + calendar, and country settings
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
xs:stringPicture string
xs:string?Language
xs:string?Calendar
xs:string?Country
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:format-dateTime(xs:dateTime('2023-04-01T12:00:00'), + '[Y0001]-[M01]-[D01] [H01]:[m01]:[s01]')2023-04-01 12:00:00
fn:format-dateTime(xs:dateTime('2023-04-01T12:00:00'), '[MNn,*-3], [D], + [Y]')Apr, 1, 2023

+ W3C Documentation reference: Format-DateTime +
+ + + fn:adjust-time-to-timezone($arg as xs:time?, $timezone as xs:dayTimeDuration?) as xs:time? +
+ Adjusts the timezone of a time value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:time?Time value
xs:dayTimeDuration?Timezone adjustment
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:adjust-time-to-timezone(xs:time('10:00:00-07:00'), + xs:dayTimeDuration('PT2H'))12:00:00-05:00
fn:adjust-time-to-timezone(xs:time('10:00:00Z'), + xs:dayTimeDuration('-PT3H'))07:00:00-03:00

+ W3C Documentation reference: Adjust-Time-To-Timezone +
+ + + + + fn:adjust-date-to-timezone($arg as xs:date?, $timezone as xs:dayTimeDuration?) as xs:date? +
+ Adjusts the timezone of a date value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:date?Date value
xs:dayTimeDuration?Timezone adjustment
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:adjust-date-to-timezone(xs:date('2023-01-01-07:00'), + xs:dayTimeDuration('PT2H'))2023-01-01-05:00
fn:adjust-date-to-timezone(xs:date('2023-01-01Z'), + xs:dayTimeDuration('-PT3H'))2022-12-31-03:00

+ W3C Documentation reference: Adjust-Date-To-Timezone +
+ + + fn:adjust-dateTime-to-timezone($arg as xs:dateTime?, $timezone as xs:dayTimeDuration?) as xs:dateTime? +
+ Adjusts the timezone of a dateTime value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
xs:dayTimeDuration?Timezone adjustment
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:adjust-dateTime-to-timezone(xs:dateTime('2023-01-01T12:00:00-07:00'), + xs:dayTimeDuration('PT2H'))2023-01-01T17:00:00-05:00
fn:adjust-dateTime-to-timezone(xs:dateTime('2023-01-01T12:00:00Z'), + xs:dayTimeDuration('-PT3H'))2023-01-01T09:00:00-03:00

+ W3C Documentation reference: Adjust-DateTime-To-Timezone +
+ + + fn:timezone-from-time($arg as xs:time?) as xs:dayTimeDuration? +
+ Extracts the timezone component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:timezone-from-time(xs:time('12:00:00-07:00'))-PT7H
fn:timezone-from-time(xs:time('14:30:00+02:30'))PT2H30M

+ W3C Documentation reference: Timezone-From-Time +
+ + + fn:seconds-from-time($arg as xs:time?) as xs:decimal? +
+ Extracts the seconds component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:seconds-from-time(xs:time('21:45:30.5'))30.5
fn:seconds-from-time(xs:time('04:15:12.1'))12.1

+ W3C Documentation reference: Seconds-From-Time +
+ + + fn:minutes-from-time($arg as xs:time?) as xs:integer? +
+ Extracts the minutes component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:minutes-from-time(xs:time('21:45:30'))45
fn:minutes-from-time(xs:time('04:15:12'))15

+ W3C Documentation reference: Minutes-From-Time +
+ + + fn:hours-from-time($arg as xs:time?) as xs:integer? +
+ Extracts the hours component from an xs:time value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:hours-from-time(xs:time('21:45:30'))21
fn:hours-from-time(xs:time('04:15:12'))4

+ W3C Documentation reference: Hours-From-Time +
+ + + fn:timezone-from-date($arg as xs:date?) as xs:dayTimeDuration? +
+ Extracts the timezone component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:timezone-from-date(xs:date('2023-03-29+02:00'))PT2H
fn:timezone-from-date(xs:date('1980-12-15-05:00'))-PT5H

+ W3C Documentation reference: Timezone-From-Date +
+ + + fn:day-from-date($arg as xs:date?) as xs:integer? +
+ Extracts the day component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:day-from-date(xs:date('2023-03-29'))29
fn:day-from-date(xs:date('1980-12-15'))15

+ W3C Documentation reference: Day-From-Date +
+ + + fn:month-from-date($arg as xs:date?) as xs:integer? +
+ Extracts the month component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:month-from-date(xs:date('2023-03-29'))3
fn:month-from-date(xs:date('1980-12-15'))12

+ W3C Documentation reference: Month-From-Date +
+ + + fn:year-from-date($arg as xs:date?) as xs:integer? +
+ Extracts the year component from an xs:date value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?Date value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:year-from-date(xs:date('2023-03-29'))2023
fn:year-from-date(xs:date('1980-12-15'))1980

+ W3C Documentation reference: Year-From-Date +
+ + + fn:timezone-from-dateTime($arg as xs:dateTime?) as xs:dayTimeDuration? +
+ Extracts the timezone component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:timezone-from-dateTime(xs:dateTime('2023-03-29T12:30:45-07:00'))-PT7H
fn:timezone-from-dateTime(xs:dateTime('2023-12-15T18:45:30+03:30'))PT3H30M

+ W3C Documentation reference: Timezone-From-DateTime +
+ + + fn:seconds-from-dateTime($arg as xs:dateTime?) as xs:decimal? +
+ Extracts the seconds component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:seconds-from-dateTime(xs:dateTime('2023-03-29T12:30:45'))45
fn:seconds-from-dateTime(xs:dateTime('2023-12-15T18:45:30.5-08:00')) + 30.5

+ W3C Documentation reference: Seconds-From-DateTime +
+ + + fn:minutes-from-dateTime($arg as xs:dateTime?) as xs:integer? +
+ Extracts the minutes component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:minutes-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))30
fn:minutes-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))45

+ W3C Documentation reference: Minutes-From-DateTime +
+ + + fn:hours-from-dateTime($arg as xs:dateTime?) as xs:integer? +
+ Extracts the hours component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:hours-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))12
fn:hours-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))18

+ W3C Documentation reference: Hours-From-DateTime +
+ + + fn:day-from-dateTime($arg as xs:dateTime?) as xs:integer? +
+ Extracts the day component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:day-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))29
fn:day-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))15

+ W3C Documentation reference: Day-From-DateTime +
+ + + fn:month-from-dateTime($arg as xs:dateTime?) as xs:integer? +
+ Extracts the month component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:month-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))3
fn:month-from-dateTime(xs:dateTime('2023-12-15T18:45:00-08:00'))12

+ W3C Documentation reference: Month-From-DateTime +
+ + + fn:year-from-dateTime($arg as xs:dateTime?) as xs:integer? +
+ Extracts the year component from an xs:dateTime value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?DateTime value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:year-from-dateTime(xs:dateTime('2023-03-29T12:30:00'))2023
fn:year-from-dateTime(xs:dateTime('2023-03-29T12:30:00-08:00'))2023

+ W3C Documentation reference: Year-From-DateTime +
+ + + fn:dateTime($arg1 as xs:date?, $arg2 as xs:time?) as xs:dateTime? @@ -2867,6 +5225,912 @@
+ fn:function-arity($function as function(*)) as xs:integer +
+ Returns the arity (number of arguments) of the specified function
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
function(*)The function to obtain the arity for
xs:integerThe arity (number of arguments) of the specified function
+ Examples:
+ + + + + + + + + +
ExpressionResult
function-arity(fn:substring)Returns the arity of the substring function: 2 (since + substring accepts two required arguments: the input string and the + starting index)

+ W3C Documentation reference: function-arity +
+ + + fn:function-name($function as function(*)) as xs:QName? +
+ Returns the QName of the specified function
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
function(*)The function to obtain the QName for
xs:QName?The QName of the specified function, or an empty sequence if the + function is anonymous
+ Examples:
+ + + + + + + + + +
ExpressionResult
function-name(fn:substring)Returns the QName of the substring function: + QName("http://www.w3.org/2005/xpath-functions", "substring") +

+ W3C Documentation reference: function-name +
+ + + fn:function-lookup($functionName as xs:QName, $arity as xs:integer) as function(*)? +
+ Returns a function with the specified QName and arity if available, otherwise + returns an empty sequence
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:QNameFunction name as QName
xs:integerArity of the function
function(*)?A function with the specified QName and arity if available, otherwise an + empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
function-lookup(QName('http://www.w3.org/2005/xpath-functions', + 'substring'), 2)Returns the substring function with arity 2, if available

+ W3C Documentation reference: function-lookup +
+ + + fn:static-base-uri() as xs:anyURI? +
+ Returns the static base URI as an xs:anyURI, if available
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:anyURI?The static base URI, if available; otherwise, an empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
static-base-uri()Returns the static base URI as an xs:anyURI, if available, e.g., + 'https://www.example.com/base/'

+ W3C Documentation reference: static-base-uri +
+ + + fn:default-collation() as xs:string +
+ Returns the default collation URI as an xs:string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneFunction takes no arguments
xs:stringThe default collation URI as a string
+ Examples:
+ + + + + + + + + +
ExpressionResult
default-collation()Returns the default collation URI as an xs:string, e.g., + 'http://www.w3.org/2005/xpath-functions/collation/codepoint'

+ W3C Documentation reference: default-collation +
+ + + fn:serialize($node as item()?, $options as item()?) as xs:string? +
+ Serializes an XML node, producing a string representation of the node
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()?An XML node to serialize
item()?Serialization options as a map, with key-value pairs defining the + serialization parameters (optional)
xs:string?A string representation of the serialized XML node or an empty sequence + if the input is an empty sequence
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:serialize(<item>Item 1</item>)Returns '<item>Item 1</item>'
fn:serialize(<item>Item 1</item>, map{'method': 'xml', 'indent': + 'yes'})Returns an indented XML string representation of the input node

+ W3C Documentation reference: serialize +
+ + + fn:parse-xml-fragment($srcval as xs:string?) as document-node(element(*))? +
+ Parses a string containing an XML fragment and returns a corresponding document + node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?A string containing an XML fragment
document-node(element(*))?A document node containing the parsed XML fragment or an empty sequence + if the input is an empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:parse-xml-fragment('<item>Item 1</item><item>Item + 2</item>')Returns a document node containing the parsed XML fragment

+ W3C Documentation reference: parse-xml-fragment +
+ + + fn:parse-xml($srcval as xs:string?) as document-node(element(*))? +
+ Parses a string containing an XML document and returns a corresponding document + node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?A string containing an XML document
document-node(element(*))?A document node containing the parsed XML content or an empty sequence + if the input is an empty sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:parse-xml('<root><item>Item 1</item></root>')Returns a document node containing the parsed XML content

+ W3C Documentation reference: parse-xml +
+ + + fn:available-environment-variables() as xs:string* +
+ Retrieves a sequence of the names of all available environment variables
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
NoneNo argument is required
xs:string*A sequence of the names of all available environment variables
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:available-environment-variables()Returns a sequence of the names of all available environment variables +

+ W3C Documentation reference: available-environment-variables +
+ + + fn:environment-variable($name as xs:string) as xs:string? +
+ Retrieves the value of an environment variable
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:stringThe name of the environment variable
xs:string?The value of the environment variable, or an empty sequence if the + variable is not set
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:environment-variable("PATH")Returns the value of the PATH environment variable, or an empty sequence + if the variable is not set

+ W3C Documentation reference: environment-variable +
+ + + fn:uri-collection($uri as xs:string?) as xs:anyURI* +
+ Returns a sequence of URIs in a collection identified by a URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI identifying the collection of URIs
xs:anyURI*A sequence of URIs in the collection
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:uri-collection("http://www.example.com/collection/")Returns a sequence of URIs in the collection identified by the specified + URI +
fn:uri-collection()Returns a sequence of URIs in the default collection, if one is defined +

+ W3C Documentation reference: uri-collection +
+ + fn:doc-available($uri as xs:string?) as xs:boolean +
+ Tests whether an XML document is available at a given URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI of the XML document to be tested
xs:booleanTrue if the XML document is available, otherwise false
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:doc-available("http://www.example.com/books.xml")Returns true if the XML document located at the specified URI is + available, otherwise false
fn:doc-available("")Returns true if the XML document containing the context item is + available, otherwise false

+ W3C Documentation reference: doc-available +
+ + + fn:doc($uri as xs:string?) as document-node()? +
+ Loads an XML document from a URI and returns the document node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI of the XML document to be loaded
document-node()?The document node of the loaded XML document
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:doc("http://www.example.com/books.xml")Loads the XML document located at the specified URI and returns its + document node
fn:doc("")Returns the document node of the XML document containing the context + item

+ W3C Documentation reference: doc +
+ + + fn:generate-id($node as node()?) as xs:string +
+ Returns a unique identifier for the specified node
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
node()?Input node for which the unique identifier is to be generated
xs:stringUnique identifier for the specified node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:generate-id(/bookstore/book[1])A unique identifier for the first <book> element in the + <bookstore>
fn:generate-id(.)A unique identifier for the context node

+ W3C Documentation reference: generate-id +
+ + + fn:idref($arg as xs:string*) as node()* +
+ Returns a sequence of nodes that are referenced by the specified IDREF attribute + values
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*Input sequence of IDREF attribute values
node()*Sequence of nodes referenced by the specified IDREF attribute values +
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:idref("reference42")Nodes referenced by the IDREF attribute value "reference42"
fn:idref(("ref1", "ref2", "ref3"))Nodes referenced by the IDREF attribute values "ref1", "ref2", and + "ref3"

+ W3C Documentation reference: idref +
+ + + fn:id($arg as xs:string*) as element()* +
+ Returns a sequence of elements with the specified ID attribute values
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*Input sequence of ID attribute values
element()*Sequence of elements with the specified ID attribute values
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:id("item42")Element with the ID attribute value "item42"
fn:id(("item1", "item2", "item3"))Elements with the ID attribute values "item1", "item2", and "item3"

+ W3C Documentation reference: id +
+ + + fn:lang($testlang as xs:string, $node as node()?) as xs:boolean +
+ Returns true if the language of the specified node or its nearest ancestor matches + the given language code
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:stringLanguage code to test
node()?Optional node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:lang("en", /book/title)true
fn:lang("fr", /book/title)false

+ W3C Documentation reference: lang +
+ + + + fn:in-scope-prefixes($element as element()) as xs:string* +
+ Returns a sequence of strings representing the prefixes of the in-scope namespaces + for the specified element
+ Arguments and return type: + + + + + + + + + +
TypeDescription
element()Element node
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:in-scope-prefixes(/*)("xml", "x")

+ W3C Documentation reference: in-scope-prefixes +
+ + + fn:namespace-uri-for-prefix($prefix as xs:string?, $element as element()) as xs:anyURI? +
+ Returns the namespace URI associated with the given prefix, using the in-scope + namespaces for the specified element
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Prefix
element()Element node
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:namespace-uri-for-prefix('x', /*)"http://www.example.com/ns"
fn:namespace-uri-for-prefix('', /*)""

+ W3C Documentation reference: namespace-uri-for-prefix +
+ + + fn:namespace-uri-from-QName($arg as xs:QName?) as xs:anyURI? +
+ Returns the namespace URI of the given QName value, or an empty sequence if there's + no namespace URI
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:QName?QName value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:namespace-uri-from-QName(fn:QName('http://www.example.com/ns', + 'x:local'))"http://www.example.com/ns"
fn:namespace-uri-from-QName(fn:QName('', 'local'))""

+ W3C Documentation reference: namespace-uri-from-QName +
+ + + fn:local-name-from-QName($arg as xs:QName?) as xs:NCName? +
+ Returns the local name of the given QName value, or an empty sequence if there's no + local name
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:QName?QName value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:local-name-from-QName(fn:QName('http://www.example.com/ns', + 'x:local'))"local"
fn:local-name-from-QName(fn:QName('', 'local'))"local"

+ W3C Documentation reference: local-name-from-QName +
+ + + fn:prefix-from-QName($arg as xs:QName?) as xs:NCName? +
+ Returns the prefix of the given QName value, or an empty sequence if there's no + prefix
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:QName?QName value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:prefix-from-QName(fn:QName('http://www.example.com/ns', 'x:local')) + "x"
fn:prefix-from-QName(fn:QName('', 'local'))()

+ W3C Documentation reference: prefix-from-QName +
+ + + fn:QName($paramURI as xs:string?, $paramQName as xs:string) as xs:QName +
+ Constructs an xs:QName value from a namespace URI and a lexical QName
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Namespace URI
xs:stringLexical QName
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:QName('http://www.example.com/ns', 'x:local')QName("http://www.example.com/ns", "x:local")
fn:QName('', 'local')QName("", "local")

+ W3C Documentation reference: QName +
+ + + fn:resolve-QName($qname as xs:string?, $element as element()) as xs:QName? +
+ Resolves a QName by expanding a prefix using the in-scope namespaces of a given + element
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?QName to resolve
element()Element with in-scope namespaces
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:resolve-QName('x:local', $element)QName("http://www.example.com/ns", "local")
fn:resolve-QName('local', $element)QName("", "local")

+ W3C Documentation reference: Resolve-QName +
+ + fn:nilled(node) @@ -2892,15 +6156,134 @@
fn:for-each(sequence*, function) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:for-each-pair($sourceSeq1 as item()*, $sourceSeq2 as item()*, $processingFunc as function(item(), item()) as item()*) as item()*
- Applies function item to every element in sequence
-
- W3C Documentation reference: #func-for-each + Applies a processing function to pairs of items from two input sequences in a + pairwise fashion, resulting in a sequence of the same length as the shorter input + sequence
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The first input sequence of items
item()*The second input sequence of items
function(item(), item())The processing function used to process pairs of items from the input + sequences
item()*The resulting sequence after applying the processing function to pairs + of items
+ Examples:
+ + + + + + + + + +
ExpressionResult
for-each-pair((1, 2, 3), ("a", "b"), function($item1, $item2) { + concat($item1, $item2) })Returns a sequence with the concatenated pairs of items: + ("1a", "2b")

+ W3C Documentation reference: for-each-pair
+ + fn:filter($sourceSeq as item()*, $predicate as function(item()) as xs:boolean) as item()* +
+ Filters a sequence of items based on a given predicate function
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
function(item())The predicate function used to filter the items
item()*The resulting sequence after applying the predicate function
+ Examples:
+ + + + + + + + + +
ExpressionResult
filter((1, 2, 3, 4), function($x) { $x mod 2 = 0 })Returns a new sequence containing only the even numbers from the input + sequence: (2, 4)

+ W3C Documentation reference: filter +
+ + + fn:for-each($sourceSeq as item()*, $action as function(item()) as item()*) as item()* +
+ Applies a specified function to each item in a sequence, returning a new + sequence
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*The input sequence of items
function(item())The function to apply to each item in the sequence
item()*The new sequence created by applying the function to each item in the + input sequence
+ Examples:
+ + + + + + + + + +
ExpressionResult
for-each((1, 2, 3, 4), function($x) { $x * 2 })Returns a new sequence with the result of doubling each number in the + input sequence: (2, 4, 6, 8)

+ W3C Documentation reference: for-each +
+