From 0e9a87bfe782d3f14ca5defafd00aac59c8255c9 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 29 Mar 2023 08:49:43 +0200 Subject: [PATCH 01/59] Prepared templates for new XPath tooltips (#133) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/133 --- Frontend/tools/xpath.html | 3730 +++++++------------------------------ 1 file changed, 659 insertions(+), 3071 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 56db7a2..a7e30d1 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -111,248 +111,214 @@ - -
- - - -
- - - [1.0] fn:last() + +
+ + +
-
- Returns the position of the last node in the context list
-
- W3C Documentation reference: Node-Set-Functions + fn:position() +
+ Returns the position of the current context node
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + fn:count(node-set) +
+ Returns the number of nodes in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setNode-set to count nodes in
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:id(object) +
+ Returns the element specified by it's unique id, requires DTD
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:local-name(node-set) +
+ Returns the local-name for the first node in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setExtract first node and return its local name
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:local-name() +
+ Returns the local-name for the context node
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:namespace-uri(node-set) +
+ Returns the namespace-uri for the first node in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
+ + + + + + + + + +
ExpressionResult
namespace-uri(//b:book)http://www.book.com

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:namespace-uri() +
+ Returns the namespace-uri for the context node
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:name(node-set) +
+ Returns the name for the first node in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setExtract first node and return QName
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:name() +
+ Returns the name for the context node
+ Examples:
+ + + + + + + + + +
ExpressionResult
current context nodeExtract first node and return QName

+ W3C Documentation reference: Node-Set-Functions
- - - [1.0] fn:position() -
-
- Returns the position of the current context node
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:count(node-set) -
-
- Returns the number of nodes in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setNode-set to count nodes in
Examples:
- - - - - - - - - - - - - -
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:id(object) -
-
- Returns the element specified by it's unique id, requires DTD
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:local-name(node-set) -
-
- Returns the local-name for the first node in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setExtract first node and return its local name
Examples:
- - - - - - - - - - - - - -
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:local-name() -
-
- Returns the local-name for the context node
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:namespace-uri(node-set) -
-
- Returns the namespace-uri for the first node in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
- - - - - - - - - -
ExpressionResult
namespace-uri(//b:book)http://www.book.com

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:namespace-uri() -
-
- Returns the namespace-uri for the context node
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:name(node-set) -
-
- Returns the name for the first node in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setExtract first node and return QName
Examples:
- - - - - - - - - - - - - -
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:name() -
-
- Returns the name for the context node
- Examples:
- - - - - - - - - -
ExpressionResult
current context nodeExtract first node and return QName

- W3C Documentation reference: Node-Set-Functions -
-
- - - +
-
-
+ +
- [1.0] fn:boolean(object)
-
The boolean function converts its argument to a boolean as follows:
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • @@ -387,47 +353,39 @@
    W3C Documentation reference: Boolean-Functions -
- [1.0] fn:not()
-
The not function returns true if its argument is false, and false otherwise.

W3C Documentation reference: Boolean-Functions -
- [1.0] fn:true()
-
The true function returns true.

W3C Documentation reference: Boolean-Functions -
- [1.0] fn:false()
-
The true function returns false.

W3C Documentation reference: Boolean-Functions -
- [1.0] fn:lang(string)
-
The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
Arguments and return type: @@ -442,568 +400,51 @@
Examples: Look W3C documentation

W3C Documentation reference: Boolean-Functions -
-
-
- - - -
+
+ - - [1.0] fn:string(object) -
-
- Returns the string representation of the object argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringThe object to convert to a string
Examples:
- - - - - - - - - - - - - -
ExpressionResult
string((1<0))false
string(.11)0.11

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:string() -
-
- Returns a string value representation of the context node
-
- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:concat(string, string, string*) -
-
- Returns the concatenation of its arguments
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringString to be merged
stringString to be merged
string*any number of strings
Examples:
- - - - - - - - - - - - - -
ExpressionResult
concat("aa","bb")aabb
concat("aa", 123)aa123

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:starts-with(string, string) -
-
- Returns true if the first string starts with the second string
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be found
Examples:
- - - - - - - - - - - - - -
ExpressionResult
starts-with("aabb", "aa")true
starts-with("aabb", "cc")false

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:contains(string, string) -
-
- Returns true if the first string contains the second string
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be found
Examples:
- - - - - - - - - - - - - -
ExpressionResult
contains("abc", "c")true
contains("abc", "1")false

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring-before(string, string) -
-
- Returns the substring found before the first occurrence of the second argument
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be used to split
Examples:
- - - - - - - - - - - - - -
ExpressionResult
substring-before("aabbcc","bb")aa
substring-before("aabbcc","c")aabb

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring-after(string, string) -
-
- Returns the substring found after the first occurrence of the second argument
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be used to split
Examples:
- - - - - - - - - - - - - -
ExpressionResult
substring-after("aabbcc","bb")cc
substring-after("aabbcc","a")abbcc

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring(string, number, number) -
-
- Returns the substring starting at second argument with lenght of third argument
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringString to be cut
integerStarting position
integerLength of the substring
Examples:
- - - - - - - - - -
ExpressionResult
substring("aabbcc", 1, 2)aa

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring(string, number) -
-
- Returns the substring of the first argument from the position specified by the second - argument
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be cut
integerStarting position
Examples:
- - - - - - - - - -
ExpressionResult
substring("aabbcc", 3)bbcc

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:string-length(string) -
-
- Returns the length of the string specified by the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringString of which length should be returned
Examples:
- - - - - - - - - - - - - -
ExpressionResult
string-length("aabbcc")6
string-length("aa bb cc")8

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:string-length() -
-
- Returns the length of the string specified by the context node
-
- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:normalize-space(string) -
-
- Returns a white-space normalized string
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringString to be normalized
Examples:
- - - - - - - - - - - - - -
ExpressionResult
normalize-space("aa bb cc")aa bb cc
normalize-space("aa bb cc")aa bb cc

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:normalize-space() -
-
- Returns a white-space normalized string specified by the context-node
-
- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:translate(string, string, string) -
-
- Replaces characters specified by the second argument using those from the third argument -
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringString to be edited
stringsequence of characters to be replaced
stringsequence of character to be used in replacement
Examples:
- - - - - - - - - - - - - -
ExpressionResult
translate("aabbcc", "ab","xz")xxzzcc
translate("Test sequence", "e","z")Tzst szquzncz

- W3C Documentation reference: String-Functions -
-
- - - - [2.0] fn:string-join((string,string,...),sep) -
-
- Returns a string created by concatenating the string arguments and using the sep - argument as the separator
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
string*string sequence to be joined
stringseparator to be used
Examples:
- - - - - - - - - - - - - -
ExpressionResult
string-join(('fox', 'jumps', 'over', 'dog'), ' ')' fox jumps over dog '
string-join(('fox', 'jumps', 'over', 'dog'))'joxjumpsoverdog'

- W3C Documentation reference: #func-string-join -
-
+ +
+ + - - - [3.0] fn:string-to-codepoints(string) +
+ + + fn:last()
-
- Returns sequence of unicode codepoint representing the provided string
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringstring to be coverted to list of unicode values
Examples:
- - - - - - - - - -
ExpressionResult
string-to-codepoints("test")(116, 101, 115, 116)

- W3C Documentation reference: #func-string-to-codepoints -
+ Returns the position of the last node in the context list
+
+ W3C Documentation reference: Node-Set-Functions
+ + + +
+
+
+ + - - - [2.0] fn:compare(comp1,comp2) +
+ + + fn:boolean(object)
-
- Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 - is greater than comp2 (according to the rules of the collation that is used)
+ The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • +
+ Arguments and return type: @@ -1011,12 +452,8 @@ - - - - - - + +
Description
stringfirst parameter to be compared
stringsecond parameter to be comparedobjectThe object to convert to a boolean
Examples:
@@ -1025,541 +462,123 @@ - - - - - - - - - - - - - - - -
Result
compare('abc', 'abc')0
compare('abc', 'abd')-1
compare('abc1', 'abd')-1
compare("abc1","abc")1

- W3C Documentation reference: #func-compare -
-
- - - - [2.0] fn:compare(comp1,comp2,collation) -
-
- Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 - is greater than comp2 (according to the rules of the collation that is used)
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringfirst parameter to be compared
stringsecond parameter to be compared
stringcollation to be used in comparison(letter weight may differ between - languages)
Examples:
- - - - - - - - - -
ExpressionResult
compare('ghi', 'ghi')0

- W3C Documentation reference: #func-compare -
-
-
- - - [2.0] fn:codepoints-to-string((int,int,...)) -
-
- Creates a string from a sequence of the Unicode Standard code points
- Arguments and return type: - - - - - - - - - -
TypeDescription
int*int sequence to be converted to string
Examples:
- - - - - - - - - -
ExpressionResult
codepoints-to-string((116, 101, 115, 116))'test'

- W3C Documentation reference: #func-codepoints-to-string -
-
-
- - - [2.0] fn:codepoint-equal(comp1,comp2) -
-
- Returns true if the value of comp1 is equal to the value of comp2, according to the - Unicode code point collation - (http://www.w3.org/2005/02/xpath-functions/collation/codepoint), otherwise it - returns false
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
intunicode codepoint
intunicode codepoint
Examples:
- - - - - - - + - - - - - - - -
ExpressionResult
codepoint-equal(111, 111)boolean("Release11") true
codepoint-equal(111, 112)false
codepoint-equal("111F", "111F")true

- W3C Documentation reference: #func-codepoint-equal -
-
-
- - - [2.0] fn:normalize-unicode() -
-
- NONE
-
- W3C Documentation reference: #func-normalize-unicode -
-
-
- - - [2.0] fn:upper-case(string) -
-
- Converts the string argument to upper-case
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringstring to be converted to upper case
Examples:
- - - - - - - - - -
ExpressionResult
upper-case('aabbCC')'AABBCC'

- W3C Documentation reference: #func-upper-case -
-
-
- - - [2.0] fn:lower-case(string) -
-
- Converts the string argument to lower-case
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringstring to be converted to upper case
Examples:
- - - - - - - - - -
ExpressionResult
lower-case('aabbCC')'aabbcc'

- W3C Documentation reference: #func-lower-case -
-
-
- - - [2.0] fn:escape-uri(stringURI,esc-res) -
-
- https://www.w3.org/TR/xpath-functions/#func-escape-uri
-
- W3C Documentation reference: #func-escape-uri -
-
-
- - - [2.0] fn:tokenize(string,pattern) -
-
- https://www.w3.org/TR/xpath-functions/#func-tokenize
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringstring to be tokenized
stringstring to be used to split the first argument
Examples:
- - - - - - - - - -
ExpressionResult
tokenize("fox jumps over dog", "s+")("fox", "jumps", "over", "dog")

- W3C Documentation reference: #func-tokenize -
-
-
- - - [2.0] fn:matches(string,pattern) -
-
- Returns true if the string argument matches the pattern, otherwise, it returns false -
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringstring to search in
stringpattern to be found
Examples:
- - - - - - - - - - - +
ExpressionResult
matches("Xpath", "pat")true
matches("Xpath", "abc")boolean("") false

- W3C Documentation reference: #func-matches -
+ W3C Documentation reference: Boolean-Functions
-
- - - [2.0] fn:replace(string,pattern,replace) -
-
- Returns a string that is created by replacing the given pattern with the replace - argument
-
- W3C Documentation reference: #func-replace -
-
-
- - - [2.0] fn:ends-with(string1,string2) -
-
- Returns true if string1 ends with string2, otherwise it returns false
-
- W3C Documentation reference: #func-ends-with -
-
-
- - + + + +
-
-
- - - -
- - - [1.0] fn:number(object) +
+ + +
-
- The number function converts its argument to a number as follows: -
    -
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • -
  • boolean true is converted to 1; boolean false is converted to 0
  • -
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • -
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a number
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Numeric-Functions + + + fn:string(object) +
+ Returns the string representation of the object argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference: String-Functions
+ + +
- - - - [1.0] fn:sum(node-set) -
-
- The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
-
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setSet of nodes whose values will be summed.
- Examples:
- - - - - - - - - -
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

- W3C Documentation reference: Numeric-Functions -
-
- - - [1.0] fn:floor(number) -
-
- The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
-
- Arguments and return type: - - - - - - - - - -
TypeDescription
numberNumber to convert
- Examples:
- - - - - - - - - -
ExpressionResult
floor(2.55)2
- W3C Documentation reference: Numeric-Functions -
-
- - - [1.0] fn:ceiling(number) -
-
- The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
-
- Arguments and return type: - - - - - - - - - -
TypeDescription
numberNumber to convert
- Examples:
- - - - - - - - - -
ExpressionResult
ceiling(2.55)3
- W3C Documentation reference: Numeric-Functions -
-
- - [1.0] fn:round(number) -
-
- The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned.
- - NOTE: For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
- Arguments and return type: - - - - - - - - - -
TypeDescription
numberNumber to convert
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
round(2.55)3
round(2.35)2

- W3C Documentation reference: Numeric-Functions -
-
- -
-
-
- - - -
- +
+ + + +
+ + + fn:number(object) +
+ The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • +
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
boolean("Release11")true
boolean("")false

+ W3C Documentation reference: Numeric-Functions +
+ + +
+
+
- [2.0] Collections + +
+ + fn:avg((arg,arg,...))
-
Returns the average of the argument values
Arguments and return type: @@ -1583,441 +602,129 @@

W3C Documentation reference: #func-avg -
- - - - [2.0] fn:exactly-one(item,item,...) -
-
- Returns the argument if it contains exactly one item, otherwise it raises an error -
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequencesequence to check
Examples:
- - - - - - - - - - - - - -
ExpressionResult
exactly-one((1))1
exactly-one((1,1))fn:exactly-one called with a sequence containing zero or more than one - item.

- W3C Documentation reference: #func-exactly-one -
-
-
- - - [2.0] fn:zero-or-one(item,item,...) -
-
- Returns the argument if it contains zero or one items, otherwise it raises an error -
-
- W3C Documentation reference: #func-zero-or-one -
-
-
- - - [2.0] fn:index-of((item,item,...),searchitem) -
-
- Returns the positions within the sequence of items that are equal to the searchitem - argument
-
- W3C Documentation reference: #func-index-of -
-
-
- - - [2.0] fn:reverse((item,item,...)) -
-
- Returns the reversed order of the items specified
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence of elements to have its order reversed
Examples:
- - - - - - - - - - - - - -
ExpressionResult
reverse(("ab", "cd", "ef"))("ef", "cd", "ab")
reverse(("ab"))("ab")

- W3C Documentation reference: #func-reverse -
-
-
- - - [2.0] fn:one-or-more(item,item,...) -
-
- Returns the argument if it contains one or more items, otherwise it raises an error -
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequencesequence to check
Examples:
- - - - - - - - - - - - - -
ExpressionResult
one-or-more((1, 2, 3))1 2 3
one-or-more()An empty sequence is not allowed as the first argument of - fn:one-or-more()

- W3C Documentation reference: #func-one-or-more -
-
-
- - - [2.0] fn:distinct-values((item,item,...),collation) -
-
- Returns only distinct (different) values
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequencesequence to extract distinct values from
Examples:
- - - - - - - - - -
ExpressionResult
distinct-values((1, 2, 3, 1, 2))(1, 2, 3)

- W3C Documentation reference: #func-distinct-values -
-
-
- - - [2.0] fn:exists(item,item,...) -
-
- Returns true if the value of the arguments IS NOT an empty sequence, otherwise it - returns false
-
- W3C Documentation reference: #func-exists -
-
-
- - - [2.0] fn:subsequence((item,item,...),start,len) -
-
- Returns a sequence of items from the position specified by the start argument and - continuing for the number of items specified by the len argument. The first item is - located at position 1
-
- W3C Documentation reference: #func-subsequence -
-
-
- - - [2.0] fn:empty(item,item,...) -
-
- Returns true if the value of the arguments IS an empty sequence, otherwise it - returns false
-
- W3C Documentation reference: #func-empty -
-
-
- - - [2.0] fn:insert-before((item,item,...),pos,inserts) -
-
- Returns a new sequence constructed from the value of the item arguments
-
- W3C Documentation reference: #func-insert-before -
-
-
- - - [2.0] fn:remove((item,item,...),position) -
-
- Returns a new sequence constructed from the value of the item arguments
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
sequence*sequence to be modified
integerposition to insert element from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
remove(("a","b","c"), 1)b c
remove(("a","b","c"), 0)a b c

- W3C Documentation reference: #func-remove -
-
-
- - - [2.0] fn:unordered((item,item,...)) -
-
- Returns the items in an implementation dependent order
-
- W3C Documentation reference: #func-unordered -
-
-
- - - [2.0] fn:data(item.item,...) -
-
- Takes a sequence of items and returns a sequence of atomic values
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence to be split to atomic values
Examples:
- - - - - - - - - -
ExpressionResult
data((1,2,23, "test"))1 2 23 test

- W3C Documentation reference: #func-data -
-
-
- - - [2.0] fn:collection() -
-
- NONE
-
- W3C Documentation reference: #func-collection -
-
-
- - - [2.0] fn:collection(string) -
-
- NONE
-
- W3C Documentation reference: #func-collection -
-
-
- - - [2.0] fn:min((arg,arg,...)) -
-
- Returns the argument that is less than the others
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence to select minimum from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
min((1,2,3))1
min(('a', 'k'))'a'

- W3C Documentation reference: #func-min -
-
-
- - - [2.0] fn:max((arg,arg,...)) -
-
- Returns the argument that is greater than the others
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence to select maximum from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
max((1,2,3))3
max(('a', 'k'))'k'

- W3C Documentation reference: #func-max -
-
-
- - - [2.0] fn:deep-equal(param1,param2,collation) -
-
- Returns true if param1 and param2 are deep-equal to each other, otherwise it returns - false
-
- W3C Documentation reference: #func-deep-equal -
-
-
- - +
-
-
- - - -
+
- [2.0] fn:adjust-date-to-timezone(date,timezone) + + +
+ + fn:adjust-date-to-timezone(date,timezone) +
+ If the timezone argument is empty, it returns a date without a timezone. Otherwise, + it returns a date with a timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
datedate to be adjusted
timezonetimezone to be imposed into date
Examples:
+ + + + + + + + + +
ExpressionResult
adjust-date-to-timezone(xs:date('2011-11-15'), + xs:dayTimeDuration("PT10H"))2011-11-15+10:00

+ W3C Documentation reference: #func-adjust-date-to-timezone +
+ + +
+
+
+ + + +
+ + fn:error() +
+ https://www.w3.org/TR/xpath-functions/#func-error
+
+ W3C Documentation reference: #func-error +
+ + +
+
+
+ + + +
+ + + fn:nilled(node) +
+ + Returns a Boolean value indicating whether the argument node is nilled
+
+ W3C Documentation reference: #func-nilled +
+ + +
+
+ + + +
+ + + +
+ + + fn:last()
-
- If the timezone argument is empty, it returns a date without a timezone. Otherwise, - it returns a date with a timezone
+ Returns the position of the last node in the context list
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + +
+
+
+ + + +
+ + + fn:boolean(object) +
+ The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • +
+ Arguments and return type: @@ -2025,12 +732,8 @@ - - - - - - + +
Description
datedate to be adjusted
timezonetimezone to be imposed into dateobjectThe object to convert to a boolean
Examples:
@@ -2039,35 +742,91 @@ - - + + + + + +
Result
adjust-date-to-timezone(xs:date('2011-11-15'), - xs:dayTimeDuration("PT10H"))2011-11-15+10:00boolean("Release11")true
boolean("")false

- W3C Documentation reference: #func-adjust-date-to-timezone -
+ W3C Documentation reference: Boolean-Functions
+ + +
+
+
+ + - - - [2.0] fn:adjust-time-to-timezone(time,timezone) +
+ + + fn:string(object)
-
- If the timezone argument is empty, it returns a time without a timezone. Otherwise, - it returns a time with a timezone
-
- W3C Documentation reference: #func-adjust-time-to-timezone -
+ Returns the string representation of the object argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference: String-Functions
+ + +
+
+
+ + - - - [2.0] fn:implicit-timezone() +
+ + + fn:number(object)
-
- Returns the value of the implicit timezone
+ The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • +
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
Examples:
@@ -2075,1305 +834,131 @@ - - + + + + + +
Result
implicit-timezone()PT1Hboolean("Release11")true
boolean("")false

- W3C Documentation reference: #func-implicit-timezone -
+ W3C Documentation reference: Numeric-Functions
- - - - [2.0] fn:dateTime(date,time) -
-
- Converts the arguments to a date and a time
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
datedate to be merged into dateTime
timetime to be merged into dateTime
Examples:
- - - - - - - - - -
ExpressionResult
dateTime(xs:date("2011-11-15"), xs:time("10:22:00"))2011-11-15T10:22:00

- W3C Documentation reference: #func-dateTime -
-
-
- - - [2.0] fn:current-time() -
-
- Returns the current time (with timezone)
- Examples:
- - - - - - - - - -
ExpressionResult
current-time()11:48:04.393361+01:00

- W3C Documentation reference: #func-current-time -
-
-
- - - [2.0] fn:timezone-from-time(time) -
-
- Returns the time zone component of the argument if any
- Arguments and return type: - - - - - - - - - -
TypeDescription
timetime to extract timezone infromation from
Examples:
- - - - - - - - - -
ExpressionResult
timezone-from-time(xs:time("10:22:00+10:00"))PT10H

- W3C Documentation reference: #func-timezone-from-time -
-
-
- - - [2.0] fn:hours-from-time(time) -
-
- Returns an integer that represents the hours component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
timetime to extact hours component from
Examples:
- - - - - - - - - -
ExpressionResult
hours-from-time(xs:time("10:22:00"))10

- W3C Documentation reference: #func-hours-from-time -
-
-
- - - [2.0] fn:minutes-from-time(time) -
-
- Returns an integer that represents the minutes component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
timetime to extract minutes component from
Examples:
- - - - - - - - - -
ExpressionResult
minutes-from-time(xs:time("10:22:00"))22

- W3C Documentation reference: #func-minutes-from-time -
-
-
- - - [2.0] fn:seconds-from-time(time) -
-
- Returns an integer that represents the seconds component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
timeTime to convert to seconds
Examples:
- - - - - - - - - -
ExpressionResult
seconds-from-time(xs:time("10:22:00"))0

- W3C Documentation reference: #func-seconds-from-time -
-
-
- - - [2.0] fn:years-from-duration(datetimedur) -
-
- Returns an integer that represents the years component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract years component from
Examples:
- - - - - - - - - -
ExpressionResult
years-from-duration(xs:duration("P5Y2DT10H59M"))5

- W3C Documentation reference: #func-years-from-duration -
-
-
- - - [2.0] fn:months-from-duration(datetimedur) -
-
- Returns an integer that represents the months component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract months component from
Examples:
- - - - - - - - - -
ExpressionResult
months-from-duration(xs:duration("P5Y10M2DT10H59M"))10

- W3C Documentation reference: #func-years-from-duration -
-
-
- - - [2.0] fn:days-from-duration(datetimedur) -
-
- Returns an integer that represents the days component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract days component from
Examples:
- - - - - - - - - -
ExpressionResult
days-from-duration(xs:duration("P5Y2DT10H59M"))2

- W3C Documentation reference: #func-days-from-duration -
-
-
- - - [2.0] fn:hours-from-duration(datetimedur) -
-
- Returns an integer that represents the hours component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract hours component from
Examples:
- - - - - - - - - -
ExpressionResult
hours-from-duration(xs:duration("P5Y2DT10H59M"))10

- W3C Documentation reference: #func-hours-from-duration -
-
-
- - - [2.0] fn:minutes-from-duration(datetimedur) -
-
- Returns an integer that represents the minutes component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract minute component from
Examples:
- - - - - - - - - -
ExpressionResult
years-from-duration(xs:duration("P5Y2DT10H59M"))59

- W3C Documentation reference: #func-minutes-from-duration -
-
-
- - - [2.0] fn:seconds-from-duration(datetimedur) -
-
- Returns a decimal that represents the seconds component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract seconds component from
Examples:
- - - - - - - - - -
ExpressionResult
days-from-duration(xs:duration("P5Y2DT10H59M40S"))40

- W3C Documentation reference: #func-seconds-from-duration -
-
-
- - - [2.0] fn:current-date() -
-
- Returns the current date (with timezone)
-
- W3C Documentation reference: #func-current-date -
-
-
- - - [2.0] fn:timezone-from-date(date) -
-
- Returns the time zone component of the argument if any
- Arguments and return type: - - - - - - - - - -
TypeDescription
datedate to extract timezone information from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
timezone-from-date(xs:date("2011-11-15+11:00"))PT1H
timezone-from-date(xs:date("2011-11-15+11:00"))PT11H

- W3C Documentation reference: #func-timezone-from-date -
-
-
- - - [2.0] fn:year-from-date(date) -
-
- Returns an integer that represents the year in the localized value of the argument -
- Arguments and return type: - - - - - - - - - -
TypeDescription
datedate to extract years component from
Examples:
- - - - - - - - - -
ExpressionResult
year-from-date(xs:date("2011-11-15"))2011

- W3C Documentation reference: #func-year-from-date -
-
-
- - - [2.0] fn:month-from-date(date) -
-
- Returns an integer that represents the month in the localized value of the argument -
- Arguments and return type: - - - - - - - - - -
TypeDescription
dateDate to extrat the month from
Examples:
- - - - - - - - - -
ExpressionResult
month-from-date(xs:date("2011-11-15"))11

- W3C Documentation reference: #func-month-from-date -
-
-
- - - [2.0] fn:day-from-date(date) -
-
- Returns an integer that represents the day in the localized value of the argument -
- Arguments and return type: - - - - - - - - - -
TypeDescription
datedate to extact day component from
Examples:
- - - - - - - - - -
ExpressionResult
day-from-date(xs:date("2011-04-23"))23

- W3C Documentation reference: #func-day-from-date -
-
-
- - - [2.0] fn:current-dateTime() -
-
- Returns the current dateTime (with timezone)
- Examples:
- - - - - - - - - -
ExpressionResult
current-dateTime()2021-03-24T18:15:09.808+01:00

- W3C Documentation reference: #func-current-dateTime -
-
-
- - - [2.0] fn:timezone-from-dateTime(datetime) -
-
- Returns the time zone component of the argument if any
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimeDateTime to extract fimezone information from
Examples:
- - - - - - - - - -
ExpressionResult
timezone-from-dateTime(xs:dateTime("2021-01-15T12:10:00-03:00"))-PT3H

- W3C Documentation reference: #func-timezone-from-dateTime -
-
-
- - - [2.0] fn:year-from-dateTime(datetime) -
-
- Returns an integer that represents the year component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract years component from
Examples:
- - - - - - - - - -
ExpressionResult
year-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))2011

- W3C Documentation reference: #func-year-from-dateTime -
-
-
- - - [2.0] fn:month-from-dateTime(datetime) -
-
- Returns an integer that represents the month component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract month component from
Examples:
- - - - - - - - - -
ExpressionResult
month-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))11

- W3C Documentation reference: #func-month-from-dateTime -
-
-
- - - [2.0] fn:day-from-dateTime(datetime) -
-
- Returns an integer that represents the day component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract day component from
Examples:
- - - - - - - - - -
ExpressionResult
day-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))15

- W3C Documentation reference: #func-day-from-dateTime -
-
-
- - - [2.0] fn:hours-from-dateTime(datetime) -
-
- Returns an integer that represents the hours component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract hours component from
Examples:
- - - - - - - - - -
ExpressionResult
hours-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))12

- W3C Documentation reference: #func-hours-from-dateTime -
-
-
- - - [2.0] fn:minutes-from-dateTime(datetime) -
-
- Returns an integer that represents the minutes component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract minutes component from
Examples:
- - - - - - - - - -
ExpressionResult
minutes-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))30

- W3C Documentation reference: #func-minutes-from-dateTime -
-
-
- - - [2.0] fn:seconds-from-dateTime(datetime) -
-
- Returns a decimal that represents the seconds component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract seconds component from
Examples:
- - - - - - - - - -
ExpressionResult
seconds-from-dateTime(xs:dateTime("2011-11-15T12:30:00-04:10"))0

- W3C Documentation reference: #func-seconds-from-dateTime -
-
-
- - - [2.0] fn:adjust-dateTime-to-timezone(datetime,timezone) -
-
- If the timezone argument is empty, it returns a dateTime without a timezone. - Otherwise, it returns a dateTime with a timezone
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
datetimedatetime to be adjusted
timezonetimezone to be used in provided date
Examples:
- - - - - - - - - -
ExpressionResult
adjust-dateTime-to-timezone(xs:dateTime('2011-11-15T12:30:00-04:10'), - xs:dayTimeDuration("PT10H"))2011-11-16T02:40:00+10:00

- W3C Documentation reference: #func-adjust-dateTime-to-timezone -
-
-
- - + + +
-
-
- - - -
- - - [2.0] fn:error() -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error -
-
+
+ + - - - [2.0] fn:error(error) -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error +
+ + + fn:adjust-date-to-timezone(date,timezone) +
+ If the timezone argument is empty, it returns a date without a timezone. Otherwise, + it returns a date with a timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
datedate to be adjusted
timezonetimezone to be imposed into date
Examples:
+ + + + + + + + + +
ExpressionResult
adjust-date-to-timezone(xs:date('2011-11-15'), + xs:dayTimeDuration("PT10H"))2011-11-15+10:00

+ W3C Documentation reference: #func-adjust-date-to-timezone
-
- - - - [2.0] fn:error(error,description) -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error -
-
-
- - - [2.0] fn:error(error,description,error-object) -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error -
-
-
- - - [2.0] fn:trace(value,label) -
-
- Used to debug queries
-
- W3C Documentation reference: #func-trace -
-
-
- - + + + + + +
-
-
- - - -
- - - [2.0] fn:nilled(node) -
-
- Returns a Boolean value indicating whether the argument node is nilled
-
- W3C Documentation reference: #func-nilled -
-
+
+ + - - - [2.0] fn:namespace-uri-from-QName() -
-
- NONE
-
- W3C Documentation reference: #func-namespace-uri-from-QName +
+ + + fn:error() +
+ https://www.w3.org/TR/xpath-functions/#func-error
+
+ W3C Documentation reference: #func-error
-
- - - - [2.0] fn:base-uri() -
-
- Returns the value of the base-uri property of the current or specified node
-
- W3C Documentation reference: #func-base-uri -
-
-
- - - [2.0] fn:base-uri(node) -
-
- Returns the value of the base-uri property of the current or specified node
-
- W3C Documentation reference: #func-base-uri -
-
-
- - - [2.0] fn:static-base-uri() -
-
- Returns the value of the base-uri
- Examples:
- - - - - - - - - -
ExpressionResult
default-collation()http://www.w3.org/2005/xpath-functions/collation/codepoint

- W3C Documentation reference: #func-static-base-uri -
-
-
- - - [2.0] fn:doc-available(URI) -
-
- Returns true if the doc() function returns a document node, otherwise it returns - false
-
- W3C Documentation reference: #func-doc-available -
-
-
- - - [2.0] fn:resolve-QName() -
-
- NONE
-
- W3C Documentation reference: #func-resolve-QName -
-
-
- - - [2.0] fn:node-name(node) -
-
- Returns the node-name of the argument node
-
- W3C Documentation reference: #func-node-name -
-
-
- - - [2.0] fn:default-collation() -
-
- Returns the value of the default collation
-
- W3C Documentation reference: #func-default-collation -
-
-
- - - [2.0] fn:idref((string,string,...),node) -
-
- Returns a sequence of element or attribute nodes that have an IDREF value equal to - the value of one or more of the values specified in the string argument
-
- W3C Documentation reference: #func-idref -
-
-
- - - [2.0] fn:document-uri(node) -
-
- Returns the value of the document-uri property for the specified node
-
- W3C Documentation reference: #func-document-uri -
-
-
- - - [2.0] fn:local-name-from-QName() -
-
- NONE
-
- W3C Documentation reference: #func-local-name-from-QName -
-
-
- - - [2.0] fn:in-scope-prefixes() -
-
- NONE
-
- W3C Documentation reference: #func-in-scope-prefixes -
-
-
- - - [2.0] fn:namespace-uri-for-prefix() -
-
- NONE
-
- W3C Documentation reference: #func-namespace-uri-for-prefix -
-
-
- - - [2.0] fn:QName() -
-
- NONE
-
- W3C Documentation reference: #func-QName -
-
-
- - - [2.0] fn:root() fn:root(node) -
-
- Returns the root of the tree to which the current node or the specified belongs. - This will usually be a document node
-
- W3C Documentation reference: #func-root -
-
-
- - - [2.0] fn:doc(URI) -
-
- NONE
-
- W3C Documentation reference: #func-doc -
-
-
- - - [2.0] fn:resolve-uri(relative,base) -
-
- NONE
-
- W3C Documentation reference: #func-resolve-uri -
-
-
- - - [3.0] fn:available-environment-variables() -
-
- Returns a list of environment variable names
-
- W3C Documentation reference: #func-available-environment-variables -
-
-
- - - [3.0] fn:doc-available(uri) -
-
- The function returns true the function call fn:doc(uri) would return a document node -
-
- W3C Documentation reference: #func-doc-available -
-
-
- - - [3.0] fn:element-with-id() -
-
- https://www.w3.org/TR/xpath-functions-31/#func-element-with-id
-
- W3C Documentation reference: #func-element-with-id -
-
-
- - - [3.0] fn:encode-for-uri(uri-part) -
-
- Encodes reserved characters in a string that is intended to be used in the path - segment of a URI.
-
- W3C Documentation reference: #func-encode-for-uri -
-
-
- - - [3.0] fn:environment-variable(name) -
-
- Returns the value of a system environment variable, if it exists
-
- W3C Documentation reference: #func-environment-variable -
-
-
- - - [3.0] fn:escape-html-uri(uri) -
-
- Escapes a URI in the same way that HTML user agents handle attribute values expected - to contain URIs
-
- W3C Documentation reference: #func-escape-html-uri -
-
-
- - - [3.0] fn:iri-to-uri(iri) -
-
- Converts a string containing an IRI into a URI
-
- W3C Documentation reference: #func-iri-to-uri -
-
-
- - + + + + + +
-
- - -
- - - -
- - [3.0] fn:for-each(sequence*, function) -
-
- Applies function item to every element in sequence
-
- W3C Documentation reference: #func-for-each -
-
+
+ + - - - [3.0] fn:for-each-pair(sequence*, sequence*, function) -
-
- Applies the function to consecutive pairs of elements taken from sequences
-
- W3C Documentation reference: #func-for-each-pair +
+ + + fn:nilled(node) +
+ Returns a Boolean value indicating whether the argument node is nilled
+
+ W3C Documentation reference: #func-nilled +
-
- - - - [3.0] fn:fold-left(sequence*, baseValue, function) -
-
- Applies function item to every element in sequence, accumulating value
-
- W3C Documentation reference: #func-fold-left -
-
-
- - - [3.0] fn:fold-right() -
-
- Applies function item to every element in sequence, accumulating value
-
- W3C Documentation reference: #func-fold-right -
-
-
- - - [3.0] fn:filter(sequence*, function) -
-
- Returns those items from the sequence for which the supplied function returns true
-
- W3C Documentation reference: #func-filter -
-
-
+ + + + + +
-
+ +
+ + + +
+ + fn:for-each(sequence*, function) +
+ Applies function item to every element in sequence
+
+ W3C Documentation reference: #func-for-each +
+ + + +
+
+
@@ -3414,24 +999,27 @@ if (filter == "collapse3.0") { - document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0, 2.0 & 3.0 functions"; - showList(document.getElementsByName("collapse20")); + document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.0 functions"; + hideList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); showList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); } else if (filter == "collapse3.1") { - document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0, 2.0, 3.0 & 3.1 functions"; - showList(document.getElementsByName("collapse20")); - showList(document.getElementsByName("collapse30")); + document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.1 functions"; + hideList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); + hideList(document.getElementsByName("collapse30")); showList(document.getElementsByName("collapse31")); - - } else if (filter == "collapse2.0") { - document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 & 2.0 functions"; + } else if (filter == "collapse2.0"){ + document.getElementById("tooltipFunctionInfo").innerText = "XPath 2.0 functions"; + hideList(document.getElementsByName("collapse10")); showList(document.getElementsByName("collapse20")); hideList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); } else { document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 functions"; + showList(document.getElementsByName("collapse10")); hideList(document.getElementsByName("collapse20")); hideList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); From f77a6f15c21982a96a3dd45ad18f8bd01a2a302a Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 6 Apr 2023 11:53:53 +0200 Subject: [PATCH 02/59] Added tooltips for XPath 2.0 (#134) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/134 --- Frontend/tools/xpath.html | 4365 +++++++++++++++++++++++++++++++++++-- 1 file changed, 4179 insertions(+), 186 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index a7e30d1..065d4a9 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -127,10 +127,10 @@ fn:count(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:count()
Returns the number of nodes in the node-set
- Arguments and return type: + Arguments: @@ -161,7 +161,7 @@ fn:id(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:id()
Returns the element specified by it's unique id, requires DTD

@@ -171,10 +171,10 @@ fn:local-name(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:local-name()
Returns the local-name for the first node in the node-set
- Arguments and return type: + Arguments:
Type
@@ -215,10 +215,10 @@ fn:namespace-uri(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:namespace-uri()
Returns the namespace-uri for the first node in the node-set
- Arguments and return type: + Arguments:
Type
@@ -255,17 +255,17 @@ fn:name(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:name()
Returns the name for the first node in the node-set
- Arguments and return type: + Arguments:
Type
- +
Type Description
node-setnode-set (Optional) Extract first node and return QName
Examples:
@@ -285,27 +285,6 @@
W3C Documentation reference: Node-Set-Functions
- - - - fn:name() -
- Returns the name for the context node
- Examples:
- - - - - - - - - -
ExpressionResult
current context nodeExtract first node and return QName

- W3C Documentation reference: Node-Set-Functions -
-
@@ -317,7 +296,7 @@ fn:boolean(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:boolean()
The boolean function converts its argument to a boolean as follows:
    @@ -327,7 +306,7 @@
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
- Arguments and return type: + Arguments: @@ -384,10 +363,10 @@ fn:lang(string) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:lang()
The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
- Arguments and return type: + Arguments:
Type
@@ -416,14 +395,462 @@ fn:last() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:name()
- Returns the position of the last node in the context list
-
- W3C Documentation reference: Node-Set-Functions + Returns the name of a node, as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName.
+ + If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ + If the argument is supplied and is the empty sequence, the function returns the zero-length string.
+ + If the target node has no name (that is, if it is a document node, a comment, a text node, or a namespace binding having no name), the function returns the zero-length string.
+ + Otherwise, the value returned is fn:string(fn:node-name($arg)).
+
+ Arguments: +
Type
+ + + + + + + + +
TypeDescription
node?Node to display name.
+ Return type: xs:string

+ + Examples: + + + + + + + + + +
QueryResult
name(/l:library)l:library

+ W3C Documentation reference +
+ + fn:local-name() +
+ Returns the local part of the name of $arg as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName.
+ + If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ + If the argument is supplied and is the empty sequence, the function returns the zero-length string.
+ + If the target node has no name (that is, if it is a document node, a comment, or a text node), the function returns the zero-length string.
+ + Otherwise, the value returned will be the local part of the expanded-QName of the target node (as determined by the dm:node-name accessor in Section 5.11 node-name Accessor). This will be an xs:string whose lexical form is an xs:NCName.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node to display local-name.
+ Return type: xs:string

+ Examples: + + + + + + + + + +
QueryResult
name(/l:library)library

+ + W3C Documentation reference +
+ + fn:nilled() +
+ Returns an xs:boolean indicating whether the argument node is "nilled". If the argument is not an element node, returns the empty sequence. If the argument is the empty sequence, returns the empty sequence.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node to test.
+ Return type: xs:boolean?

+ Examples: + + + + + + + + + +
QueryResult
nilled(/l:library)false

+ + W3C Documentation reference +
+ + fn:base-uri() +
+ Returns the value of the base-uri URI property for $arg as defined by the accessor function dm:base-uri() for that kind of node in Section 5.2 base-uri AccessorDM. If $arg is not specified, the behavior is identical to calling the function with the context item (.) as argument. The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + Document, element and processing-instruction nodes have a base-uri property which may be empty. The base-uri property of all other node types is the empty sequence. The value of the base-uri property is returned if it exists and is not empty. Otherwise, if the node has a parent, the value of dm:base-uri() applied to its parent is returned, recursively. If the node does not have a parent, or if the recursive ascent up the ancestor chain encounters a node whose base-uri property is empty and it does not have a parent, the empty sequence is returned.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node to find base URI of.
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + +
QueryResult
base-uri(/l:library/l:libraryName)<empty sequence>

+ + W3C Documentation reference +
+ + fn:document-uri() +
+ Returns the value of the document-uri property for $arg as defined by the dm:document-uri accessor function defined in Section 6.1.2 AccessorsDM.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + Returns the empty sequence if the node is not a document node. Otherwise, returns the value of the dm:document-uri accessor of the document node.
+ + In the case of a document node $D returned by the fn:doc function, or a document node at the root of a tree containing a node returned by the fn:collection function, it will always be true that either fn:document-uri($D) returns the empty sequence, or that the following expression is true: fn:doc(fn:document-uri($D)) is $D. It is implementation-defined whether this guarantee also holds for document nodes obtained by other means, for example a document node passed as the initial context node of a query or transformation.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node which document-uri value needs to be returned.
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + + + + + + + + + +
QueryResult
document-uri(/l:library/l:libraryName)<empty sequence>
document-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the document URI of the first fiction:book element is "http://example.com/library.xml")
document-uri(/library)http://example.com/library.xml (assuming the document URI of the library element is "http://example.com/library.xml")

+ + W3C Documentation reference +
+ + fn:lang() +
+ This function tests whether the language of $node, or the context item if the second argument is omitted, as specified by xml:lang attributes is the same as, or is a sublanguage of, the language specified by $testlang. The behavior of the function if the second argument is omitted is exactly the same as if the context item (.) had been passed as the second argument. The language of the argument node, or the context item if the second argument is omitted, is determined by the value of the xml:lang attribute on the node, or, if the node has no such attribute, by the value of the xml:lang attribute on the nearest ancestor of the node that has an xml:lang attribute. If there is no such ancestor, then the function returns false

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$testlang
node()$node (Optional)
+ Return type: xs:boolean?

+ Examples: Look W3C documentation below. +
+ + W3C Documentation reference +
+ + fn:root() +
+ Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + If $arg is a document node, $arg is returned.
+ + If the function is called without an argument, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]; if the context item is not a node [err:XPTY0004].

+ + Arguments: + + + + + + + + + +
TypeDescription
node()$arg (Optional)
+ Return type: node()?

+ Examples: + + + + + + + + + +
QueryResult
root()<l:library>[...]</l:library>

+ + W3C Documentation reference +
+ + fn:count() +
+ Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:integer

+ Examples: + + + + + + + + + + + + + +
QueryResult
count(/l:library/l:readerList/p:person)2
count(/l:library/l:writers)0

+ + W3C Documentation reference +
+ + + fn:avg() +
+ Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
+ Return type: xs:anyAtomicType

+ Examples: + + + + + + + + + +
QueryResult
avg(/l:library/l:readerList/p:person/p:readerID)6222

+ + W3C Documentation reference +
+ + + fn:max() +
+ Selects an item from the input sequence $arg whose value is greater than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is ·implementation dependent·.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:string$collation (Optional)
+ Return type: xs:anyAtomicType?

+ Examples: + + + + + + + + + + + + + +
QueryResult
max((3,4,5))5
max((5, 5.0e0))5.0e0

+ + W3C Documentation reference +
+ + fn:min() +
+ Selects an item from the input sequence $arg whose value is less than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is ·implementation dependent·.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:string$collation (Optional)
+ Return type: xs:anyAtomicType?

+ Examples: + + + + + + + + + + + + + +
QueryResult
min((3,4,5))3
min((5, 5.0e0))5.0e0

+ + W3C Documentation reference +
+ + + fn:sum() +
+ Returns a value obtained by adding together the values in $arg. If $zero is not specified, then the value returned for an empty sequence is the xs:integer value 0. If $zero is specified, then the value returned for an empty sequence is $zero.
+ + Any values of type xs:untypedAtomic in $arg are cast to xs:double. The items in the resulting sequence may be reordered in an arbitrary order. The resulting sequence is referred to below as the converted sequence.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:anyAtomicType?$zero (Optional)
+ Return type: xs:anyAtomicType?

+ Examples: + + + + + + + + + +
QueryResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

+ + W3C Documentation reference
- -
@@ -435,44 +862,134 @@ fn:boolean(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:boolean()
- The boolean function converts its argument to a boolean as follows: -
    -
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • -
  • a node-set is true if and only if it is non-empty
  • -
  • a string is true if and only if its length is non-zero
  • -
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a boolean
Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Boolean-Functions + Computes the effective boolean value of the sequence $arg. See Section 2.4.3 Effective Boolean ValueXP
+ + If $arg is the empty sequence, fn:boolean returns false.
+ + If $arg is a sequence whose first item is a node, fn:boolean returns true.
+ + If $arg is a singleton value of type xs:boolean or a derived from xs:boolean, fn:boolean returns $arg.
+ + If $arg is a singleton value of type xs:string or a type derived from xs:string, xs:anyURI or a type derived from xs:anyURI or xs:untypedAtomic, fn:boolean returns false if the operand value has zero length; otherwise it returns true.
+ + If $arg is a singleton value of any numeric type or a type derived from a numeric type, fn:boolean returns false if the operand value is NaN or is numerically equal to zero; otherwise it returns true. + + In all other cases, fn:boolean raises a type error [err:FORG0006].
+ + The static semantics of this function are described in Section 7.2.4 The fn:boolean and fn:not functionsFS.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:boolean?

+ Examples: + + + + + + + + + + + + + + + + + +
QueryResult
boolean("/l:library")true
boolean(0)false
boolean(())false

+ + W3C Documentation reference
+ + fn:true() +
+ Returns the xs:boolean value true. Equivalent to xs:boolean("1").

+ + Return type: xs:boolean

+ Examples:
+ + + + + + + + + +
ExpressionResult
true()true

+ W3C Documentation reference +
+ + fn:false() +
+ Returns the xs:boolean value false. Equivalent to xs:boolean("0").

+ + Return type: xs:boolean

+ Examples:
+ + + + + + + + + +
ExpressionResult
false()false

+ W3C Documentation reference +
+ + fn:not() +
+ $arg is first reduced to an effective boolean value by applying the fn:boolean() function. Returns true if the effective boolean value is false, and false if the effective boolean value is true.

+ + Arguments and return type: + + + + + + + + + +
TypeDescription
item$arg
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
not(false())true
not(true())false

+ W3C Documentation reference +
@@ -483,11 +1000,18 @@
- fn:string(object)
- Returns the string representation of the object argument
+ Returns the value of $arg represented as a xs:string. If no argument is supplied, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + If the context item is undefined, error [err:XPDY0002]XP is raised.
+ + If $arg is the empty sequence, the zero-length string is returned.
+ + If $arg is a node, the function returns the string-value of the node, as obtained using the dm:string-value accessor defined in the Section 5.13 string-value AccessorDM.
+ + If $arg is an atomic value, then the function returns the same string as is returned by the expression " $arg cast as xs:string " (see 17 Casting).
Arguments and return type: @@ -498,7 +1022,9 @@ -
string The object to convert to a string
Examples:
+ + Return type: xs:string

+ Examples:
@@ -513,11 +1039,1105 @@
Expression0.11

- W3C Documentation reference: String-Functions + W3C Documentation reference
+ fn:codepoints-to-string() +
+ Creates an xs:string from a sequence of The Unicode Standard code points. Returns the zero-length string if $arg is the empty sequence. If any of the code points in $arg is not a legal XML character, an error is raised [err:FOCH0001].
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:integer*$arg
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
codepoints-to-string((2309, 2358, 2378, 2325))अशॊक
codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41))( ͡° ͜ʖ ͡°)

+ W3C Documentation reference +
+ + fn:string-to-codepoints() +
+ Returns the sequence of The Unicode Standard code points that constitute an xs:string. If $arg is a zero-length string or the empty sequence, the empty sequence is returned.
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string*$arg
+ Return type: xs:integer*

+ Examples:
+ + + + + + + + + +
ExpressionResult
string-to-codepoints("Thérèse")(84, 104, 233, 114, 232, 115, 101)

+ W3C Documentation reference +
+ + fn:compare() +
+ Returns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively less than, equal to, or greater than the value of $comparand2, according to the rules of the collation that is used.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations.
+ + If either argument is the empty sequence, the result is the empty sequence.
+ + This function, invoked with the first signature, backs up the "eq", "ne", "gt", "lt", "le" and "ge" operators on string values.
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$comparand1
xs:string?$comparand2
xs:string$collation (Optional)
+ Return type: xs:integer*

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
compare('abc', 'abc')0
compare('abc', 'acc')-1
compare('abc', 'acc')1

+ W3C Documentation reference +
+ + fn:codepoint-equal() +
+ Returns true or false depending on whether the value of $comparand1 is equal to the value of $comparand2, according to the Unicode code point collation.
+ + If either argument is the empty sequence, the result is the empty sequence.
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?$comparand1
xs:string?$comparand2
+ Return type: xs:boolean?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
codepoint-equal("asdf", "asdf")true
codepoint-equal("asdf", "asdf ")false

+ W3C Documentation reference +
+ + fn:concat() +
+ Accepts two or more xs:anyAtomicType arguments and casts them to xs:string. Returns the xs:string that is the concatenation of the values of its arguments after conversion. If any of the arguments is the empty sequence, the argument is treated as the zero-length string.
+ + The fn:concat function is specified to allow two or more arguments, which are concatenated together. This is the only function specified in this document that allows a variable number of arguments. This capability is retained for compatibility with [XML Path Language (XPath) Version 1.0].
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType?$arg1
xs:anyAtomicType?$arg2
xs:anyAtomicType?$arg... (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
concat('un', 'grateful')ungrateful
concat('Thy ', (), 'old ', "groans", "", ' ring', ' yet', ' in', ' my', ' ancient',' ears.')Thy old groans ring yet in my ancient ears.
fn:concat('Ciao!',())Ciao!

+ W3C Documentation reference +
+ + fn:string-join() +
+ Returns a xs:string created by concatenating the members of the $arg1 sequence using $arg2 as a separator. If the value of $arg2 is the zero-length string, then the members of $arg1 are concatenated without a separator.
+ + If the value of $arg1 is the empty sequence, the zero-length string is returned.
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*$arg1
xs:string$arg2
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string-join(('Now', 'is', 'the', 'time', '...'), ' ')Now is the time ...
string-join(('Blow, ', 'blow, ', 'thou ', 'winter ', 'wind!'), '')Blow, blow, thou winter wind!

+ W3C Documentation reference +
- + fn:substring() +
+ Returns the portion of the value of $sourceString beginning at the position indicated by the value of $startingLoc and continuing for the number of characters indicated by the value of $length. The characters returned do not extend beyond $sourceString. If $startingLoc is zero or negative, only those characters in positions greater than zero are returned.
+ More specifically, the three argument version of the function returns the characters in $sourceString whose position $p obeys:
+ fn:round($startingLoc) <= $p < fn:round($startingLoc) + fn:round($length)
+ The two argument version of the function assumes that $length is infinite and returns the characters in $sourceString whose position $p obeys:
+ fn:round($startingLoc) <= $p < fn:round(INF)
+ In the above computations, the rules for op:numeric-less-than() and op:numeric-greater-than() apply.
+ If the value of $sourceString is the empty sequence, the zero-length string is returned.
+ + Note:
+ The first character of a string is located at position 1, not position 0.
+ + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$sourceString
xs:double$startingLoc
xs:double$length (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
substring("motor car", 6)" car"
substring("metadata", 4, 3)ada

+ W3C Documentation reference +
+ + fn:string-length() +
+ Returns an xs:integer equal to the length in characters of the value of $arg.
+ + If the value of $arg is the empty sequence, the xs:integer 0 is returned.
+ + If no argument is supplied, $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: xs:integer

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string-length("Harp not on that string, madam; that is past.")45
string-length(())0

+ W3C Documentation reference +
+ + fn:normalize-space() +
+ Returns the value of $arg with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of one or more than one whitespace character with a single space, #x20.
+ + If the value of $arg is the empty sequence, returns the zero-length string.
+ + If no argument is supplied, then $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
normalize-space(" The wealthy curled darlings of our nation. ")The wealthy curled darlings of our nation.
normalize-space(())""

+ W3C Documentation reference +
+ + fn:normalize-unicode() +
+ Returns the value of $arg normalized according to the normalization criteria for a normalization form identified by the value of $normalizationForm. The effective value of the $normalizationForm is computed by removing leading and trailing blanks, if present, and converting to upper case.
+ + If the value of $arg is the empty sequence, returns the zero-length string.
+ + Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg
xs:string$normalizationForm (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
normalize-unicode("test ")test

+ W3C Documentation reference +
+ + fn:upper-case() +
+ Returns the value of $arg after translating every character to its upper-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every lower-case character that does not have an upper-case correspondent, as well as every upper-case character, is included in the returned value in its original form.
+ + If the value of $arg is the empty sequence, the zero-length string is returned.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
upper-case("abCd0")ABCD0

+ W3C Documentation reference +
+ + fn:lower-case() +
+ Returns the value of $arg after translating every character to its lower-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every upper-case character that does not have a lower-case correspondent, as well as every lower-case character, is included in the returned value in its original form.
+ + If the value of $arg is the empty sequence, the zero-length string is returned.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
lower-case("abCd0")abcd0

+ W3C Documentation reference +
+ + fn:translate() +
+ Returns the value of $arg modified so that every character in the value of $arg that occurs at some position N in the value of $mapString has been replaced by the character that occurs at position N in the value of $transString.
+ + If the value of $arg is the empty sequence, the zero-length string is returned.
+ + Every character in the value of $arg that does not appear in the value of $mapString is unchanged.
+ + Every character in the value of $arg that appears at some position M in the value of $mapString, where the value of $transString is less than M characters in length, is omitted from the returned value. If $mapString is the zero-length string $arg is returned.
+ + If a character occurs more than once in $mapString, then the first occurrence determines the replacement character. If $transString is longer than $mapString, the excess characters are ignored.
+ + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg
xs:string$mapString
xs:string$mapString
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
translate("bar","abc","ABC")BAr
translate("--aaa--","abc-","ABC")AAA
translate("abcdabc", "abc", "AB")ABdAB

+ W3C Documentation reference +
+ + fn:encode-for-uri() +
+ This function encodes reserved characters in an xs:string that is intended to be used in the path segment of a URI. It is invertible but not idempotent. This function applies the URI escaping rules defined in section 2 of [RFC 3986] to the xs:string supplied as $uri-part. The effect of the function is to escape reserved characters. Each such character in the string is replaced with its percent-encoded form as described in [RFC 3986].
+ + If $uri-part is the empty sequence, returns the zero-length string.
+ + All characters are escaped except those identified as "unreserved" by [RFC 3986], that is the upper- and lower-case letters A-Z, the digits 0-9, HYPHEN-MINUS ("-"), LOW LINE ("_"), FULL STOP ".", and TILDE "~".
+ + Note that this function escapes URI delimiters and therefore cannot be used indiscriminately to encode "invalid" characters in a path segment.
+ + Since [RFC 3986] recommends that, for consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings, this function must always generate hexadecimal values using the upper-case letters A-F.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$uri-part
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
encode-for-uri("https://www.google.com")"https%3A%2F%2Fwww.
google.com"
concat("http://www.example.com/", encode-for-uri("~bébé"))http://www.example.com/
~b%C3%A9b%C3%A9
concat("http://www.example.com/", encode-for-uri("100% organic"))http://www.example.com/
100%25%20organic

+ W3C Documentation reference +
+ + fn:iri-to-uri() +
+ This function converts an xs:string containing an IRI into a URI according to the rules spelled out in Section 3.1 of [RFC 3987]. It is idempotent but not invertible.
+ + If $iri contains a character that is invalid in an IRI, such as the space character (see note below), the invalid character is replaced by its percent-encoded form as described in [RFC 3986] before the conversion is performed.
+ + If $iri is the empty sequence, returns the zero-length string.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$iri
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
iri-to-uri ("http://www.example.com/00/Weather/CA/Los%20Angeles#ocean")"http://www.example.com/00/
Weather/CA/Los%20Angeles#ocean"
iri-to-uri ("http://www.example.com/~bébé")http://www.example.com/
~b%C3%A9b%C3%A9

+ W3C Documentation reference +
+ + fn:escape-html-uri() +
+ This function escapes all characters except printable characters of the US-ASCII coded character set, specifically the octets ranging from 32 to 126 (decimal). The effect of the function is to escape a URI in the manner html user agents handle attribute values that expect URIs. Each character in $uri to be escaped is replaced by an escape sequence, which is formed by encoding the character as a sequence of octets in UTF-8, and then representing each of these octets in the form %HH, where HH is the hexadecimal representation of the octet. This function must always generate hexadecimal values using the upper-case letters A-F.
+ If $uri is the empty sequence, returns the zero-length string. + +

Note:

+ The behavior of this function corresponds to the recommended handling of non-ASCII characters in URI attribute values as described in [HTML 4.0] Appendix B.2.1.

+ + + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$uri
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean")http://www.example.com/00/Weather/CA/Los Angeles#ocean

+ W3C Documentation reference +
+ + fn:contains() +
+ Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of $arg2, according to the collation that is used. + + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns true.
+ + If the value of $arg1 is the zero-length string, the function returns false.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
contains( "tattoo", "tat")true
contains( "tattoo", "ttt")false
contains ( "", ())true

+ W3C Documentation reference +
+ + fn:starts-with() +
+ Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used. + + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
starts-with( "tattoo", "tat")true
starts-with( "tattoo", "ttt")false
starts-with ( "", ())true

+ W3C Documentation reference +
+ + fn:ends-with() +
+ Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used.
+ + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
ends-with( "tattoo", "too")true
ends-with( "tattoo", "tatoo")false
ends-with ((), ())true

+ W3C Documentation reference +
+ + fn:substring-before() +
+ Returns the substring of the value of $arg1 that precedes in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
+ + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns the zero-length string.
+ + If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
substring-before( "tattoo", "too")tat
substring-before( "tattoo", "tat")<empty string>

+ W3C Documentation reference +
+ + fn:substring-after() +
+ Returns the substring of the value of $arg1 that follows in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
+ + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns the value of $arg1.
+ + If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
substring-after( "tattoo", "too")<empty string>
substring-after( "tattoo", "tat")too

+ W3C Documentation reference +
+ + + fn:matches() +
+ The function returns true if $input matches the regular expression supplied as $pattern as influenced by the value of $flags, if present; otherwise, it returns false.
+ + The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ + If $input is the empty sequence, it is interpreted as the zero-length string.
+ Unless the metacharacters ^ and $ are used as anchors, the string is considered to match the pattern if any substring matches the pattern. But if anchors are used, the anchors must match the start/end of the string (in string mode), or the start/end of a line (in multiline mode).
+ + An error is raised [err:FORX0002] if the value of $pattern is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.
+ + An error is raised [err:FORX0001] if the value of $flags is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$input
xs:string$pattern
xs:string$flags (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
matches("abracadabra", "bra")true
matches("abracadabra", "^a.*a$")false

+ W3C Documentation reference +
+ + fn:replace() +
+ The function returns the xs:string that is obtained by replacing each non-overlapping substring of $input that matches the given $pattern with an occurrence of the $replacement string.
+ + The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ + The $flags argument is interpreted in the same manner as for the fn:matches() function.
+ + If $input is the empty sequence, it is interpreted as the zero-length string.
+ + If two overlapping substrings of $input both match the $pattern, then only the
first one (that is, the one whose first character comes first in the $input string) is replaced. + + Within the $replacement string, a variable $N may be used to refer to the substring captured by the Nth parenthesized sub-expression in the regular expression. For each match of the pattern, these variables are assigned the value of the content matched by the relevant sub-expression, and the modified replacement string is then substituted for the characters in $input that matched the pattern. $0 refers to the substring captured by the regular expression as a whole.

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$input
xs:string$pattern
xs:string$replacement
xs:string$flags (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
replace("abracadabra", "bra", "*")a*cada*
replace("abracadabra", "a.*a", "*")*
replace("AAAA", "A+", "b")b

+ W3C Documentation reference +
+ + fn:tokenize() +
+ This function breaks the $input string into a sequence of strings, treating any substring that matches $pattern as a separator. The separators themselves are not returned.
+ + The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ + The $flags argument is interpreted in the same way as for the fn:matches() function.
+ + If $input is the empty sequence, or if $input is the zero-length string, the result is the empty sequence.
+ + If the supplied $pattern matches a zero-length string, that is, if fn:matches("", $pattern, $flags) returns true, then an error is raised: [err:FORX0003].
+ + If a separator occurs at the start of the $input string, the result sequence will start with a zero-length string. Zero-length strings will also occur in the result sequence if a separator occurs at the end of the $input string, or if two adjacent substrings match the supplied $pattern.

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$input
xs:string$pattern
xs:string$flags (Optional)
+ Return type: xs:string*

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
tokenize("The cat sat on the mat", "\s+")("The", "cat", "sat", "on", "the", "mat")
tokenize("1, 15, 24, 50", ",\s*")("1", "15", "24", "50")
tokenize("1,15,,24,50,", ",")("1", "15", "", "24", "50", "")

+ W3C Documentation reference +
+
@@ -528,45 +2148,257 @@ fn:number(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:number()
- The number function converts its argument to a number as follows: -
    -
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • -
  • boolean true is converted to 1; boolean false is converted to 0
  • -
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • -
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a number
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Numeric-Functions + Returns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an xs:double
+ + Calling the zero-argument version of the function is defined to give the same result as calling the single-argument version with the context item (.). That is, fn:number() is equivalent to fn:number(.).
+ + If $arg is the empty sequence or if $arg or the context item cannot be converted to an xs:double, the xs:double value NaN is returned. If the context item is undefined an error is raised: [err:XPDY0002]XP.
+ + If $arg is the empty sequence, NaN is returned. Otherwise, $arg, or the context item after atomization, is converted to an xs:double following the rules of 17.1.3.2 Casting to xs:double. If the conversion to xs:double fails, the xs:double value NaN is returned.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
xs:anyAtomicType?Value to convert to number
+ Return type: xs:double

+ W3C Documentation reference
+ fn:abs() +
+ Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise returns $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For xs:float and xs:double arguments, if the argument is positive zero or negative zero, then positive zero is returned. If the argument is positive or negative infinity, positive infinity is returned.
+ + For detailed type semantics, see Section 7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions.
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + +
QueryResult
abs(-2)2
abs(2137)2137

+ W3C Documentation reference +
+ + fn:ceiling() +
+ Returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For xs:float and xs:double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero and greater than -1, negative zero is returned.
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + +
QueryResult
ceiling(10.5)11
ceiling(-10.5)-10
ceiling(10.1)11

+ W3C Documentation reference +
+ + fn:floor() +
+ Returns the largest (closest to positive infinity) number with no fractional part that is not greater than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For float and double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned.
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + +
QueryResult
floor(10.5)10
floor(-10.5)-11
floor(10.8)10

+ W3C Documentation reference +
+ + fn:round() +
+ Returns the number with no fractional part that is closest to the argument. If there are two such numbers, then the one that is closest to positive infinity is returned. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For xs:float and xs:double arguments, if the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. In the cases where positive zero or negative zero is returned, negative zero or positive zero may be returned as [XML Schema Part 2: Datatypes Second Edition] does not distinguish between the values positive zero and negative zero.
+ + For the last two cases, note that the result is not the same as fn:floor(x+0.5).
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + +
QueryResult
round(10.5)11
round(10.4999)10
round(-10.5)-10

+ W3C Documentation reference +
+ + fn:round-half-to-even() +
+ The value returned is the nearest (that is, numerically closest) value to $arg that is a multiple of ten to the power of minus $precision. If two such values are equally near (e.g. if the fractional part in $arg is exactly .500...), the function returns the one whose least significant digit is even.
+ + If the type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + The first signature of this function produces the same result as the second signature with $precision=0.
+ + For arguments of type xs:float and xs:double, if the argument is NaN, positive or negative zero, or positive or negative infinity, then the result is the same as the argument. In all other cases, the argument is cast to xs:decimal, the function is applied to this xs:decimal value, and the resulting xs:decimal is cast back to xs:float or xs:double as appropriate to form the function result. If the resulting xs:decimal value is zero, then positive or negative zero is returned according to the sign of the original argument.
+ + Note that the process of casting to xs:decimal may result in an error [err:FOCA0001].
+ + If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa computed with exponent = 0.
+
+ Arguments: + + + + + + + + + + + + + +
TypeDescription
numeric?$arg
numeric?$precision (Optional)
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + + + + + +
QueryResult
round-half-to-even(0.5)0
round-half-to-even(1.5)2
round-half-to-even(2.5)2
round-half-to-even(2.6)3

+ W3C Documentation reference +
@@ -577,32 +2409,826 @@
fn:avg((arg,arg,...)) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:data()
- Returns the average of the argument values
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*returns average value of provided elements
Examples:
- - - - - - - - - -
ExpressionResult
avg((1,2,3))2

- W3C Documentation reference: #func-avg + fn:data takes a sequence of items and returns a sequence of atomic values.
+ + The result of fn:data is the sequence of atomic values produced by applying the following rules to each item in $arg:
+
    +
  • If the item is an atomic value, it is returned.
  • +
  • + If the item is a node: +
      +
    • If the node does not have a typed value an error is raised [err:FOTY0012].
    • +
    • Otherwise, fn:data() returns the typed value of the node as defined by the accessor function dm:typed-value in Section 5.15 typed-value AccessorDM.
    • +
    +
  • +
+
+ Arguments: + + + + + + + + + +
TypeDescription
item*Items to convert.
+ Return type: xs:anyAtomicType*

+ Examples: + + + + + + + + + +
QueryResult
data(/l:library/l:readerList/p:person[1])7321
Adam
Choke

+ + W3C Documentation reference
+ + fn:index-of() +
+ Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + If $arg is a document node, $arg is returned.
+ + If the function is called without an argument, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]; if the context item is not a node [err:XPTY0004].

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType$seqParam
xs:anyAtomicType$srchParam
xs:string$collation (Optional)
+ Return type: xs:integer*

+ Examples: + + + + + + + + + + + + + + + + + +
QueryResult
index-of((10, 20, 30, 40), 35)()
index-of((10, 20, 30, 30, 20, 10), 20)(2, 5)
index-of(("a", "sport", "and", "a", "pastime"), "a")(1, 4)

+ + W3C Documentation reference +
+ + + fn:empty() +
+ If the value of $arg is the empty sequence, the function returns true; otherwise, the function returns false.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:boolean

+ Examples: + + + + + + + + + +
QueryResult
empty(fn:remove(("hello", "world"), 1))false

+ + W3C Documentation reference +
+ + + fn:exists() +
+ If the value of $arg is not the empty sequence, the function returns true; otherwise, the function returns false.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:boolean

+ Examples: + + + + + + + + + +
QueryResult
exists(fn:remove(("hello"), 1))true

+ + W3C Documentation reference +
+ + + fn:distinct-values() +
+ Returns the sequence that results from removing from $arg all but one of a set of values that are eq to one other. Values of type xs:untypedAtomic are compared as if they were of type xs:string. Values that cannot be compared, i.e. the eq operator is not defined for their types, are considered to be distinct. The order in which the sequence of values is returned is ·implementation dependent·.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:string$collation (Optional)
+ Return type: xs:anyAtomicType*

+ Examples: + + + + + + + + + +
QueryResult
distinct-values((1, 2.0, 3, 2))(1, 3, 2.0)

+ + W3C Documentation reference +
+ + fn:insert-before() +
+ Returns a new sequence constructed from the value of $target with the value of $inserts inserted at the position specified by the value of $position. (The value of $target is not affected by the sequence construction.)
+ + If $target is the empty sequence, $inserts is returned. If $inserts is the empty sequence, $target is returned.
+ + The value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $inserts, followed by the remaining elements of $target, in that sequence.
+ + If $position is less than one (1), the first position, the effective value of $position is one (1). If $position is greater than the number of items in $target, then the effective value of $position is equal to the number of items in $target plus 1.

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*$target
xs:integer$position
item()*$inserts
+ Return type: item()*

+ Examples:
+ let $x := ("a", "b", "c") + + + + + + + + + + + + + + + + + +
QueryResult
insert-before($x, 0, "z")("z", "a", "b", "c")
insert-before($x, 1, "z")("z", "a", "b", "c")
insert-before($x, 2, "z")("a", "z", "b", "c")

+ + W3C Documentation reference +
+ + fn:remove() +
+ Returns a new sequence constructed from the value of $target with the item at the position specified by the value of $position removed.
+ + If $position is less than 1 or greater than the number of items in $target, $target is returned. Otherwise, the value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $target whose index is greater than $position. If $target is the empty sequence, the empty sequence is returned.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
item()*$target
xs:integer$position
+ Return type: item()*

+ Examples:
+ let $x := ("a", "b", "c") + + + + + + + + + + + + + + + + + +
QueryResult
remove($x, 0) ("a", "b", "c")
remove($x, 1)("b", "c")
remove($x, 6)("a", "b", "c")

+ + W3C Documentation reference +
+ + + fn:reverse() +
+ Reverses the order of items in a sequence. If $arg is the empty sequence, the empty sequence is returned.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()*

+ Examples:
+ let $x := ("a", "b", "c") + + + + + + + + + + + + + + + + + +
QueryResult
reverse($x)("c", "b", "a")
reverse(("hello")) ("hello")
reverse(())()

+ + W3C Documentation reference +
+ + + fn:subsequence() +
+ Returns the contiguous sequence of items in the value of $sourceSeq beginning at the position indicated by the value of $startingLoc and continuing for the number of items indicated by the value of $length. + If $sourceSeq is the empty sequence, the empty sequence is returned.
+ + If $startingLoc is zero or negative, the subsequence includes items from the beginning of the $sourceSeq.
+ + If $length is not specified, the subsequence includes items to the end of $sourceSeq.
+ + If $length is greater than the number of items in the value of $sourceSeq following $startingLoc, the subsequence includes items to the end of $sourceSeq.
+ + The first item of a sequence is located at position 1, not position 0.

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*$sourceSeq
xs:double$startingLoc (Optional)
xs:double$length (Optional)
+ Return type: item()*

+ Examples:
+ let $seq = ($item1, $item2, $item3, $item4, ...) + + + + + + + + + + + + + +
QueryResult
subsequence($seq, 4)($item4, ...)
subsequence($seq, 3, 2)($item3, $item4)

+ + W3C Documentation reference +
+ + + fn:unordered() +
+ Returns the items of $sourceSeq in an implementation dependent order.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$sourceSeq
+ Return type: item()*

+ + W3C Documentation reference +
+ + fn:zero-or-one() +
+ Returns $arg if it contains zero or one items. Otherwise, raises an error [err:FORG0003].

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()?

+ Examples: + + + + + + + + + + + + + +
QueryResult
zero-or-one(("a"))a
zero-or-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:zero-or-one() ("a", "b")

+ + W3C Documentation reference +
+ + + fn:one-or-more() +
+ Returns $arg if it contains one or more items. Otherwise, raises an error [err:FORG0004].

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()?

+ Examples: + + + + + + + + + + + + + +
QueryResult
one-or-more(("a"))a
one-or-more(("a", "b"))a
b

+ + W3C Documentation reference +
+ + + fn:exactly-one() +
+ Returns $arg if it contains exactly one item. Otherwise, raises an error [err:FORG0005].

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()?

+ Examples: + + + + + + + + + + + + + +
QueryResult
exactly-one(("a"))a
exactly-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:exactly-one() ("a", "b")

+ + W3C Documentation reference +
+ + + fn:deep-equal() +
+ This function assesses whether two sequences are deep-equal to each other. To be deep-equal, they must contain items that are pairwise deep-equal; and for two items to be deep-equal, they must either be atomic values that compare equal, or nodes of the same kind, with the same name, whose children are deep-equal. This is defined in more detail below. The $collation argument identifies a collation which is used at all levels of recursion when strings are compared (but not when names are compared), according to the rules in 7.3.1 Collations.
+ + If the two sequences are both empty, the function returns true.
+ + If the two sequences are of different lengths, the function returns false.
+ + If the two sequences are of the same length, the function returns true if and only if every item in the sequence $parameter1 is deep-equal to the item at the same position in the sequence $parameter2. The rules for deciding whether two items are deep-equal follow. + + For more in-depth description look into W3C Documentation

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*$parameter1
item()*$parameter2
xs:string$collation (Optional)
+ Return type: xs:boolean

+ Examples: + + + + + + + + + + + + + +
QueryResult
deep-equal(/l:library/p:person[0], /l:library/p:person[1])true
deep-equal(/l:library/p:person[0], /l:library)false

+ + W3C Documentation reference +
+ + + fn:id() +
+ Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg. + +

Note:

+ + This function does not have the desired effect when searching a document in which elements of type xs:ID are used as identifiers. To preserve backwards compatibility, a new function fn:element-with-id is therefore being introduced; it behaves the same way as fn:id in the case of ID-valued attributes. +

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string*$arg
node()*$node
xs:string$collation (Optional)
+ Return type: element()*

+ + W3C Documentation reference +
+ + fn:idref() +
+ Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string*$arg
node()*$node
xs:string$collation (Optional)
+ Return type: node()*

+ + W3C Documentation reference +
+ + + fn:doc() +
+ Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string$uri
+ Return type: document-node()?

+ Examples: + + + + + + + + + +
QueryResult
doc("test.xml")Contents of test.xml file returned as node

+ + W3C Documentation reference +
+ + + fn:doc-available() +
+ Retrieves a document using a URI supplied as an xs:string, and returns the corresponding document node.
+ + If $uri is the empty sequence, the result is an empty sequence.
+ + If $uri is not a valid URI, an error may be raised [err:FODC0005].
+ + If $uri is a relative URI reference, it is resolved relative to the value of the base URI property from the static context. The resulting absolute URI is promoted to an xs:string.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string$uri
+ Return type: xs:boolean

+ Examples: + + + + + + + + + +
QueryResult
doc("test.xml")true (If document is available)

+ + W3C Documentation reference +
+ + + fn:collection() +
+ This function takes an xs:string as argument and returns a sequence of nodes obtained by interpreting $arg as an xs:anyURI and resolving it according to the mapping specified in Available collections described in Section C.2 Dynamic Context ComponentsXP. If Available collections provides a mapping from this string to a sequence of nodes, the function returns that sequence. If Available collections maps the string to an empty sequence, then the function returns an empty sequence. If Available collections provides no mapping for the string, an error is raised [err:FODC0004].
+ If $arg is not specified, the function returns the sequence of the nodes in the default collection in the dynamic context. See Section C.2 Dynamic Context ComponentsXP. If the value of the default collection is undefined an error is raised [err:FODC0002].

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: node()*

+ Examples: + + + + + + + + + +
QueryResult
collection("")<empty sequence>

+ + W3C Documentation reference +
+ + fn:element-with-id() +
+ Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: node()*

+ + W3C Documentation reference +
+ + fn:position() +
+ Returns the context position from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

+ + Return type: xs:integer

+ Examples: + + + + + + + + + +
QueryResult
/l:library/l:readerList/position()1

+ + W3C Documentation reference +
+ + + fn:last() +
+ Returns the context size from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

+ + Return type: xs:integer

+ Examples: + + + + + + + + + +
QueryResult
/l:library/l:readerList/p:person/last()2
2

+ + W3C Documentation reference +
+
@@ -612,55 +3238,1074 @@
- fn:adjust-date-to-timezone(date,timezone) -
- If the timezone argument is empty, it returns a date without a timezone. Otherwise, - it returns a date with a timezone
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
datedate to be adjusted
timezonetimezone to be imposed into date
Examples:
- - - - - - - - - -
ExpressionResult
adjust-date-to-timezone(xs:date('2011-11-15'), - xs:dayTimeDuration("PT10H"))2011-11-15+10:00

- W3C Documentation reference: #func-adjust-date-to-timezone -
- + fn:years-from-duration() +
+ Returns an xs:integer representing the years component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the years component as described in 10.3.1.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:dayTimeDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
years-from-duration(xs:yearMonthDuration("P20Y15M"))21
years-from-duration(xs:yearMonthDuration("-P15M"))-1
years-from-duration(xs:dayTimeDuration("-P2DT15H"))0

+ W3C Documentation reference +
+ + fn:months-from-duration() +
+ Returns an xs:integer representing the months component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the months component as described in 10.3.1.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:dayTimeDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
months-from-duration(xs:yearMonthDuration("P20Y15M"))3
months-from-duration(xs:yearMonthDuration("-P20Y18M"))-6
months-from-duration(xs:dayTimeDuration("-P2DT15H0M0S"))0

+ W3C Documentation reference +
+ + fn:days-from-duration() +
+ Returns an xs:integer representing the days component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the days component as described in 10.3.2.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:yearMonthDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
days-from-duration(xs:dayTimeDuration("P3DT10H"))3
days-from-duration(xs:dayTimeDuration("P3DT55H"))5
days-from-duration(xs:yearMonthDuration("P3Y5M"))0

+ W3C Documentation reference +
+ + fn:hours-from-duration() +
+ Returns an xs:integer representing the hours component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the hours component as described in 10.3.2.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:yearMonthDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
hours-from-duration(xs:dayTimeDuration("P3DT10H"))10
hours-from-duration(xs:dayTimeDuration("P3DT12H32M12S"))12
hours-from-duration(xs:dayTimeDuration("PT123H"))0

+ W3C Documentation reference +
+ + + fn:minutes-from-duration() +
+ Returns an xs:integer representing the minutes component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the minutes component as described in 10.3.2.3 Canonical representation. + + The result may be negative. + + If $arg is an xs:yearMonthDuration returns 0. + + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
minutes-from-duration(xs:dayTimeDuration("P3DT10H"))0
minutes-from-duration(xs:dayTimeDuration("-P5DT12H30M"))-30

+ W3C Documentation reference +
+ + fn:seconds-from-duration() +
+ Returns an xs:decimal representing the seconds component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the seconds component as described in 10.3.2.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:yearMonthDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:decimal?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
seconds-from-duration(xs:dayTimeDuration("P3DT10H12.5S"))12.5
seconds-from-duration(xs:dayTimeDuration("-PT256S"))-16.0

+ W3C Documentation reference +
+ + + fn:year-from-dateTime() +
+ Returns an xs:integer representing the year component in the localized value of $arg. The result may be negative.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
year-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))1999
year-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))1999
year-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))2000

+ W3C Documentation reference +
+ + + fn:month-from-dateTime() +
+ Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
month-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))5
month-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))12
month-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))1

+ W3C Documentation reference +
+ + fn:day-from-dateTime() +
+ Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
day-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))31
day-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))31
day-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))1

+ W3C Documentation reference +
+ + + fn:hours-from-dateTime() +
+ Returns an xs:integer between 0 and 23, both inclusive, representing the hours component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
hours-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))13
hours-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))19
hours-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))0

+ W3C Documentation reference +
+ + + fn:minutes-from-dateTime() +
+ Returns an xs:integer value between 0 and 59, both inclusive, representing the minute component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
minutes-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))20
minutes-from-dateTime(xs:dateTime("1999-05-31T13:30:00+05:30"))30

+ W3C Documentation reference +
+ + fn:seconds-from-dateTime() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:decimal?

+ Examples:
+ + + + + + + + + +
ExpressionResult
seconds-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))0

+ W3C Documentation reference +
+ + fn:timezone-from-dateTime() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:dayTimeDuration?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
timezone-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))-PT5H
timezone-from-dateTime(xs:dateTime("2000-06-12T13:20:00Z")) PT0S
timezone-from-dateTime(xs:dateTime("2004-08-27T00:00:00"))()

+ W3C Documentation reference +
+ + + fn:year-from-date() +
+ Returns an xs:integer representing the year in the localized value of $arg. The value may be negative.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
year-from-date(xs:date("1999-05-31"))1999
year-from-date(xs:date("2000-01-01+05:00"))2000

+ W3C Documentation reference +
+ + fn:month-from-date() +
+ Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
month-from-date(xs:date("1999-05-31-05:00"))5
month-from-date(xs:date("2000-01-01+05:00"))1

+ W3C Documentation reference +
+ + fn:day-from-date() +
+ Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
day-from-date(xs:date("1999-05-31-05:00"))31
day-from-date(xs:date("2000-01-01+05:00"))1

+ W3C Documentation reference +
+ + + fn:timezone-from-date() +
+ Returns the timezone component of $arg if any. If $arg has a timezone component, then the result is an xs:dayTimeDuration that indicates deviation from UTC; its value may range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty sequence.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:dayTimeDuration?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
timezone-from-date(xs:date("1999-05-31-05:00"))-PT5H
timezone-from-date(xs:date("2000-06-12Z"))PT0S

+ W3C Documentation reference +
+ + + fn:hours-from-time() +
+ Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
hours-from-time(xs:time("11:23:00"))11
hours-from-time(xs:time("24:00:00"))0

+ W3C Documentation reference +
+ + + fn:minutes-from-time() +
+ Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
hours-from-time(xs:time("11:23:00"))11
hours-from-time(xs:time("24:00:00"))0

+ W3C Documentation reference +
+ + fn:seconds-from-time() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:decimal?

+ Examples:
+ + + + + + + + + + +
ExpressionResult
seconds-from-time(xs:time("13:20:10.5"))10.5

+ W3C Documentation reference +
+ + + fn:timezone-from-time() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:dayTimeDuration?

+ Examples:
+ + + + + + + + + + + + + + +
ExpressionResult
timezone-from-time(xs:time("13:20:00-05:00"))-PT5H
timezone-from-time(xs:time("13:20:00"))()

+ W3C Documentation reference +
+ + + fn:adjust-date-to-timezone() +
+ Adjusts an xs:date value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:date without a timezone. Otherwise, returns an xs:date with a timezone. For purposes of timezone adjustment, an xs:date is treated as an xs:dateTime with time 00:00:00.
+ + If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
+ + If $arg is the empty sequence, then the result is the empty sequence.
+ + A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
+ + If $arg does not have a timezone component and $timezone is the empty sequence, then the result is the value of $arg.
+ + If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
+ + If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
+ + If $arg has a timezone component and $timezone is not the empty sequence, then: +
    +
  • Let $srcdt be an xs:dateTime value, with 00:00:00 for the time component and date and timezone components that are the same as the date and timezone components of $arg.
  • +
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
  • +
  • The result of this function will be a date value that has date and timezone components that are the same as the date and timezone components of $r.
  • +
+

+ + Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:date?$arg
xs:dayTimeDuration?$timezone
+ Return type: xs:date?

+ Examples:
+ + + + + + + + + + + + + + +
ExpressionResult
adjust-date-to-timezone(xs:date("2002-03-07"))2002-03-07-05:00
adjust-date-to-timezone(xs:date("2002-03-07"), xs:dayTimeDuration("-PT10H"))2002-03-07-10:00

+ W3C Documentation reference +
+ + fn:adjust-time-to-timezone() +
+ Adjusts an xs:time value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:time without a timezone. Otherwise, returns an xs:time with a timezone.
+ + If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
+ + If $arg is the empty sequence, then the result is the empty sequence.
+ + A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
+ + If $arg does not have a timezone component and $timezone is the empty sequence, then the result is $arg.
+ + If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
+ + If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
+ + If $arg has a timezone component and $timezone is not the empty sequence, then: +
    +
  • Let $srcdt be an xs:dateTime value, with an arbitrary date for the date component and time and timezone components that are the same as the time and timezone components of $arg.
  • +
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
  • +
  • The result of this function will be a time value that has time and timezone components that are the same as the time and timezone components of $r.
  • +
+

+ + Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:time?$arg
xs:dayTimeDuration?$timezone
+ Return type: xs:time?

+ Examples:
+ + + + + + + + + + + + + + +
ExpressionResult
adjust-time-to-timezone(xs:time("10:00:00"))10:00:00-05:00
adjust-time-to-timezone(xs:time("10:00:00"), xs:dayTimeDuration("-PT10H"))10:00:00-10:00

+ W3C Documentation reference +
+ + fn:current-dateTime() +
+ Returns the current dateTime (with timezone) from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) This is an xs:dateTime that is current at some time during the evaluation of a query or transformation in which fn:current-dateTime() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-dateTime() is ·implementation dependent·.

+ + Return type: xs:dateTime

+ Examples:
+ + + + + + + + + + +
ExpressionResult
current-dateTime()xs:dateTime corresponding to the current date and time

+ W3C Documentation reference +
+ + fn:current-date() +
+ Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

+ + Return type: xs:date

+ Examples:
+ + + + + + + + + + +
ExpressionResult
current-date()xs:date corresponding to the current date

+ W3C Documentation reference +
+ + + fn:current-time() +
+ Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

+ + Return type: xs:time

+ Examples:
+ + + + + + + + + + +
ExpressionResult
current-time()xs:date corresponding to the current time

+ W3C Documentation reference +
+ + fn:implicit-timezone() +
+ Returns the value of the implicit timezone property from the dynamic context. Components of the dynamic context are discussed in Section C.2 Dynamic Context ComponentsXP.

+ + Return type: xs:string

+ Examples:
+ + + + + + + + + + +
ExpressionResult
implicit-timezone()PT0S

+ W3C Documentation reference +
- +
fn:error()
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error + The fn:error function is a general function that may be invoked as above but may also be invoked from [XQuery 1.0: An XML Query Language] or [XML Path Language (XPath) 2.0] applications with, for example, an xs:QName argument. +
+ W3C Documentation reference +
+ + + fn:trace() +
+ Provides an execution trace intended to be used in debugging queries.
+ + The input $value is returned, unchanged, as the result of the function. In addition, the inputs $value, converted to an xs:string, and $label may be directed to a trace data set. The destination of the trace output is ·implementation-defined·. The format of the trace output is ·implementation dependent·. The ordering of output from invocations of the fn:trace() function is ·implementation dependent·.
+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
item*$value
xs:string$label
+ Return type: item

+
+ W3C Documentation reference
@@ -673,15 +4318,363 @@
- fn:nilled(node) -
+ fn:resolve-uri() +
+ This function enables a relative URI reference to be resolved against an absolute URI. - Returns a Boolean value indicating whether the argument node is nilled
-
- W3C Documentation reference: #func-nilled -
+ The first form of this function resolves $relative against the value of the base-uri property from the static context. If the base-uri property is not initialized in the static context an error is raised [err:FONS0005].
+ + If $relative is a relative URI reference, it is resolved against $base, or against the base-uri property from the static context, using an algorithm such as those described in [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned.
+ If $relative is an absolute URI reference, it is returned unchanged.
+ + If $relative is the empty sequence, the empty sequence is returned.
+ + If $relative is not a valid URI according to the rules of the xs:anyURI data type, or if it is not a suitable relative reference to use as input to the chosen resolution algorithm, then an error is raised [err:FORG0002].
+ + If $base is not a valid URI according to the rules of the xs:anyURI data type, if it is not a suitable URI to use as input to the chosen resolution algorithm (for example, if it is a relative URI reference, if it is a non-hierarchic URI, or if it contains a fragment identifier), then an error is raised [err:FORG0002].
+ + If the chosen resolution algorithm fails for any other reason then an error is raised [err:FORG0009].
+ +

Note:

+ + Resolving a URI does not dereference it. This is merely a syntactic operation on two character strings. +

+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?$relative
xs:string$base
+ Return type: xs:anyURI?

+
+ W3C Documentation reference +
+ fn:resolve-QName() +
+ Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string that has the lexical form of an xs:QName (a string in the form "prefix:local-name" or "local-name") and resolving it using the in-scope namespaces for a given element.
+ + If $qname does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
+ + If $qname is the empty sequence, returns the empty sequence.
+ + More specifically, the function searches the namespace bindings of $element for a binding whose name matches the prefix of $qname, or the zero-length string if it has no prefix, and constructs an expanded-QName whose local name is taken from the supplied $qname, and whose namespace URI is taken from the string value of the namespace binding.
+ + If the $qname has a prefix and if there is no namespace binding for $element that matches this prefix, then an error is raised [err:FONS0004].
+ + If the $qname has no prefix, and there is no namespace binding for $element corresponding to the default (unnamed) namespace, then the resulting expanded-QName has no namespace part.
+ + The prefix (or absence of a prefix) in the supplied $qname argument is retained in the returned expanded-QName, as discussed in Section 2.1 TerminologyDM.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$qname
element$element
+ Return type: xs:QName?

+ Examples: + + + + + + + + + + + + + +
QueryResult
resolve-QName("hello", /l:library/l:libraryName)hello
resolve-QName("l:libraryID", /l:library/l:libraryName)l:libraryID

+ + W3C Documentation reference +
+ + fn:QName() +
+ Returns an xs:QName with the namespace URI given in $paramURI. If $paramURI is the zero-length string or the empty sequence, it represents "no namespace"; in this case, if the value of $paramQName contains a colon (:), an error is raised [err:FOCA0002]. The prefix (or absence of a prefix) in $paramQName is retained in the returned xs:QName value. The local name in the result is taken from the local part of $paramQName.
+ + If $paramQName does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
+ + Note that unlike xs:QName this function does not require a xs:string literal as the argument.

+ Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$paramURI
xs:string$paramQName
+ Return type: xs:QName

+ Examples: + + + + + + + + + +
QueryResult
QName("http://www.release11.com/library", "l:libraryName")l:libraryName
+ For more extensive examples see W3C documentation below.
+ + W3C Documentation reference +
+ + fn:prefix-from-QName() +
+ Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:NCName?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))l
+ + W3C Documentation reference +
+ + fn:local-name-from-QName() +
+ Returns an xs:NCName representing the local part of $arg. If $arg is the empty sequence, returns the empty sequence.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:NCName?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))library
+ + W3C Documentation reference +
+ + + fn:prefix-from-QName() +
+ Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:NCName?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))l
+ + W3C Documentation reference +
+ + fn:namespace-uri-from-QName() +
+ Returns the namespace URI for $arg as an xs:anyURI. If $arg is the empty sequence, the empty sequence is returned. If $arg is in no namespace, the zero-length xs:anyURI is returned.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))http://www.release11.com/library
+ + W3C Documentation reference +
+ + + fn:namespace-uri-for-prefix() +
+ Returns the namespace URI of one of the in-scope namespaces for $element, identified by its namespace prefix.
+ + If $element has an in-scope namespace whose namespace prefix is equal to $prefix, it returns the namespace URI of that namespace. If $prefix is the zero-length string or the empty sequence, it returns the namespace URI of the default (unnamed) namespace. Otherwise, it returns the empty sequence.
+ + Prefixes are equal only if their Unicode code points match exactly.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$prefix
element()$element
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + +
QueryResult
namespace-uri-for-prefix("l", /l:library)http://www.release11.com/library
+ + W3C Documentation reference +
+ + + fn:in-scope-prefixes() +
+ Returns the prefixes of the in-scope namespaces for $element. For namespaces that have a prefix, it returns the prefix as an xs:NCName. For the default namespace, which has no prefix, it returns the zero-length string.

+ + Arguments: + + + + + + + + + +
TypeDescription
element()$element
+ Return type: xs:string*

+ Examples: + + + + + + + + + +
QueryResult
in-scope-prefixes(/l:library)b
l
p
xsi
xml
+ + W3C Documentation reference +
+ + fn:static-base-uri() +
+ Returns the value of the Base URI property from the static context. If the Base URI property is undefined, the empty sequence is returned. Components of the static context are discussed in Section C.1 Static Context ComponentsXP.

+ + Return type: xs:anyURI?

+ Examples:
+ + + + + + + + + + +
ExpressionResult
static-base-uri()()<empty sequence>

+ W3C Documentation reference +
From 00f3606da6df133ba54f4a4827842228c9ee333c Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 6 Apr 2023 14:03:39 +0200 Subject: [PATCH 03/59] Added numeric functions and some string --- Frontend/tools/xpath.html | 472 +++++++++++++++++++++++++++++++------- 1 file changed, 385 insertions(+), 87 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 065d4a9..999cb7c 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -286,104 +286,402 @@ W3C Documentation reference: Node-Set-Functions
-
+
- - - -
- - - fn:boolean() + + +
- The boolean function converts its argument to a boolean as follows: -
    -
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • -
  • a node-set is true if and only if it is non-empty
  • -
  • a string is true if and only if its length is non-zero
  • -
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • -
- Arguments: - - - - - - - - - -
TypeDescription
objectThe object to convert to a boolean
Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Boolean-Functions -
+ + fn:boolean() +
+ The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • +
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a boolean
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
boolean("Release11")true
boolean("")false

+ W3C Documentation reference: Boolean-Functions +
- fn:not() -
- The not function returns true if its argument is false, and false otherwise.
+ fn:not() +
+ The not function returns true if its argument is false, and false otherwise.
+
+ W3C Documentation reference: Boolean-Functions +
+ + + fn:true() +
+ The true function returns true.
+
+ W3C Documentation reference: Boolean-Functions +
+ + + fn:false() +
+ The true function returns false.
+
+ W3C Documentation reference: Boolean-Functions +
+ + fn:lang() +
+ The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
+ Arguments: + + + + + + + + + +
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation

- W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions +
+ +
- - - fn:true() -
- The true function returns true.
-
- W3C Documentation reference: Boolean-Functions -
- - - fn:false() -
- The true function returns false.
-
- W3C Documentation reference: Boolean-Functions -
- - fn:lang() -
- The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
- Arguments: - - - - - - - - - -
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation
-
- W3C Documentation reference: Boolean-Functions -
- -
+ + + +
+ + + +
+ + fn:string() +
+ The string function converts an object to a string as follows: A node-set is converted to a string by returning the string-value of the node in the node-set that is first in document order. If the node-set is empty, an empty string is returned.
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a string
Examples:
+ + + + + + + + + +
ExpressionResult
string(10)true

+ W3C Documentation reference: String-Functions +
+ + + fn:concat() +
+ The concat function returns the concatenation of its arguments.
+ + Arguments: + + + + + + + + + +
TypeDescription
string*Strings to concatenate
Examples:
+ + + + + + + + + +
ExpressionResult
concat("Release", 11)Release11

+ W3C Documentation reference: String-Functions +
+ + fn:starts-with() +
+ The concat function returns the concatenation of its arguments.
+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
string
stringThe object to convert to a string
Examples:
+ + + + + + + + + +
ExpressionResult
concat("Release", 11)Release11

+ W3C Documentation reference: String-Functions +
+ + +
+ +
+ + + +
+ + + fn:number() +
+ The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • +
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
number(10)10
number("")NaN

+ W3C Documentation reference +
+ + fn:sum() +
+ The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + +
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

+ W3C Documentation reference +
+ + fn:floor() +
+ The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)4
floor(3.9)4
floor(3.5)4

+ W3C Documentation reference +
+ + fn:ceiling() +
+ The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)3
floor(3.5)3

+ W3C Documentation reference +
+ + + fn:round() +
+ The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. + +

NOTE

+ For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)4
floor(3.5)3

+ W3C Documentation reference +
+ +
+
+ From 1816302ba1efb30b54dc60e7b8bcec6f6d8e9351 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 29 Mar 2023 08:49:43 +0200 Subject: [PATCH 04/59] Prepared templates for new XPath tooltips (#133) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/133 --- Frontend/tools/xpath.html | 3730 +++++++------------------------------ 1 file changed, 659 insertions(+), 3071 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 56db7a2..a7e30d1 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -111,248 +111,214 @@ - -
- - - -
- - - [1.0] fn:last() + +
+ + +
-
- Returns the position of the last node in the context list
-
- W3C Documentation reference: Node-Set-Functions + fn:position() +
+ Returns the position of the current context node
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + fn:count(node-set) +
+ Returns the number of nodes in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setNode-set to count nodes in
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:id(object) +
+ Returns the element specified by it's unique id, requires DTD
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:local-name(node-set) +
+ Returns the local-name for the first node in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setExtract first node and return its local name
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:local-name() +
+ Returns the local-name for the context node
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:namespace-uri(node-set) +
+ Returns the namespace-uri for the first node in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
+ + + + + + + + + +
ExpressionResult
namespace-uri(//b:book)http://www.book.com

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:namespace-uri() +
+ Returns the namespace-uri for the context node
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:name(node-set) +
+ Returns the name for the first node in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setExtract first node and return QName
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:name() +
+ Returns the name for the context node
+ Examples:
+ + + + + + + + + +
ExpressionResult
current context nodeExtract first node and return QName

+ W3C Documentation reference: Node-Set-Functions
- - - [1.0] fn:position() -
-
- Returns the position of the current context node
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:count(node-set) -
-
- Returns the number of nodes in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setNode-set to count nodes in
Examples:
- - - - - - - - - - - - - -
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:id(object) -
-
- Returns the element specified by it's unique id, requires DTD
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:local-name(node-set) -
-
- Returns the local-name for the first node in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setExtract first node and return its local name
Examples:
- - - - - - - - - - - - - -
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:local-name() -
-
- Returns the local-name for the context node
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:namespace-uri(node-set) -
-
- Returns the namespace-uri for the first node in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
- - - - - - - - - -
ExpressionResult
namespace-uri(//b:book)http://www.book.com

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:namespace-uri() -
-
- Returns the namespace-uri for the context node
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:name(node-set) -
-
- Returns the name for the first node in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setExtract first node and return QName
Examples:
- - - - - - - - - - - - - -
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:name() -
-
- Returns the name for the context node
- Examples:
- - - - - - - - - -
ExpressionResult
current context nodeExtract first node and return QName

- W3C Documentation reference: Node-Set-Functions -
-
- - - +
-
-
+ +
- [1.0] fn:boolean(object)
-
The boolean function converts its argument to a boolean as follows:
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • @@ -387,47 +353,39 @@
    W3C Documentation reference: Boolean-Functions -
- [1.0] fn:not()
-
The not function returns true if its argument is false, and false otherwise.

W3C Documentation reference: Boolean-Functions -
- [1.0] fn:true()
-
The true function returns true.

W3C Documentation reference: Boolean-Functions -
- [1.0] fn:false()
-
The true function returns false.

W3C Documentation reference: Boolean-Functions -
- [1.0] fn:lang(string)
-
The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
Arguments and return type: @@ -442,568 +400,51 @@
Examples: Look W3C documentation

W3C Documentation reference: Boolean-Functions -
-
-
- - - -
+
+ - - [1.0] fn:string(object) -
-
- Returns the string representation of the object argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringThe object to convert to a string
Examples:
- - - - - - - - - - - - - -
ExpressionResult
string((1<0))false
string(.11)0.11

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:string() -
-
- Returns a string value representation of the context node
-
- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:concat(string, string, string*) -
-
- Returns the concatenation of its arguments
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringString to be merged
stringString to be merged
string*any number of strings
Examples:
- - - - - - - - - - - - - -
ExpressionResult
concat("aa","bb")aabb
concat("aa", 123)aa123

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:starts-with(string, string) -
-
- Returns true if the first string starts with the second string
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be found
Examples:
- - - - - - - - - - - - - -
ExpressionResult
starts-with("aabb", "aa")true
starts-with("aabb", "cc")false

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:contains(string, string) -
-
- Returns true if the first string contains the second string
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be found
Examples:
- - - - - - - - - - - - - -
ExpressionResult
contains("abc", "c")true
contains("abc", "1")false

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring-before(string, string) -
-
- Returns the substring found before the first occurrence of the second argument
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be used to split
Examples:
- - - - - - - - - - - - - -
ExpressionResult
substring-before("aabbcc","bb")aa
substring-before("aabbcc","c")aabb

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring-after(string, string) -
-
- Returns the substring found after the first occurrence of the second argument
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be used to split
Examples:
- - - - - - - - - - - - - -
ExpressionResult
substring-after("aabbcc","bb")cc
substring-after("aabbcc","a")abbcc

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring(string, number, number) -
-
- Returns the substring starting at second argument with lenght of third argument
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringString to be cut
integerStarting position
integerLength of the substring
Examples:
- - - - - - - - - -
ExpressionResult
substring("aabbcc", 1, 2)aa

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring(string, number) -
-
- Returns the substring of the first argument from the position specified by the second - argument
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be cut
integerStarting position
Examples:
- - - - - - - - - -
ExpressionResult
substring("aabbcc", 3)bbcc

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:string-length(string) -
-
- Returns the length of the string specified by the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringString of which length should be returned
Examples:
- - - - - - - - - - - - - -
ExpressionResult
string-length("aabbcc")6
string-length("aa bb cc")8

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:string-length() -
-
- Returns the length of the string specified by the context node
-
- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:normalize-space(string) -
-
- Returns a white-space normalized string
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringString to be normalized
Examples:
- - - - - - - - - - - - - -
ExpressionResult
normalize-space("aa bb cc")aa bb cc
normalize-space("aa bb cc")aa bb cc

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:normalize-space() -
-
- Returns a white-space normalized string specified by the context-node
-
- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:translate(string, string, string) -
-
- Replaces characters specified by the second argument using those from the third argument -
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringString to be edited
stringsequence of characters to be replaced
stringsequence of character to be used in replacement
Examples:
- - - - - - - - - - - - - -
ExpressionResult
translate("aabbcc", "ab","xz")xxzzcc
translate("Test sequence", "e","z")Tzst szquzncz

- W3C Documentation reference: String-Functions -
-
- - - - [2.0] fn:string-join((string,string,...),sep) -
-
- Returns a string created by concatenating the string arguments and using the sep - argument as the separator
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
string*string sequence to be joined
stringseparator to be used
Examples:
- - - - - - - - - - - - - -
ExpressionResult
string-join(('fox', 'jumps', 'over', 'dog'), ' ')' fox jumps over dog '
string-join(('fox', 'jumps', 'over', 'dog'))'joxjumpsoverdog'

- W3C Documentation reference: #func-string-join -
-
+ +
+ + - - - [3.0] fn:string-to-codepoints(string) +
+ + + fn:last()
-
- Returns sequence of unicode codepoint representing the provided string
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringstring to be coverted to list of unicode values
Examples:
- - - - - - - - - -
ExpressionResult
string-to-codepoints("test")(116, 101, 115, 116)

- W3C Documentation reference: #func-string-to-codepoints -
+ Returns the position of the last node in the context list
+
+ W3C Documentation reference: Node-Set-Functions
+ + + +
+
+
+ + - - - [2.0] fn:compare(comp1,comp2) +
+ + + fn:boolean(object)
-
- Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 - is greater than comp2 (according to the rules of the collation that is used)
+ The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • +
+ Arguments and return type: @@ -1011,12 +452,8 @@ - - - - - - + +
Description
stringfirst parameter to be compared
stringsecond parameter to be comparedobjectThe object to convert to a boolean
Examples:
@@ -1025,541 +462,123 @@ - - - - - - - - - - - - - - - -
Result
compare('abc', 'abc')0
compare('abc', 'abd')-1
compare('abc1', 'abd')-1
compare("abc1","abc")1

- W3C Documentation reference: #func-compare -
-
- - - - [2.0] fn:compare(comp1,comp2,collation) -
-
- Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 - is greater than comp2 (according to the rules of the collation that is used)
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringfirst parameter to be compared
stringsecond parameter to be compared
stringcollation to be used in comparison(letter weight may differ between - languages)
Examples:
- - - - - - - - - -
ExpressionResult
compare('ghi', 'ghi')0

- W3C Documentation reference: #func-compare -
-
-
- - - [2.0] fn:codepoints-to-string((int,int,...)) -
-
- Creates a string from a sequence of the Unicode Standard code points
- Arguments and return type: - - - - - - - - - -
TypeDescription
int*int sequence to be converted to string
Examples:
- - - - - - - - - -
ExpressionResult
codepoints-to-string((116, 101, 115, 116))'test'

- W3C Documentation reference: #func-codepoints-to-string -
-
-
- - - [2.0] fn:codepoint-equal(comp1,comp2) -
-
- Returns true if the value of comp1 is equal to the value of comp2, according to the - Unicode code point collation - (http://www.w3.org/2005/02/xpath-functions/collation/codepoint), otherwise it - returns false
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
intunicode codepoint
intunicode codepoint
Examples:
- - - - - - - + - - - - - - - -
ExpressionResult
codepoint-equal(111, 111)boolean("Release11") true
codepoint-equal(111, 112)false
codepoint-equal("111F", "111F")true

- W3C Documentation reference: #func-codepoint-equal -
-
-
- - - [2.0] fn:normalize-unicode() -
-
- NONE
-
- W3C Documentation reference: #func-normalize-unicode -
-
-
- - - [2.0] fn:upper-case(string) -
-
- Converts the string argument to upper-case
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringstring to be converted to upper case
Examples:
- - - - - - - - - -
ExpressionResult
upper-case('aabbCC')'AABBCC'

- W3C Documentation reference: #func-upper-case -
-
-
- - - [2.0] fn:lower-case(string) -
-
- Converts the string argument to lower-case
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringstring to be converted to upper case
Examples:
- - - - - - - - - -
ExpressionResult
lower-case('aabbCC')'aabbcc'

- W3C Documentation reference: #func-lower-case -
-
-
- - - [2.0] fn:escape-uri(stringURI,esc-res) -
-
- https://www.w3.org/TR/xpath-functions/#func-escape-uri
-
- W3C Documentation reference: #func-escape-uri -
-
-
- - - [2.0] fn:tokenize(string,pattern) -
-
- https://www.w3.org/TR/xpath-functions/#func-tokenize
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringstring to be tokenized
stringstring to be used to split the first argument
Examples:
- - - - - - - - - -
ExpressionResult
tokenize("fox jumps over dog", "s+")("fox", "jumps", "over", "dog")

- W3C Documentation reference: #func-tokenize -
-
-
- - - [2.0] fn:matches(string,pattern) -
-
- Returns true if the string argument matches the pattern, otherwise, it returns false -
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringstring to search in
stringpattern to be found
Examples:
- - - - - - - - - - - +
ExpressionResult
matches("Xpath", "pat")true
matches("Xpath", "abc")boolean("") false

- W3C Documentation reference: #func-matches -
+ W3C Documentation reference: Boolean-Functions
-
- - - [2.0] fn:replace(string,pattern,replace) -
-
- Returns a string that is created by replacing the given pattern with the replace - argument
-
- W3C Documentation reference: #func-replace -
-
-
- - - [2.0] fn:ends-with(string1,string2) -
-
- Returns true if string1 ends with string2, otherwise it returns false
-
- W3C Documentation reference: #func-ends-with -
-
-
- - + + + +
-
-
- - - -
- - - [1.0] fn:number(object) +
+ + +
-
- The number function converts its argument to a number as follows: -
    -
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • -
  • boolean true is converted to 1; boolean false is converted to 0
  • -
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • -
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a number
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Numeric-Functions + + + fn:string(object) +
+ Returns the string representation of the object argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference: String-Functions
+ + +
- - - - [1.0] fn:sum(node-set) -
-
- The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
-
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setSet of nodes whose values will be summed.
- Examples:
- - - - - - - - - -
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

- W3C Documentation reference: Numeric-Functions -
-
- - - [1.0] fn:floor(number) -
-
- The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
-
- Arguments and return type: - - - - - - - - - -
TypeDescription
numberNumber to convert
- Examples:
- - - - - - - - - -
ExpressionResult
floor(2.55)2
- W3C Documentation reference: Numeric-Functions -
-
- - - [1.0] fn:ceiling(number) -
-
- The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
-
- Arguments and return type: - - - - - - - - - -
TypeDescription
numberNumber to convert
- Examples:
- - - - - - - - - -
ExpressionResult
ceiling(2.55)3
- W3C Documentation reference: Numeric-Functions -
-
- - [1.0] fn:round(number) -
-
- The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned.
- - NOTE: For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
- Arguments and return type: - - - - - - - - - -
TypeDescription
numberNumber to convert
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
round(2.55)3
round(2.35)2

- W3C Documentation reference: Numeric-Functions -
-
- -
-
-
- - - -
- +
+ + + +
+ + + fn:number(object) +
+ The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • +
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
boolean("Release11")true
boolean("")false

+ W3C Documentation reference: Numeric-Functions +
+ + +
+
+
- [2.0] Collections + +
+ + fn:avg((arg,arg,...))
-
Returns the average of the argument values
Arguments and return type: @@ -1583,441 +602,129 @@

W3C Documentation reference: #func-avg -
- - - - [2.0] fn:exactly-one(item,item,...) -
-
- Returns the argument if it contains exactly one item, otherwise it raises an error -
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequencesequence to check
Examples:
- - - - - - - - - - - - - -
ExpressionResult
exactly-one((1))1
exactly-one((1,1))fn:exactly-one called with a sequence containing zero or more than one - item.

- W3C Documentation reference: #func-exactly-one -
-
-
- - - [2.0] fn:zero-or-one(item,item,...) -
-
- Returns the argument if it contains zero or one items, otherwise it raises an error -
-
- W3C Documentation reference: #func-zero-or-one -
-
-
- - - [2.0] fn:index-of((item,item,...),searchitem) -
-
- Returns the positions within the sequence of items that are equal to the searchitem - argument
-
- W3C Documentation reference: #func-index-of -
-
-
- - - [2.0] fn:reverse((item,item,...)) -
-
- Returns the reversed order of the items specified
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence of elements to have its order reversed
Examples:
- - - - - - - - - - - - - -
ExpressionResult
reverse(("ab", "cd", "ef"))("ef", "cd", "ab")
reverse(("ab"))("ab")

- W3C Documentation reference: #func-reverse -
-
-
- - - [2.0] fn:one-or-more(item,item,...) -
-
- Returns the argument if it contains one or more items, otherwise it raises an error -
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequencesequence to check
Examples:
- - - - - - - - - - - - - -
ExpressionResult
one-or-more((1, 2, 3))1 2 3
one-or-more()An empty sequence is not allowed as the first argument of - fn:one-or-more()

- W3C Documentation reference: #func-one-or-more -
-
-
- - - [2.0] fn:distinct-values((item,item,...),collation) -
-
- Returns only distinct (different) values
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequencesequence to extract distinct values from
Examples:
- - - - - - - - - -
ExpressionResult
distinct-values((1, 2, 3, 1, 2))(1, 2, 3)

- W3C Documentation reference: #func-distinct-values -
-
-
- - - [2.0] fn:exists(item,item,...) -
-
- Returns true if the value of the arguments IS NOT an empty sequence, otherwise it - returns false
-
- W3C Documentation reference: #func-exists -
-
-
- - - [2.0] fn:subsequence((item,item,...),start,len) -
-
- Returns a sequence of items from the position specified by the start argument and - continuing for the number of items specified by the len argument. The first item is - located at position 1
-
- W3C Documentation reference: #func-subsequence -
-
-
- - - [2.0] fn:empty(item,item,...) -
-
- Returns true if the value of the arguments IS an empty sequence, otherwise it - returns false
-
- W3C Documentation reference: #func-empty -
-
-
- - - [2.0] fn:insert-before((item,item,...),pos,inserts) -
-
- Returns a new sequence constructed from the value of the item arguments
-
- W3C Documentation reference: #func-insert-before -
-
-
- - - [2.0] fn:remove((item,item,...),position) -
-
- Returns a new sequence constructed from the value of the item arguments
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
sequence*sequence to be modified
integerposition to insert element from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
remove(("a","b","c"), 1)b c
remove(("a","b","c"), 0)a b c

- W3C Documentation reference: #func-remove -
-
-
- - - [2.0] fn:unordered((item,item,...)) -
-
- Returns the items in an implementation dependent order
-
- W3C Documentation reference: #func-unordered -
-
-
- - - [2.0] fn:data(item.item,...) -
-
- Takes a sequence of items and returns a sequence of atomic values
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence to be split to atomic values
Examples:
- - - - - - - - - -
ExpressionResult
data((1,2,23, "test"))1 2 23 test

- W3C Documentation reference: #func-data -
-
-
- - - [2.0] fn:collection() -
-
- NONE
-
- W3C Documentation reference: #func-collection -
-
-
- - - [2.0] fn:collection(string) -
-
- NONE
-
- W3C Documentation reference: #func-collection -
-
-
- - - [2.0] fn:min((arg,arg,...)) -
-
- Returns the argument that is less than the others
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence to select minimum from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
min((1,2,3))1
min(('a', 'k'))'a'

- W3C Documentation reference: #func-min -
-
-
- - - [2.0] fn:max((arg,arg,...)) -
-
- Returns the argument that is greater than the others
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence to select maximum from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
max((1,2,3))3
max(('a', 'k'))'k'

- W3C Documentation reference: #func-max -
-
-
- - - [2.0] fn:deep-equal(param1,param2,collation) -
-
- Returns true if param1 and param2 are deep-equal to each other, otherwise it returns - false
-
- W3C Documentation reference: #func-deep-equal -
-
-
- - +
-
-
- - - -
+
- [2.0] fn:adjust-date-to-timezone(date,timezone) + + +
+ + fn:adjust-date-to-timezone(date,timezone) +
+ If the timezone argument is empty, it returns a date without a timezone. Otherwise, + it returns a date with a timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
datedate to be adjusted
timezonetimezone to be imposed into date
Examples:
+ + + + + + + + + +
ExpressionResult
adjust-date-to-timezone(xs:date('2011-11-15'), + xs:dayTimeDuration("PT10H"))2011-11-15+10:00

+ W3C Documentation reference: #func-adjust-date-to-timezone +
+ + +
+
+
+ + + +
+ + fn:error() +
+ https://www.w3.org/TR/xpath-functions/#func-error
+
+ W3C Documentation reference: #func-error +
+ + +
+
+
+ + + +
+ + + fn:nilled(node) +
+ + Returns a Boolean value indicating whether the argument node is nilled
+
+ W3C Documentation reference: #func-nilled +
+ + +
+
+ + + +
+ + + +
+ + + fn:last()
-
- If the timezone argument is empty, it returns a date without a timezone. Otherwise, - it returns a date with a timezone
+ Returns the position of the last node in the context list
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + +
+
+
+ + + +
+ + + fn:boolean(object) +
+ The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • +
+ Arguments and return type: @@ -2025,12 +732,8 @@ - - - - - - + +
Description
datedate to be adjusted
timezonetimezone to be imposed into dateobjectThe object to convert to a boolean
Examples:
@@ -2039,35 +742,91 @@ - - + + + + + +
Result
adjust-date-to-timezone(xs:date('2011-11-15'), - xs:dayTimeDuration("PT10H"))2011-11-15+10:00boolean("Release11")true
boolean("")false

- W3C Documentation reference: #func-adjust-date-to-timezone -
+ W3C Documentation reference: Boolean-Functions
+ + +
+
+
+ + - - - [2.0] fn:adjust-time-to-timezone(time,timezone) +
+ + + fn:string(object)
-
- If the timezone argument is empty, it returns a time without a timezone. Otherwise, - it returns a time with a timezone
-
- W3C Documentation reference: #func-adjust-time-to-timezone -
+ Returns the string representation of the object argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference: String-Functions
+ + +
+
+
+ + - - - [2.0] fn:implicit-timezone() +
+ + + fn:number(object)
-
- Returns the value of the implicit timezone
+ The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • +
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
Examples:
@@ -2075,1305 +834,131 @@ - - + + + + + +
Result
implicit-timezone()PT1Hboolean("Release11")true
boolean("")false

- W3C Documentation reference: #func-implicit-timezone -
+ W3C Documentation reference: Numeric-Functions
- - - - [2.0] fn:dateTime(date,time) -
-
- Converts the arguments to a date and a time
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
datedate to be merged into dateTime
timetime to be merged into dateTime
Examples:
- - - - - - - - - -
ExpressionResult
dateTime(xs:date("2011-11-15"), xs:time("10:22:00"))2011-11-15T10:22:00

- W3C Documentation reference: #func-dateTime -
-
-
- - - [2.0] fn:current-time() -
-
- Returns the current time (with timezone)
- Examples:
- - - - - - - - - -
ExpressionResult
current-time()11:48:04.393361+01:00

- W3C Documentation reference: #func-current-time -
-
-
- - - [2.0] fn:timezone-from-time(time) -
-
- Returns the time zone component of the argument if any
- Arguments and return type: - - - - - - - - - -
TypeDescription
timetime to extract timezone infromation from
Examples:
- - - - - - - - - -
ExpressionResult
timezone-from-time(xs:time("10:22:00+10:00"))PT10H

- W3C Documentation reference: #func-timezone-from-time -
-
-
- - - [2.0] fn:hours-from-time(time) -
-
- Returns an integer that represents the hours component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
timetime to extact hours component from
Examples:
- - - - - - - - - -
ExpressionResult
hours-from-time(xs:time("10:22:00"))10

- W3C Documentation reference: #func-hours-from-time -
-
-
- - - [2.0] fn:minutes-from-time(time) -
-
- Returns an integer that represents the minutes component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
timetime to extract minutes component from
Examples:
- - - - - - - - - -
ExpressionResult
minutes-from-time(xs:time("10:22:00"))22

- W3C Documentation reference: #func-minutes-from-time -
-
-
- - - [2.0] fn:seconds-from-time(time) -
-
- Returns an integer that represents the seconds component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
timeTime to convert to seconds
Examples:
- - - - - - - - - -
ExpressionResult
seconds-from-time(xs:time("10:22:00"))0

- W3C Documentation reference: #func-seconds-from-time -
-
-
- - - [2.0] fn:years-from-duration(datetimedur) -
-
- Returns an integer that represents the years component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract years component from
Examples:
- - - - - - - - - -
ExpressionResult
years-from-duration(xs:duration("P5Y2DT10H59M"))5

- W3C Documentation reference: #func-years-from-duration -
-
-
- - - [2.0] fn:months-from-duration(datetimedur) -
-
- Returns an integer that represents the months component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract months component from
Examples:
- - - - - - - - - -
ExpressionResult
months-from-duration(xs:duration("P5Y10M2DT10H59M"))10

- W3C Documentation reference: #func-years-from-duration -
-
-
- - - [2.0] fn:days-from-duration(datetimedur) -
-
- Returns an integer that represents the days component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract days component from
Examples:
- - - - - - - - - -
ExpressionResult
days-from-duration(xs:duration("P5Y2DT10H59M"))2

- W3C Documentation reference: #func-days-from-duration -
-
-
- - - [2.0] fn:hours-from-duration(datetimedur) -
-
- Returns an integer that represents the hours component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract hours component from
Examples:
- - - - - - - - - -
ExpressionResult
hours-from-duration(xs:duration("P5Y2DT10H59M"))10

- W3C Documentation reference: #func-hours-from-duration -
-
-
- - - [2.0] fn:minutes-from-duration(datetimedur) -
-
- Returns an integer that represents the minutes component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract minute component from
Examples:
- - - - - - - - - -
ExpressionResult
years-from-duration(xs:duration("P5Y2DT10H59M"))59

- W3C Documentation reference: #func-minutes-from-duration -
-
-
- - - [2.0] fn:seconds-from-duration(datetimedur) -
-
- Returns a decimal that represents the seconds component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract seconds component from
Examples:
- - - - - - - - - -
ExpressionResult
days-from-duration(xs:duration("P5Y2DT10H59M40S"))40

- W3C Documentation reference: #func-seconds-from-duration -
-
-
- - - [2.0] fn:current-date() -
-
- Returns the current date (with timezone)
-
- W3C Documentation reference: #func-current-date -
-
-
- - - [2.0] fn:timezone-from-date(date) -
-
- Returns the time zone component of the argument if any
- Arguments and return type: - - - - - - - - - -
TypeDescription
datedate to extract timezone information from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
timezone-from-date(xs:date("2011-11-15+11:00"))PT1H
timezone-from-date(xs:date("2011-11-15+11:00"))PT11H

- W3C Documentation reference: #func-timezone-from-date -
-
-
- - - [2.0] fn:year-from-date(date) -
-
- Returns an integer that represents the year in the localized value of the argument -
- Arguments and return type: - - - - - - - - - -
TypeDescription
datedate to extract years component from
Examples:
- - - - - - - - - -
ExpressionResult
year-from-date(xs:date("2011-11-15"))2011

- W3C Documentation reference: #func-year-from-date -
-
-
- - - [2.0] fn:month-from-date(date) -
-
- Returns an integer that represents the month in the localized value of the argument -
- Arguments and return type: - - - - - - - - - -
TypeDescription
dateDate to extrat the month from
Examples:
- - - - - - - - - -
ExpressionResult
month-from-date(xs:date("2011-11-15"))11

- W3C Documentation reference: #func-month-from-date -
-
-
- - - [2.0] fn:day-from-date(date) -
-
- Returns an integer that represents the day in the localized value of the argument -
- Arguments and return type: - - - - - - - - - -
TypeDescription
datedate to extact day component from
Examples:
- - - - - - - - - -
ExpressionResult
day-from-date(xs:date("2011-04-23"))23

- W3C Documentation reference: #func-day-from-date -
-
-
- - - [2.0] fn:current-dateTime() -
-
- Returns the current dateTime (with timezone)
- Examples:
- - - - - - - - - -
ExpressionResult
current-dateTime()2021-03-24T18:15:09.808+01:00

- W3C Documentation reference: #func-current-dateTime -
-
-
- - - [2.0] fn:timezone-from-dateTime(datetime) -
-
- Returns the time zone component of the argument if any
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimeDateTime to extract fimezone information from
Examples:
- - - - - - - - - -
ExpressionResult
timezone-from-dateTime(xs:dateTime("2021-01-15T12:10:00-03:00"))-PT3H

- W3C Documentation reference: #func-timezone-from-dateTime -
-
-
- - - [2.0] fn:year-from-dateTime(datetime) -
-
- Returns an integer that represents the year component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract years component from
Examples:
- - - - - - - - - -
ExpressionResult
year-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))2011

- W3C Documentation reference: #func-year-from-dateTime -
-
-
- - - [2.0] fn:month-from-dateTime(datetime) -
-
- Returns an integer that represents the month component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract month component from
Examples:
- - - - - - - - - -
ExpressionResult
month-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))11

- W3C Documentation reference: #func-month-from-dateTime -
-
-
- - - [2.0] fn:day-from-dateTime(datetime) -
-
- Returns an integer that represents the day component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract day component from
Examples:
- - - - - - - - - -
ExpressionResult
day-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))15

- W3C Documentation reference: #func-day-from-dateTime -
-
-
- - - [2.0] fn:hours-from-dateTime(datetime) -
-
- Returns an integer that represents the hours component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract hours component from
Examples:
- - - - - - - - - -
ExpressionResult
hours-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))12

- W3C Documentation reference: #func-hours-from-dateTime -
-
-
- - - [2.0] fn:minutes-from-dateTime(datetime) -
-
- Returns an integer that represents the minutes component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract minutes component from
Examples:
- - - - - - - - - -
ExpressionResult
minutes-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))30

- W3C Documentation reference: #func-minutes-from-dateTime -
-
-
- - - [2.0] fn:seconds-from-dateTime(datetime) -
-
- Returns a decimal that represents the seconds component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract seconds component from
Examples:
- - - - - - - - - -
ExpressionResult
seconds-from-dateTime(xs:dateTime("2011-11-15T12:30:00-04:10"))0

- W3C Documentation reference: #func-seconds-from-dateTime -
-
-
- - - [2.0] fn:adjust-dateTime-to-timezone(datetime,timezone) -
-
- If the timezone argument is empty, it returns a dateTime without a timezone. - Otherwise, it returns a dateTime with a timezone
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
datetimedatetime to be adjusted
timezonetimezone to be used in provided date
Examples:
- - - - - - - - - -
ExpressionResult
adjust-dateTime-to-timezone(xs:dateTime('2011-11-15T12:30:00-04:10'), - xs:dayTimeDuration("PT10H"))2011-11-16T02:40:00+10:00

- W3C Documentation reference: #func-adjust-dateTime-to-timezone -
-
-
- - + + +
-
-
- - - -
- - - [2.0] fn:error() -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error -
-
+
+ + - - - [2.0] fn:error(error) -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error +
+ + + fn:adjust-date-to-timezone(date,timezone) +
+ If the timezone argument is empty, it returns a date without a timezone. Otherwise, + it returns a date with a timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
datedate to be adjusted
timezonetimezone to be imposed into date
Examples:
+ + + + + + + + + +
ExpressionResult
adjust-date-to-timezone(xs:date('2011-11-15'), + xs:dayTimeDuration("PT10H"))2011-11-15+10:00

+ W3C Documentation reference: #func-adjust-date-to-timezone
-
- - - - [2.0] fn:error(error,description) -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error -
-
-
- - - [2.0] fn:error(error,description,error-object) -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error -
-
-
- - - [2.0] fn:trace(value,label) -
-
- Used to debug queries
-
- W3C Documentation reference: #func-trace -
-
-
- - + + + + + +
-
-
- - - -
- - - [2.0] fn:nilled(node) -
-
- Returns a Boolean value indicating whether the argument node is nilled
-
- W3C Documentation reference: #func-nilled -
-
+
+ + - - - [2.0] fn:namespace-uri-from-QName() -
-
- NONE
-
- W3C Documentation reference: #func-namespace-uri-from-QName +
+ + + fn:error() +
+ https://www.w3.org/TR/xpath-functions/#func-error
+
+ W3C Documentation reference: #func-error
-
- - - - [2.0] fn:base-uri() -
-
- Returns the value of the base-uri property of the current or specified node
-
- W3C Documentation reference: #func-base-uri -
-
-
- - - [2.0] fn:base-uri(node) -
-
- Returns the value of the base-uri property of the current or specified node
-
- W3C Documentation reference: #func-base-uri -
-
-
- - - [2.0] fn:static-base-uri() -
-
- Returns the value of the base-uri
- Examples:
- - - - - - - - - -
ExpressionResult
default-collation()http://www.w3.org/2005/xpath-functions/collation/codepoint

- W3C Documentation reference: #func-static-base-uri -
-
-
- - - [2.0] fn:doc-available(URI) -
-
- Returns true if the doc() function returns a document node, otherwise it returns - false
-
- W3C Documentation reference: #func-doc-available -
-
-
- - - [2.0] fn:resolve-QName() -
-
- NONE
-
- W3C Documentation reference: #func-resolve-QName -
-
-
- - - [2.0] fn:node-name(node) -
-
- Returns the node-name of the argument node
-
- W3C Documentation reference: #func-node-name -
-
-
- - - [2.0] fn:default-collation() -
-
- Returns the value of the default collation
-
- W3C Documentation reference: #func-default-collation -
-
-
- - - [2.0] fn:idref((string,string,...),node) -
-
- Returns a sequence of element or attribute nodes that have an IDREF value equal to - the value of one or more of the values specified in the string argument
-
- W3C Documentation reference: #func-idref -
-
-
- - - [2.0] fn:document-uri(node) -
-
- Returns the value of the document-uri property for the specified node
-
- W3C Documentation reference: #func-document-uri -
-
-
- - - [2.0] fn:local-name-from-QName() -
-
- NONE
-
- W3C Documentation reference: #func-local-name-from-QName -
-
-
- - - [2.0] fn:in-scope-prefixes() -
-
- NONE
-
- W3C Documentation reference: #func-in-scope-prefixes -
-
-
- - - [2.0] fn:namespace-uri-for-prefix() -
-
- NONE
-
- W3C Documentation reference: #func-namespace-uri-for-prefix -
-
-
- - - [2.0] fn:QName() -
-
- NONE
-
- W3C Documentation reference: #func-QName -
-
-
- - - [2.0] fn:root() fn:root(node) -
-
- Returns the root of the tree to which the current node or the specified belongs. - This will usually be a document node
-
- W3C Documentation reference: #func-root -
-
-
- - - [2.0] fn:doc(URI) -
-
- NONE
-
- W3C Documentation reference: #func-doc -
-
-
- - - [2.0] fn:resolve-uri(relative,base) -
-
- NONE
-
- W3C Documentation reference: #func-resolve-uri -
-
-
- - - [3.0] fn:available-environment-variables() -
-
- Returns a list of environment variable names
-
- W3C Documentation reference: #func-available-environment-variables -
-
-
- - - [3.0] fn:doc-available(uri) -
-
- The function returns true the function call fn:doc(uri) would return a document node -
-
- W3C Documentation reference: #func-doc-available -
-
-
- - - [3.0] fn:element-with-id() -
-
- https://www.w3.org/TR/xpath-functions-31/#func-element-with-id
-
- W3C Documentation reference: #func-element-with-id -
-
-
- - - [3.0] fn:encode-for-uri(uri-part) -
-
- Encodes reserved characters in a string that is intended to be used in the path - segment of a URI.
-
- W3C Documentation reference: #func-encode-for-uri -
-
-
- - - [3.0] fn:environment-variable(name) -
-
- Returns the value of a system environment variable, if it exists
-
- W3C Documentation reference: #func-environment-variable -
-
-
- - - [3.0] fn:escape-html-uri(uri) -
-
- Escapes a URI in the same way that HTML user agents handle attribute values expected - to contain URIs
-
- W3C Documentation reference: #func-escape-html-uri -
-
-
- - - [3.0] fn:iri-to-uri(iri) -
-
- Converts a string containing an IRI into a URI
-
- W3C Documentation reference: #func-iri-to-uri -
-
-
- - + + + + + +
-
- - -
- - - -
- - [3.0] fn:for-each(sequence*, function) -
-
- Applies function item to every element in sequence
-
- W3C Documentation reference: #func-for-each -
-
+
+ + - - - [3.0] fn:for-each-pair(sequence*, sequence*, function) -
-
- Applies the function to consecutive pairs of elements taken from sequences
-
- W3C Documentation reference: #func-for-each-pair +
+ + + fn:nilled(node) +
+ Returns a Boolean value indicating whether the argument node is nilled
+
+ W3C Documentation reference: #func-nilled +
-
- - - - [3.0] fn:fold-left(sequence*, baseValue, function) -
-
- Applies function item to every element in sequence, accumulating value
-
- W3C Documentation reference: #func-fold-left -
-
-
- - - [3.0] fn:fold-right() -
-
- Applies function item to every element in sequence, accumulating value
-
- W3C Documentation reference: #func-fold-right -
-
-
- - - [3.0] fn:filter(sequence*, function) -
-
- Returns those items from the sequence for which the supplied function returns true
-
- W3C Documentation reference: #func-filter -
-
-
+ + + + + +
-
+ +
+ + + +
+ + fn:for-each(sequence*, function) +
+ Applies function item to every element in sequence
+
+ W3C Documentation reference: #func-for-each +
+ + + +
+
+
@@ -3414,24 +999,27 @@ if (filter == "collapse3.0") { - document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0, 2.0 & 3.0 functions"; - showList(document.getElementsByName("collapse20")); + document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.0 functions"; + hideList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); showList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); } else if (filter == "collapse3.1") { - document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0, 2.0, 3.0 & 3.1 functions"; - showList(document.getElementsByName("collapse20")); - showList(document.getElementsByName("collapse30")); + document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.1 functions"; + hideList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); + hideList(document.getElementsByName("collapse30")); showList(document.getElementsByName("collapse31")); - - } else if (filter == "collapse2.0") { - document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 & 2.0 functions"; + } else if (filter == "collapse2.0"){ + document.getElementById("tooltipFunctionInfo").innerText = "XPath 2.0 functions"; + hideList(document.getElementsByName("collapse10")); showList(document.getElementsByName("collapse20")); hideList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); } else { document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 functions"; + showList(document.getElementsByName("collapse10")); hideList(document.getElementsByName("collapse20")); hideList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); From 02f1977ff001611b471ae7d8e48e0e5dd94d7dd9 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 6 Apr 2023 11:53:53 +0200 Subject: [PATCH 05/59] Added tooltips for XPath 2.0 (#134) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/134 --- Frontend/tools/xpath.html | 4365 +++++++++++++++++++++++++++++++++++-- 1 file changed, 4179 insertions(+), 186 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index a7e30d1..065d4a9 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -127,10 +127,10 @@ fn:count(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:count()
Returns the number of nodes in the node-set
- Arguments and return type: + Arguments: @@ -161,7 +161,7 @@ fn:id(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:id()
Returns the element specified by it's unique id, requires DTD

@@ -171,10 +171,10 @@ fn:local-name(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:local-name()
Returns the local-name for the first node in the node-set
- Arguments and return type: + Arguments:
Type
@@ -215,10 +215,10 @@ fn:namespace-uri(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:namespace-uri()
Returns the namespace-uri for the first node in the node-set
- Arguments and return type: + Arguments:
Type
@@ -255,17 +255,17 @@ fn:name(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:name()
Returns the name for the first node in the node-set
- Arguments and return type: + Arguments:
Type
- +
Type Description
node-setnode-set (Optional) Extract first node and return QName
Examples:
@@ -285,27 +285,6 @@
W3C Documentation reference: Node-Set-Functions
- - - - fn:name() -
- Returns the name for the context node
- Examples:
- - - - - - - - - -
ExpressionResult
current context nodeExtract first node and return QName

- W3C Documentation reference: Node-Set-Functions -
-
@@ -317,7 +296,7 @@ fn:boolean(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:boolean()
The boolean function converts its argument to a boolean as follows:
    @@ -327,7 +306,7 @@
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
- Arguments and return type: + Arguments: @@ -384,10 +363,10 @@ fn:lang(string) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:lang()
The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
- Arguments and return type: + Arguments:
Type
@@ -416,14 +395,462 @@ fn:last() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:name()
- Returns the position of the last node in the context list
-
- W3C Documentation reference: Node-Set-Functions + Returns the name of a node, as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName.
+ + If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ + If the argument is supplied and is the empty sequence, the function returns the zero-length string.
+ + If the target node has no name (that is, if it is a document node, a comment, a text node, or a namespace binding having no name), the function returns the zero-length string.
+ + Otherwise, the value returned is fn:string(fn:node-name($arg)).
+
+ Arguments: +
Type
+ + + + + + + + +
TypeDescription
node?Node to display name.
+ Return type: xs:string

+ + Examples: + + + + + + + + + +
QueryResult
name(/l:library)l:library

+ W3C Documentation reference +
+ + fn:local-name() +
+ Returns the local part of the name of $arg as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName.
+ + If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ + If the argument is supplied and is the empty sequence, the function returns the zero-length string.
+ + If the target node has no name (that is, if it is a document node, a comment, or a text node), the function returns the zero-length string.
+ + Otherwise, the value returned will be the local part of the expanded-QName of the target node (as determined by the dm:node-name accessor in Section 5.11 node-name Accessor). This will be an xs:string whose lexical form is an xs:NCName.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node to display local-name.
+ Return type: xs:string

+ Examples: + + + + + + + + + +
QueryResult
name(/l:library)library

+ + W3C Documentation reference +
+ + fn:nilled() +
+ Returns an xs:boolean indicating whether the argument node is "nilled". If the argument is not an element node, returns the empty sequence. If the argument is the empty sequence, returns the empty sequence.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node to test.
+ Return type: xs:boolean?

+ Examples: + + + + + + + + + +
QueryResult
nilled(/l:library)false

+ + W3C Documentation reference +
+ + fn:base-uri() +
+ Returns the value of the base-uri URI property for $arg as defined by the accessor function dm:base-uri() for that kind of node in Section 5.2 base-uri AccessorDM. If $arg is not specified, the behavior is identical to calling the function with the context item (.) as argument. The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + Document, element and processing-instruction nodes have a base-uri property which may be empty. The base-uri property of all other node types is the empty sequence. The value of the base-uri property is returned if it exists and is not empty. Otherwise, if the node has a parent, the value of dm:base-uri() applied to its parent is returned, recursively. If the node does not have a parent, or if the recursive ascent up the ancestor chain encounters a node whose base-uri property is empty and it does not have a parent, the empty sequence is returned.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node to find base URI of.
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + +
QueryResult
base-uri(/l:library/l:libraryName)<empty sequence>

+ + W3C Documentation reference +
+ + fn:document-uri() +
+ Returns the value of the document-uri property for $arg as defined by the dm:document-uri accessor function defined in Section 6.1.2 AccessorsDM.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + Returns the empty sequence if the node is not a document node. Otherwise, returns the value of the dm:document-uri accessor of the document node.
+ + In the case of a document node $D returned by the fn:doc function, or a document node at the root of a tree containing a node returned by the fn:collection function, it will always be true that either fn:document-uri($D) returns the empty sequence, or that the following expression is true: fn:doc(fn:document-uri($D)) is $D. It is implementation-defined whether this guarantee also holds for document nodes obtained by other means, for example a document node passed as the initial context node of a query or transformation.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node which document-uri value needs to be returned.
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + + + + + + + + + +
QueryResult
document-uri(/l:library/l:libraryName)<empty sequence>
document-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the document URI of the first fiction:book element is "http://example.com/library.xml")
document-uri(/library)http://example.com/library.xml (assuming the document URI of the library element is "http://example.com/library.xml")

+ + W3C Documentation reference +
+ + fn:lang() +
+ This function tests whether the language of $node, or the context item if the second argument is omitted, as specified by xml:lang attributes is the same as, or is a sublanguage of, the language specified by $testlang. The behavior of the function if the second argument is omitted is exactly the same as if the context item (.) had been passed as the second argument. The language of the argument node, or the context item if the second argument is omitted, is determined by the value of the xml:lang attribute on the node, or, if the node has no such attribute, by the value of the xml:lang attribute on the nearest ancestor of the node that has an xml:lang attribute. If there is no such ancestor, then the function returns false

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$testlang
node()$node (Optional)
+ Return type: xs:boolean?

+ Examples: Look W3C documentation below. +
+ + W3C Documentation reference +
+ + fn:root() +
+ Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + If $arg is a document node, $arg is returned.
+ + If the function is called without an argument, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]; if the context item is not a node [err:XPTY0004].

+ + Arguments: + + + + + + + + + +
TypeDescription
node()$arg (Optional)
+ Return type: node()?

+ Examples: + + + + + + + + + +
QueryResult
root()<l:library>[...]</l:library>

+ + W3C Documentation reference +
+ + fn:count() +
+ Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:integer

+ Examples: + + + + + + + + + + + + + +
QueryResult
count(/l:library/l:readerList/p:person)2
count(/l:library/l:writers)0

+ + W3C Documentation reference +
+ + + fn:avg() +
+ Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
+ Return type: xs:anyAtomicType

+ Examples: + + + + + + + + + +
QueryResult
avg(/l:library/l:readerList/p:person/p:readerID)6222

+ + W3C Documentation reference +
+ + + fn:max() +
+ Selects an item from the input sequence $arg whose value is greater than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is ·implementation dependent·.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:string$collation (Optional)
+ Return type: xs:anyAtomicType?

+ Examples: + + + + + + + + + + + + + +
QueryResult
max((3,4,5))5
max((5, 5.0e0))5.0e0

+ + W3C Documentation reference +
+ + fn:min() +
+ Selects an item from the input sequence $arg whose value is less than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is ·implementation dependent·.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:string$collation (Optional)
+ Return type: xs:anyAtomicType?

+ Examples: + + + + + + + + + + + + + +
QueryResult
min((3,4,5))3
min((5, 5.0e0))5.0e0

+ + W3C Documentation reference +
+ + + fn:sum() +
+ Returns a value obtained by adding together the values in $arg. If $zero is not specified, then the value returned for an empty sequence is the xs:integer value 0. If $zero is specified, then the value returned for an empty sequence is $zero.
+ + Any values of type xs:untypedAtomic in $arg are cast to xs:double. The items in the resulting sequence may be reordered in an arbitrary order. The resulting sequence is referred to below as the converted sequence.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:anyAtomicType?$zero (Optional)
+ Return type: xs:anyAtomicType?

+ Examples: + + + + + + + + + +
QueryResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

+ + W3C Documentation reference
- -
@@ -435,44 +862,134 @@ fn:boolean(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:boolean()
- The boolean function converts its argument to a boolean as follows: -
    -
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • -
  • a node-set is true if and only if it is non-empty
  • -
  • a string is true if and only if its length is non-zero
  • -
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a boolean
Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Boolean-Functions + Computes the effective boolean value of the sequence $arg. See Section 2.4.3 Effective Boolean ValueXP
+ + If $arg is the empty sequence, fn:boolean returns false.
+ + If $arg is a sequence whose first item is a node, fn:boolean returns true.
+ + If $arg is a singleton value of type xs:boolean or a derived from xs:boolean, fn:boolean returns $arg.
+ + If $arg is a singleton value of type xs:string or a type derived from xs:string, xs:anyURI or a type derived from xs:anyURI or xs:untypedAtomic, fn:boolean returns false if the operand value has zero length; otherwise it returns true.
+ + If $arg is a singleton value of any numeric type or a type derived from a numeric type, fn:boolean returns false if the operand value is NaN or is numerically equal to zero; otherwise it returns true. + + In all other cases, fn:boolean raises a type error [err:FORG0006].
+ + The static semantics of this function are described in Section 7.2.4 The fn:boolean and fn:not functionsFS.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:boolean?

+ Examples: + + + + + + + + + + + + + + + + + +
QueryResult
boolean("/l:library")true
boolean(0)false
boolean(())false

+ + W3C Documentation reference
+ + fn:true() +
+ Returns the xs:boolean value true. Equivalent to xs:boolean("1").

+ + Return type: xs:boolean

+ Examples:
+ + + + + + + + + +
ExpressionResult
true()true

+ W3C Documentation reference +
+ + fn:false() +
+ Returns the xs:boolean value false. Equivalent to xs:boolean("0").

+ + Return type: xs:boolean

+ Examples:
+ + + + + + + + + +
ExpressionResult
false()false

+ W3C Documentation reference +
+ + fn:not() +
+ $arg is first reduced to an effective boolean value by applying the fn:boolean() function. Returns true if the effective boolean value is false, and false if the effective boolean value is true.

+ + Arguments and return type: + + + + + + + + + +
TypeDescription
item$arg
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
not(false())true
not(true())false

+ W3C Documentation reference +
@@ -483,11 +1000,18 @@
- fn:string(object)
- Returns the string representation of the object argument
+ Returns the value of $arg represented as a xs:string. If no argument is supplied, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + If the context item is undefined, error [err:XPDY0002]XP is raised.
+ + If $arg is the empty sequence, the zero-length string is returned.
+ + If $arg is a node, the function returns the string-value of the node, as obtained using the dm:string-value accessor defined in the Section 5.13 string-value AccessorDM.
+ + If $arg is an atomic value, then the function returns the same string as is returned by the expression " $arg cast as xs:string " (see 17 Casting).
Arguments and return type: @@ -498,7 +1022,9 @@ -
string The object to convert to a string
Examples:
+ + Return type: xs:string

+ Examples:
@@ -513,11 +1039,1105 @@
Expression0.11

- W3C Documentation reference: String-Functions + W3C Documentation reference
+ fn:codepoints-to-string() +
+ Creates an xs:string from a sequence of The Unicode Standard code points. Returns the zero-length string if $arg is the empty sequence. If any of the code points in $arg is not a legal XML character, an error is raised [err:FOCH0001].
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:integer*$arg
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
codepoints-to-string((2309, 2358, 2378, 2325))अशॊक
codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41))( ͡° ͜ʖ ͡°)

+ W3C Documentation reference +
+ + fn:string-to-codepoints() +
+ Returns the sequence of The Unicode Standard code points that constitute an xs:string. If $arg is a zero-length string or the empty sequence, the empty sequence is returned.
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string*$arg
+ Return type: xs:integer*

+ Examples:
+ + + + + + + + + +
ExpressionResult
string-to-codepoints("Thérèse")(84, 104, 233, 114, 232, 115, 101)

+ W3C Documentation reference +
+ + fn:compare() +
+ Returns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively less than, equal to, or greater than the value of $comparand2, according to the rules of the collation that is used.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations.
+ + If either argument is the empty sequence, the result is the empty sequence.
+ + This function, invoked with the first signature, backs up the "eq", "ne", "gt", "lt", "le" and "ge" operators on string values.
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$comparand1
xs:string?$comparand2
xs:string$collation (Optional)
+ Return type: xs:integer*

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
compare('abc', 'abc')0
compare('abc', 'acc')-1
compare('abc', 'acc')1

+ W3C Documentation reference +
+ + fn:codepoint-equal() +
+ Returns true or false depending on whether the value of $comparand1 is equal to the value of $comparand2, according to the Unicode code point collation.
+ + If either argument is the empty sequence, the result is the empty sequence.
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?$comparand1
xs:string?$comparand2
+ Return type: xs:boolean?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
codepoint-equal("asdf", "asdf")true
codepoint-equal("asdf", "asdf ")false

+ W3C Documentation reference +
+ + fn:concat() +
+ Accepts two or more xs:anyAtomicType arguments and casts them to xs:string. Returns the xs:string that is the concatenation of the values of its arguments after conversion. If any of the arguments is the empty sequence, the argument is treated as the zero-length string.
+ + The fn:concat function is specified to allow two or more arguments, which are concatenated together. This is the only function specified in this document that allows a variable number of arguments. This capability is retained for compatibility with [XML Path Language (XPath) Version 1.0].
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType?$arg1
xs:anyAtomicType?$arg2
xs:anyAtomicType?$arg... (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
concat('un', 'grateful')ungrateful
concat('Thy ', (), 'old ', "groans", "", ' ring', ' yet', ' in', ' my', ' ancient',' ears.')Thy old groans ring yet in my ancient ears.
fn:concat('Ciao!',())Ciao!

+ W3C Documentation reference +
+ + fn:string-join() +
+ Returns a xs:string created by concatenating the members of the $arg1 sequence using $arg2 as a separator. If the value of $arg2 is the zero-length string, then the members of $arg1 are concatenated without a separator.
+ + If the value of $arg1 is the empty sequence, the zero-length string is returned.
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*$arg1
xs:string$arg2
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string-join(('Now', 'is', 'the', 'time', '...'), ' ')Now is the time ...
string-join(('Blow, ', 'blow, ', 'thou ', 'winter ', 'wind!'), '')Blow, blow, thou winter wind!

+ W3C Documentation reference +
- + fn:substring() +
+ Returns the portion of the value of $sourceString beginning at the position indicated by the value of $startingLoc and continuing for the number of characters indicated by the value of $length. The characters returned do not extend beyond $sourceString. If $startingLoc is zero or negative, only those characters in positions greater than zero are returned.
+ More specifically, the three argument version of the function returns the characters in $sourceString whose position $p obeys:
+ fn:round($startingLoc) <= $p < fn:round($startingLoc) + fn:round($length)
+ The two argument version of the function assumes that $length is infinite and returns the characters in $sourceString whose position $p obeys:
+ fn:round($startingLoc) <= $p < fn:round(INF)
+ In the above computations, the rules for op:numeric-less-than() and op:numeric-greater-than() apply.
+ If the value of $sourceString is the empty sequence, the zero-length string is returned.
+ + Note:
+ The first character of a string is located at position 1, not position 0.
+ + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$sourceString
xs:double$startingLoc
xs:double$length (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
substring("motor car", 6)" car"
substring("metadata", 4, 3)ada

+ W3C Documentation reference +
+ + fn:string-length() +
+ Returns an xs:integer equal to the length in characters of the value of $arg.
+ + If the value of $arg is the empty sequence, the xs:integer 0 is returned.
+ + If no argument is supplied, $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: xs:integer

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string-length("Harp not on that string, madam; that is past.")45
string-length(())0

+ W3C Documentation reference +
+ + fn:normalize-space() +
+ Returns the value of $arg with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of one or more than one whitespace character with a single space, #x20.
+ + If the value of $arg is the empty sequence, returns the zero-length string.
+ + If no argument is supplied, then $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
normalize-space(" The wealthy curled darlings of our nation. ")The wealthy curled darlings of our nation.
normalize-space(())""

+ W3C Documentation reference +
+ + fn:normalize-unicode() +
+ Returns the value of $arg normalized according to the normalization criteria for a normalization form identified by the value of $normalizationForm. The effective value of the $normalizationForm is computed by removing leading and trailing blanks, if present, and converting to upper case.
+ + If the value of $arg is the empty sequence, returns the zero-length string.
+ + Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg
xs:string$normalizationForm (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
normalize-unicode("test ")test

+ W3C Documentation reference +
+ + fn:upper-case() +
+ Returns the value of $arg after translating every character to its upper-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every lower-case character that does not have an upper-case correspondent, as well as every upper-case character, is included in the returned value in its original form.
+ + If the value of $arg is the empty sequence, the zero-length string is returned.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
upper-case("abCd0")ABCD0

+ W3C Documentation reference +
+ + fn:lower-case() +
+ Returns the value of $arg after translating every character to its lower-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every upper-case character that does not have a lower-case correspondent, as well as every lower-case character, is included in the returned value in its original form.
+ + If the value of $arg is the empty sequence, the zero-length string is returned.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
lower-case("abCd0")abcd0

+ W3C Documentation reference +
+ + fn:translate() +
+ Returns the value of $arg modified so that every character in the value of $arg that occurs at some position N in the value of $mapString has been replaced by the character that occurs at position N in the value of $transString.
+ + If the value of $arg is the empty sequence, the zero-length string is returned.
+ + Every character in the value of $arg that does not appear in the value of $mapString is unchanged.
+ + Every character in the value of $arg that appears at some position M in the value of $mapString, where the value of $transString is less than M characters in length, is omitted from the returned value. If $mapString is the zero-length string $arg is returned.
+ + If a character occurs more than once in $mapString, then the first occurrence determines the replacement character. If $transString is longer than $mapString, the excess characters are ignored.
+ + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg
xs:string$mapString
xs:string$mapString
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
translate("bar","abc","ABC")BAr
translate("--aaa--","abc-","ABC")AAA
translate("abcdabc", "abc", "AB")ABdAB

+ W3C Documentation reference +
+ + fn:encode-for-uri() +
+ This function encodes reserved characters in an xs:string that is intended to be used in the path segment of a URI. It is invertible but not idempotent. This function applies the URI escaping rules defined in section 2 of [RFC 3986] to the xs:string supplied as $uri-part. The effect of the function is to escape reserved characters. Each such character in the string is replaced with its percent-encoded form as described in [RFC 3986].
+ + If $uri-part is the empty sequence, returns the zero-length string.
+ + All characters are escaped except those identified as "unreserved" by [RFC 3986], that is the upper- and lower-case letters A-Z, the digits 0-9, HYPHEN-MINUS ("-"), LOW LINE ("_"), FULL STOP ".", and TILDE "~".
+ + Note that this function escapes URI delimiters and therefore cannot be used indiscriminately to encode "invalid" characters in a path segment.
+ + Since [RFC 3986] recommends that, for consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings, this function must always generate hexadecimal values using the upper-case letters A-F.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$uri-part
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
encode-for-uri("https://www.google.com")"https%3A%2F%2Fwww.
google.com"
concat("http://www.example.com/", encode-for-uri("~bébé"))http://www.example.com/
~b%C3%A9b%C3%A9
concat("http://www.example.com/", encode-for-uri("100% organic"))http://www.example.com/
100%25%20organic

+ W3C Documentation reference +
+ + fn:iri-to-uri() +
+ This function converts an xs:string containing an IRI into a URI according to the rules spelled out in Section 3.1 of [RFC 3987]. It is idempotent but not invertible.
+ + If $iri contains a character that is invalid in an IRI, such as the space character (see note below), the invalid character is replaced by its percent-encoded form as described in [RFC 3986] before the conversion is performed.
+ + If $iri is the empty sequence, returns the zero-length string.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$iri
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
iri-to-uri ("http://www.example.com/00/Weather/CA/Los%20Angeles#ocean")"http://www.example.com/00/
Weather/CA/Los%20Angeles#ocean"
iri-to-uri ("http://www.example.com/~bébé")http://www.example.com/
~b%C3%A9b%C3%A9

+ W3C Documentation reference +
+ + fn:escape-html-uri() +
+ This function escapes all characters except printable characters of the US-ASCII coded character set, specifically the octets ranging from 32 to 126 (decimal). The effect of the function is to escape a URI in the manner html user agents handle attribute values that expect URIs. Each character in $uri to be escaped is replaced by an escape sequence, which is formed by encoding the character as a sequence of octets in UTF-8, and then representing each of these octets in the form %HH, where HH is the hexadecimal representation of the octet. This function must always generate hexadecimal values using the upper-case letters A-F.
+ If $uri is the empty sequence, returns the zero-length string. + +

Note:

+ The behavior of this function corresponds to the recommended handling of non-ASCII characters in URI attribute values as described in [HTML 4.0] Appendix B.2.1.

+ + + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$uri
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean")http://www.example.com/00/Weather/CA/Los Angeles#ocean

+ W3C Documentation reference +
+ + fn:contains() +
+ Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of $arg2, according to the collation that is used. + + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns true.
+ + If the value of $arg1 is the zero-length string, the function returns false.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
contains( "tattoo", "tat")true
contains( "tattoo", "ttt")false
contains ( "", ())true

+ W3C Documentation reference +
+ + fn:starts-with() +
+ Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used. + + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
starts-with( "tattoo", "tat")true
starts-with( "tattoo", "ttt")false
starts-with ( "", ())true

+ W3C Documentation reference +
+ + fn:ends-with() +
+ Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used.
+ + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
ends-with( "tattoo", "too")true
ends-with( "tattoo", "tatoo")false
ends-with ((), ())true

+ W3C Documentation reference +
+ + fn:substring-before() +
+ Returns the substring of the value of $arg1 that precedes in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
+ + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns the zero-length string.
+ + If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
substring-before( "tattoo", "too")tat
substring-before( "tattoo", "tat")<empty string>

+ W3C Documentation reference +
+ + fn:substring-after() +
+ Returns the substring of the value of $arg1 that follows in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
+ + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns the value of $arg1.
+ + If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
substring-after( "tattoo", "too")<empty string>
substring-after( "tattoo", "tat")too

+ W3C Documentation reference +
+ + + fn:matches() +
+ The function returns true if $input matches the regular expression supplied as $pattern as influenced by the value of $flags, if present; otherwise, it returns false.
+ + The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ + If $input is the empty sequence, it is interpreted as the zero-length string.
+ Unless the metacharacters ^ and $ are used as anchors, the string is considered to match the pattern if any substring matches the pattern. But if anchors are used, the anchors must match the start/end of the string (in string mode), or the start/end of a line (in multiline mode).
+ + An error is raised [err:FORX0002] if the value of $pattern is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.
+ + An error is raised [err:FORX0001] if the value of $flags is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$input
xs:string$pattern
xs:string$flags (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
matches("abracadabra", "bra")true
matches("abracadabra", "^a.*a$")false

+ W3C Documentation reference +
+ + fn:replace() +
+ The function returns the xs:string that is obtained by replacing each non-overlapping substring of $input that matches the given $pattern with an occurrence of the $replacement string.
+ + The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ + The $flags argument is interpreted in the same manner as for the fn:matches() function.
+ + If $input is the empty sequence, it is interpreted as the zero-length string.
+ + If two overlapping substrings of $input both match the $pattern, then only the
first one (that is, the one whose first character comes first in the $input string) is replaced. + + Within the $replacement string, a variable $N may be used to refer to the substring captured by the Nth parenthesized sub-expression in the regular expression. For each match of the pattern, these variables are assigned the value of the content matched by the relevant sub-expression, and the modified replacement string is then substituted for the characters in $input that matched the pattern. $0 refers to the substring captured by the regular expression as a whole.

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$input
xs:string$pattern
xs:string$replacement
xs:string$flags (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
replace("abracadabra", "bra", "*")a*cada*
replace("abracadabra", "a.*a", "*")*
replace("AAAA", "A+", "b")b

+ W3C Documentation reference +
+ + fn:tokenize() +
+ This function breaks the $input string into a sequence of strings, treating any substring that matches $pattern as a separator. The separators themselves are not returned.
+ + The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ + The $flags argument is interpreted in the same way as for the fn:matches() function.
+ + If $input is the empty sequence, or if $input is the zero-length string, the result is the empty sequence.
+ + If the supplied $pattern matches a zero-length string, that is, if fn:matches("", $pattern, $flags) returns true, then an error is raised: [err:FORX0003].
+ + If a separator occurs at the start of the $input string, the result sequence will start with a zero-length string. Zero-length strings will also occur in the result sequence if a separator occurs at the end of the $input string, or if two adjacent substrings match the supplied $pattern.

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$input
xs:string$pattern
xs:string$flags (Optional)
+ Return type: xs:string*

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
tokenize("The cat sat on the mat", "\s+")("The", "cat", "sat", "on", "the", "mat")
tokenize("1, 15, 24, 50", ",\s*")("1", "15", "24", "50")
tokenize("1,15,,24,50,", ",")("1", "15", "", "24", "50", "")

+ W3C Documentation reference +
+
@@ -528,45 +2148,257 @@ fn:number(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:number()
- The number function converts its argument to a number as follows: -
    -
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • -
  • boolean true is converted to 1; boolean false is converted to 0
  • -
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • -
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a number
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Numeric-Functions + Returns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an xs:double
+ + Calling the zero-argument version of the function is defined to give the same result as calling the single-argument version with the context item (.). That is, fn:number() is equivalent to fn:number(.).
+ + If $arg is the empty sequence or if $arg or the context item cannot be converted to an xs:double, the xs:double value NaN is returned. If the context item is undefined an error is raised: [err:XPDY0002]XP.
+ + If $arg is the empty sequence, NaN is returned. Otherwise, $arg, or the context item after atomization, is converted to an xs:double following the rules of 17.1.3.2 Casting to xs:double. If the conversion to xs:double fails, the xs:double value NaN is returned.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
xs:anyAtomicType?Value to convert to number
+ Return type: xs:double

+ W3C Documentation reference
+ fn:abs() +
+ Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise returns $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For xs:float and xs:double arguments, if the argument is positive zero or negative zero, then positive zero is returned. If the argument is positive or negative infinity, positive infinity is returned.
+ + For detailed type semantics, see Section 7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions.
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + +
QueryResult
abs(-2)2
abs(2137)2137

+ W3C Documentation reference +
+ + fn:ceiling() +
+ Returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For xs:float and xs:double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero and greater than -1, negative zero is returned.
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + +
QueryResult
ceiling(10.5)11
ceiling(-10.5)-10
ceiling(10.1)11

+ W3C Documentation reference +
+ + fn:floor() +
+ Returns the largest (closest to positive infinity) number with no fractional part that is not greater than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For float and double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned.
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + +
QueryResult
floor(10.5)10
floor(-10.5)-11
floor(10.8)10

+ W3C Documentation reference +
+ + fn:round() +
+ Returns the number with no fractional part that is closest to the argument. If there are two such numbers, then the one that is closest to positive infinity is returned. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For xs:float and xs:double arguments, if the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. In the cases where positive zero or negative zero is returned, negative zero or positive zero may be returned as [XML Schema Part 2: Datatypes Second Edition] does not distinguish between the values positive zero and negative zero.
+ + For the last two cases, note that the result is not the same as fn:floor(x+0.5).
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + +
QueryResult
round(10.5)11
round(10.4999)10
round(-10.5)-10

+ W3C Documentation reference +
+ + fn:round-half-to-even() +
+ The value returned is the nearest (that is, numerically closest) value to $arg that is a multiple of ten to the power of minus $precision. If two such values are equally near (e.g. if the fractional part in $arg is exactly .500...), the function returns the one whose least significant digit is even.
+ + If the type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + The first signature of this function produces the same result as the second signature with $precision=0.
+ + For arguments of type xs:float and xs:double, if the argument is NaN, positive or negative zero, or positive or negative infinity, then the result is the same as the argument. In all other cases, the argument is cast to xs:decimal, the function is applied to this xs:decimal value, and the resulting xs:decimal is cast back to xs:float or xs:double as appropriate to form the function result. If the resulting xs:decimal value is zero, then positive or negative zero is returned according to the sign of the original argument.
+ + Note that the process of casting to xs:decimal may result in an error [err:FOCA0001].
+ + If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa computed with exponent = 0.
+
+ Arguments: + + + + + + + + + + + + + +
TypeDescription
numeric?$arg
numeric?$precision (Optional)
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + + + + + +
QueryResult
round-half-to-even(0.5)0
round-half-to-even(1.5)2
round-half-to-even(2.5)2
round-half-to-even(2.6)3

+ W3C Documentation reference +
@@ -577,32 +2409,826 @@
fn:avg((arg,arg,...)) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:data()
- Returns the average of the argument values
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*returns average value of provided elements
Examples:
- - - - - - - - - -
ExpressionResult
avg((1,2,3))2

- W3C Documentation reference: #func-avg + fn:data takes a sequence of items and returns a sequence of atomic values.
+ + The result of fn:data is the sequence of atomic values produced by applying the following rules to each item in $arg:
+
    +
  • If the item is an atomic value, it is returned.
  • +
  • + If the item is a node: +
      +
    • If the node does not have a typed value an error is raised [err:FOTY0012].
    • +
    • Otherwise, fn:data() returns the typed value of the node as defined by the accessor function dm:typed-value in Section 5.15 typed-value AccessorDM.
    • +
    +
  • +
+
+ Arguments: + + + + + + + + + +
TypeDescription
item*Items to convert.
+ Return type: xs:anyAtomicType*

+ Examples: + + + + + + + + + +
QueryResult
data(/l:library/l:readerList/p:person[1])7321
Adam
Choke

+ + W3C Documentation reference
+ + fn:index-of() +
+ Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + If $arg is a document node, $arg is returned.
+ + If the function is called without an argument, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]; if the context item is not a node [err:XPTY0004].

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType$seqParam
xs:anyAtomicType$srchParam
xs:string$collation (Optional)
+ Return type: xs:integer*

+ Examples: + + + + + + + + + + + + + + + + + +
QueryResult
index-of((10, 20, 30, 40), 35)()
index-of((10, 20, 30, 30, 20, 10), 20)(2, 5)
index-of(("a", "sport", "and", "a", "pastime"), "a")(1, 4)

+ + W3C Documentation reference +
+ + + fn:empty() +
+ If the value of $arg is the empty sequence, the function returns true; otherwise, the function returns false.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:boolean

+ Examples: + + + + + + + + + +
QueryResult
empty(fn:remove(("hello", "world"), 1))false

+ + W3C Documentation reference +
+ + + fn:exists() +
+ If the value of $arg is not the empty sequence, the function returns true; otherwise, the function returns false.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:boolean

+ Examples: + + + + + + + + + +
QueryResult
exists(fn:remove(("hello"), 1))true

+ + W3C Documentation reference +
+ + + fn:distinct-values() +
+ Returns the sequence that results from removing from $arg all but one of a set of values that are eq to one other. Values of type xs:untypedAtomic are compared as if they were of type xs:string. Values that cannot be compared, i.e. the eq operator is not defined for their types, are considered to be distinct. The order in which the sequence of values is returned is ·implementation dependent·.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:string$collation (Optional)
+ Return type: xs:anyAtomicType*

+ Examples: + + + + + + + + + +
QueryResult
distinct-values((1, 2.0, 3, 2))(1, 3, 2.0)

+ + W3C Documentation reference +
+ + fn:insert-before() +
+ Returns a new sequence constructed from the value of $target with the value of $inserts inserted at the position specified by the value of $position. (The value of $target is not affected by the sequence construction.)
+ + If $target is the empty sequence, $inserts is returned. If $inserts is the empty sequence, $target is returned.
+ + The value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $inserts, followed by the remaining elements of $target, in that sequence.
+ + If $position is less than one (1), the first position, the effective value of $position is one (1). If $position is greater than the number of items in $target, then the effective value of $position is equal to the number of items in $target plus 1.

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*$target
xs:integer$position
item()*$inserts
+ Return type: item()*

+ Examples:
+ let $x := ("a", "b", "c") + + + + + + + + + + + + + + + + + +
QueryResult
insert-before($x, 0, "z")("z", "a", "b", "c")
insert-before($x, 1, "z")("z", "a", "b", "c")
insert-before($x, 2, "z")("a", "z", "b", "c")

+ + W3C Documentation reference +
+ + fn:remove() +
+ Returns a new sequence constructed from the value of $target with the item at the position specified by the value of $position removed.
+ + If $position is less than 1 or greater than the number of items in $target, $target is returned. Otherwise, the value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $target whose index is greater than $position. If $target is the empty sequence, the empty sequence is returned.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
item()*$target
xs:integer$position
+ Return type: item()*

+ Examples:
+ let $x := ("a", "b", "c") + + + + + + + + + + + + + + + + + +
QueryResult
remove($x, 0) ("a", "b", "c")
remove($x, 1)("b", "c")
remove($x, 6)("a", "b", "c")

+ + W3C Documentation reference +
+ + + fn:reverse() +
+ Reverses the order of items in a sequence. If $arg is the empty sequence, the empty sequence is returned.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()*

+ Examples:
+ let $x := ("a", "b", "c") + + + + + + + + + + + + + + + + + +
QueryResult
reverse($x)("c", "b", "a")
reverse(("hello")) ("hello")
reverse(())()

+ + W3C Documentation reference +
+ + + fn:subsequence() +
+ Returns the contiguous sequence of items in the value of $sourceSeq beginning at the position indicated by the value of $startingLoc and continuing for the number of items indicated by the value of $length. + If $sourceSeq is the empty sequence, the empty sequence is returned.
+ + If $startingLoc is zero or negative, the subsequence includes items from the beginning of the $sourceSeq.
+ + If $length is not specified, the subsequence includes items to the end of $sourceSeq.
+ + If $length is greater than the number of items in the value of $sourceSeq following $startingLoc, the subsequence includes items to the end of $sourceSeq.
+ + The first item of a sequence is located at position 1, not position 0.

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*$sourceSeq
xs:double$startingLoc (Optional)
xs:double$length (Optional)
+ Return type: item()*

+ Examples:
+ let $seq = ($item1, $item2, $item3, $item4, ...) + + + + + + + + + + + + + +
QueryResult
subsequence($seq, 4)($item4, ...)
subsequence($seq, 3, 2)($item3, $item4)

+ + W3C Documentation reference +
+ + + fn:unordered() +
+ Returns the items of $sourceSeq in an implementation dependent order.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$sourceSeq
+ Return type: item()*

+ + W3C Documentation reference +
+ + fn:zero-or-one() +
+ Returns $arg if it contains zero or one items. Otherwise, raises an error [err:FORG0003].

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()?

+ Examples: + + + + + + + + + + + + + +
QueryResult
zero-or-one(("a"))a
zero-or-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:zero-or-one() ("a", "b")

+ + W3C Documentation reference +
+ + + fn:one-or-more() +
+ Returns $arg if it contains one or more items. Otherwise, raises an error [err:FORG0004].

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()?

+ Examples: + + + + + + + + + + + + + +
QueryResult
one-or-more(("a"))a
one-or-more(("a", "b"))a
b

+ + W3C Documentation reference +
+ + + fn:exactly-one() +
+ Returns $arg if it contains exactly one item. Otherwise, raises an error [err:FORG0005].

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()?

+ Examples: + + + + + + + + + + + + + +
QueryResult
exactly-one(("a"))a
exactly-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:exactly-one() ("a", "b")

+ + W3C Documentation reference +
+ + + fn:deep-equal() +
+ This function assesses whether two sequences are deep-equal to each other. To be deep-equal, they must contain items that are pairwise deep-equal; and for two items to be deep-equal, they must either be atomic values that compare equal, or nodes of the same kind, with the same name, whose children are deep-equal. This is defined in more detail below. The $collation argument identifies a collation which is used at all levels of recursion when strings are compared (but not when names are compared), according to the rules in 7.3.1 Collations.
+ + If the two sequences are both empty, the function returns true.
+ + If the two sequences are of different lengths, the function returns false.
+ + If the two sequences are of the same length, the function returns true if and only if every item in the sequence $parameter1 is deep-equal to the item at the same position in the sequence $parameter2. The rules for deciding whether two items are deep-equal follow. + + For more in-depth description look into W3C Documentation

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*$parameter1
item()*$parameter2
xs:string$collation (Optional)
+ Return type: xs:boolean

+ Examples: + + + + + + + + + + + + + +
QueryResult
deep-equal(/l:library/p:person[0], /l:library/p:person[1])true
deep-equal(/l:library/p:person[0], /l:library)false

+ + W3C Documentation reference +
+ + + fn:id() +
+ Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg. + +

Note:

+ + This function does not have the desired effect when searching a document in which elements of type xs:ID are used as identifiers. To preserve backwards compatibility, a new function fn:element-with-id is therefore being introduced; it behaves the same way as fn:id in the case of ID-valued attributes. +

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string*$arg
node()*$node
xs:string$collation (Optional)
+ Return type: element()*

+ + W3C Documentation reference +
+ + fn:idref() +
+ Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string*$arg
node()*$node
xs:string$collation (Optional)
+ Return type: node()*

+ + W3C Documentation reference +
+ + + fn:doc() +
+ Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string$uri
+ Return type: document-node()?

+ Examples: + + + + + + + + + +
QueryResult
doc("test.xml")Contents of test.xml file returned as node

+ + W3C Documentation reference +
+ + + fn:doc-available() +
+ Retrieves a document using a URI supplied as an xs:string, and returns the corresponding document node.
+ + If $uri is the empty sequence, the result is an empty sequence.
+ + If $uri is not a valid URI, an error may be raised [err:FODC0005].
+ + If $uri is a relative URI reference, it is resolved relative to the value of the base URI property from the static context. The resulting absolute URI is promoted to an xs:string.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string$uri
+ Return type: xs:boolean

+ Examples: + + + + + + + + + +
QueryResult
doc("test.xml")true (If document is available)

+ + W3C Documentation reference +
+ + + fn:collection() +
+ This function takes an xs:string as argument and returns a sequence of nodes obtained by interpreting $arg as an xs:anyURI and resolving it according to the mapping specified in Available collections described in Section C.2 Dynamic Context ComponentsXP. If Available collections provides a mapping from this string to a sequence of nodes, the function returns that sequence. If Available collections maps the string to an empty sequence, then the function returns an empty sequence. If Available collections provides no mapping for the string, an error is raised [err:FODC0004].
+ If $arg is not specified, the function returns the sequence of the nodes in the default collection in the dynamic context. See Section C.2 Dynamic Context ComponentsXP. If the value of the default collection is undefined an error is raised [err:FODC0002].

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: node()*

+ Examples: + + + + + + + + + +
QueryResult
collection("")<empty sequence>

+ + W3C Documentation reference +
+ + fn:element-with-id() +
+ Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: node()*

+ + W3C Documentation reference +
+ + fn:position() +
+ Returns the context position from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

+ + Return type: xs:integer

+ Examples: + + + + + + + + + +
QueryResult
/l:library/l:readerList/position()1

+ + W3C Documentation reference +
+ + + fn:last() +
+ Returns the context size from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

+ + Return type: xs:integer

+ Examples: + + + + + + + + + +
QueryResult
/l:library/l:readerList/p:person/last()2
2

+ + W3C Documentation reference +
+
@@ -612,55 +3238,1074 @@
- fn:adjust-date-to-timezone(date,timezone) -
- If the timezone argument is empty, it returns a date without a timezone. Otherwise, - it returns a date with a timezone
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
datedate to be adjusted
timezonetimezone to be imposed into date
Examples:
- - - - - - - - - -
ExpressionResult
adjust-date-to-timezone(xs:date('2011-11-15'), - xs:dayTimeDuration("PT10H"))2011-11-15+10:00

- W3C Documentation reference: #func-adjust-date-to-timezone -
- + fn:years-from-duration() +
+ Returns an xs:integer representing the years component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the years component as described in 10.3.1.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:dayTimeDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
years-from-duration(xs:yearMonthDuration("P20Y15M"))21
years-from-duration(xs:yearMonthDuration("-P15M"))-1
years-from-duration(xs:dayTimeDuration("-P2DT15H"))0

+ W3C Documentation reference +
+ + fn:months-from-duration() +
+ Returns an xs:integer representing the months component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the months component as described in 10.3.1.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:dayTimeDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
months-from-duration(xs:yearMonthDuration("P20Y15M"))3
months-from-duration(xs:yearMonthDuration("-P20Y18M"))-6
months-from-duration(xs:dayTimeDuration("-P2DT15H0M0S"))0

+ W3C Documentation reference +
+ + fn:days-from-duration() +
+ Returns an xs:integer representing the days component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the days component as described in 10.3.2.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:yearMonthDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
days-from-duration(xs:dayTimeDuration("P3DT10H"))3
days-from-duration(xs:dayTimeDuration("P3DT55H"))5
days-from-duration(xs:yearMonthDuration("P3Y5M"))0

+ W3C Documentation reference +
+ + fn:hours-from-duration() +
+ Returns an xs:integer representing the hours component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the hours component as described in 10.3.2.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:yearMonthDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
hours-from-duration(xs:dayTimeDuration("P3DT10H"))10
hours-from-duration(xs:dayTimeDuration("P3DT12H32M12S"))12
hours-from-duration(xs:dayTimeDuration("PT123H"))0

+ W3C Documentation reference +
+ + + fn:minutes-from-duration() +
+ Returns an xs:integer representing the minutes component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the minutes component as described in 10.3.2.3 Canonical representation. + + The result may be negative. + + If $arg is an xs:yearMonthDuration returns 0. + + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
minutes-from-duration(xs:dayTimeDuration("P3DT10H"))0
minutes-from-duration(xs:dayTimeDuration("-P5DT12H30M"))-30

+ W3C Documentation reference +
+ + fn:seconds-from-duration() +
+ Returns an xs:decimal representing the seconds component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the seconds component as described in 10.3.2.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:yearMonthDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:decimal?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
seconds-from-duration(xs:dayTimeDuration("P3DT10H12.5S"))12.5
seconds-from-duration(xs:dayTimeDuration("-PT256S"))-16.0

+ W3C Documentation reference +
+ + + fn:year-from-dateTime() +
+ Returns an xs:integer representing the year component in the localized value of $arg. The result may be negative.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
year-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))1999
year-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))1999
year-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))2000

+ W3C Documentation reference +
+ + + fn:month-from-dateTime() +
+ Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
month-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))5
month-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))12
month-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))1

+ W3C Documentation reference +
+ + fn:day-from-dateTime() +
+ Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
day-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))31
day-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))31
day-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))1

+ W3C Documentation reference +
+ + + fn:hours-from-dateTime() +
+ Returns an xs:integer between 0 and 23, both inclusive, representing the hours component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
hours-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))13
hours-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))19
hours-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))0

+ W3C Documentation reference +
+ + + fn:minutes-from-dateTime() +
+ Returns an xs:integer value between 0 and 59, both inclusive, representing the minute component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
minutes-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))20
minutes-from-dateTime(xs:dateTime("1999-05-31T13:30:00+05:30"))30

+ W3C Documentation reference +
+ + fn:seconds-from-dateTime() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:decimal?

+ Examples:
+ + + + + + + + + +
ExpressionResult
seconds-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))0

+ W3C Documentation reference +
+ + fn:timezone-from-dateTime() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:dayTimeDuration?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
timezone-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))-PT5H
timezone-from-dateTime(xs:dateTime("2000-06-12T13:20:00Z")) PT0S
timezone-from-dateTime(xs:dateTime("2004-08-27T00:00:00"))()

+ W3C Documentation reference +
+ + + fn:year-from-date() +
+ Returns an xs:integer representing the year in the localized value of $arg. The value may be negative.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
year-from-date(xs:date("1999-05-31"))1999
year-from-date(xs:date("2000-01-01+05:00"))2000

+ W3C Documentation reference +
+ + fn:month-from-date() +
+ Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
month-from-date(xs:date("1999-05-31-05:00"))5
month-from-date(xs:date("2000-01-01+05:00"))1

+ W3C Documentation reference +
+ + fn:day-from-date() +
+ Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
day-from-date(xs:date("1999-05-31-05:00"))31
day-from-date(xs:date("2000-01-01+05:00"))1

+ W3C Documentation reference +
+ + + fn:timezone-from-date() +
+ Returns the timezone component of $arg if any. If $arg has a timezone component, then the result is an xs:dayTimeDuration that indicates deviation from UTC; its value may range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty sequence.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:dayTimeDuration?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
timezone-from-date(xs:date("1999-05-31-05:00"))-PT5H
timezone-from-date(xs:date("2000-06-12Z"))PT0S

+ W3C Documentation reference +
+ + + fn:hours-from-time() +
+ Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
hours-from-time(xs:time("11:23:00"))11
hours-from-time(xs:time("24:00:00"))0

+ W3C Documentation reference +
+ + + fn:minutes-from-time() +
+ Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
hours-from-time(xs:time("11:23:00"))11
hours-from-time(xs:time("24:00:00"))0

+ W3C Documentation reference +
+ + fn:seconds-from-time() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:decimal?

+ Examples:
+ + + + + + + + + + +
ExpressionResult
seconds-from-time(xs:time("13:20:10.5"))10.5

+ W3C Documentation reference +
+ + + fn:timezone-from-time() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:dayTimeDuration?

+ Examples:
+ + + + + + + + + + + + + + +
ExpressionResult
timezone-from-time(xs:time("13:20:00-05:00"))-PT5H
timezone-from-time(xs:time("13:20:00"))()

+ W3C Documentation reference +
+ + + fn:adjust-date-to-timezone() +
+ Adjusts an xs:date value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:date without a timezone. Otherwise, returns an xs:date with a timezone. For purposes of timezone adjustment, an xs:date is treated as an xs:dateTime with time 00:00:00.
+ + If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
+ + If $arg is the empty sequence, then the result is the empty sequence.
+ + A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
+ + If $arg does not have a timezone component and $timezone is the empty sequence, then the result is the value of $arg.
+ + If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
+ + If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
+ + If $arg has a timezone component and $timezone is not the empty sequence, then: +
    +
  • Let $srcdt be an xs:dateTime value, with 00:00:00 for the time component and date and timezone components that are the same as the date and timezone components of $arg.
  • +
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
  • +
  • The result of this function will be a date value that has date and timezone components that are the same as the date and timezone components of $r.
  • +
+

+ + Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:date?$arg
xs:dayTimeDuration?$timezone
+ Return type: xs:date?

+ Examples:
+ + + + + + + + + + + + + + +
ExpressionResult
adjust-date-to-timezone(xs:date("2002-03-07"))2002-03-07-05:00
adjust-date-to-timezone(xs:date("2002-03-07"), xs:dayTimeDuration("-PT10H"))2002-03-07-10:00

+ W3C Documentation reference +
+ + fn:adjust-time-to-timezone() +
+ Adjusts an xs:time value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:time without a timezone. Otherwise, returns an xs:time with a timezone.
+ + If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
+ + If $arg is the empty sequence, then the result is the empty sequence.
+ + A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
+ + If $arg does not have a timezone component and $timezone is the empty sequence, then the result is $arg.
+ + If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
+ + If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
+ + If $arg has a timezone component and $timezone is not the empty sequence, then: +
    +
  • Let $srcdt be an xs:dateTime value, with an arbitrary date for the date component and time and timezone components that are the same as the time and timezone components of $arg.
  • +
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
  • +
  • The result of this function will be a time value that has time and timezone components that are the same as the time and timezone components of $r.
  • +
+

+ + Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:time?$arg
xs:dayTimeDuration?$timezone
+ Return type: xs:time?

+ Examples:
+ + + + + + + + + + + + + + +
ExpressionResult
adjust-time-to-timezone(xs:time("10:00:00"))10:00:00-05:00
adjust-time-to-timezone(xs:time("10:00:00"), xs:dayTimeDuration("-PT10H"))10:00:00-10:00

+ W3C Documentation reference +
+ + fn:current-dateTime() +
+ Returns the current dateTime (with timezone) from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) This is an xs:dateTime that is current at some time during the evaluation of a query or transformation in which fn:current-dateTime() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-dateTime() is ·implementation dependent·.

+ + Return type: xs:dateTime

+ Examples:
+ + + + + + + + + + +
ExpressionResult
current-dateTime()xs:dateTime corresponding to the current date and time

+ W3C Documentation reference +
+ + fn:current-date() +
+ Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

+ + Return type: xs:date

+ Examples:
+ + + + + + + + + + +
ExpressionResult
current-date()xs:date corresponding to the current date

+ W3C Documentation reference +
+ + + fn:current-time() +
+ Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

+ + Return type: xs:time

+ Examples:
+ + + + + + + + + + +
ExpressionResult
current-time()xs:date corresponding to the current time

+ W3C Documentation reference +
+ + fn:implicit-timezone() +
+ Returns the value of the implicit timezone property from the dynamic context. Components of the dynamic context are discussed in Section C.2 Dynamic Context ComponentsXP.

+ + Return type: xs:string

+ Examples:
+ + + + + + + + + + +
ExpressionResult
implicit-timezone()PT0S

+ W3C Documentation reference +
- +
fn:error()
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error + The fn:error function is a general function that may be invoked as above but may also be invoked from [XQuery 1.0: An XML Query Language] or [XML Path Language (XPath) 2.0] applications with, for example, an xs:QName argument. +
+ W3C Documentation reference +
+ + + fn:trace() +
+ Provides an execution trace intended to be used in debugging queries.
+ + The input $value is returned, unchanged, as the result of the function. In addition, the inputs $value, converted to an xs:string, and $label may be directed to a trace data set. The destination of the trace output is ·implementation-defined·. The format of the trace output is ·implementation dependent·. The ordering of output from invocations of the fn:trace() function is ·implementation dependent·.
+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
item*$value
xs:string$label
+ Return type: item

+
+ W3C Documentation reference
@@ -673,15 +4318,363 @@
- fn:nilled(node) -
+ fn:resolve-uri() +
+ This function enables a relative URI reference to be resolved against an absolute URI. - Returns a Boolean value indicating whether the argument node is nilled
-
- W3C Documentation reference: #func-nilled -
+ The first form of this function resolves $relative against the value of the base-uri property from the static context. If the base-uri property is not initialized in the static context an error is raised [err:FONS0005].
+ + If $relative is a relative URI reference, it is resolved against $base, or against the base-uri property from the static context, using an algorithm such as those described in [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned.
+ If $relative is an absolute URI reference, it is returned unchanged.
+ + If $relative is the empty sequence, the empty sequence is returned.
+ + If $relative is not a valid URI according to the rules of the xs:anyURI data type, or if it is not a suitable relative reference to use as input to the chosen resolution algorithm, then an error is raised [err:FORG0002].
+ + If $base is not a valid URI according to the rules of the xs:anyURI data type, if it is not a suitable URI to use as input to the chosen resolution algorithm (for example, if it is a relative URI reference, if it is a non-hierarchic URI, or if it contains a fragment identifier), then an error is raised [err:FORG0002].
+ + If the chosen resolution algorithm fails for any other reason then an error is raised [err:FORG0009].
+ +

Note:

+ + Resolving a URI does not dereference it. This is merely a syntactic operation on two character strings. +

+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?$relative
xs:string$base
+ Return type: xs:anyURI?

+
+ W3C Documentation reference +
+ fn:resolve-QName() +
+ Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string that has the lexical form of an xs:QName (a string in the form "prefix:local-name" or "local-name") and resolving it using the in-scope namespaces for a given element.
+ + If $qname does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
+ + If $qname is the empty sequence, returns the empty sequence.
+ + More specifically, the function searches the namespace bindings of $element for a binding whose name matches the prefix of $qname, or the zero-length string if it has no prefix, and constructs an expanded-QName whose local name is taken from the supplied $qname, and whose namespace URI is taken from the string value of the namespace binding.
+ + If the $qname has a prefix and if there is no namespace binding for $element that matches this prefix, then an error is raised [err:FONS0004].
+ + If the $qname has no prefix, and there is no namespace binding for $element corresponding to the default (unnamed) namespace, then the resulting expanded-QName has no namespace part.
+ + The prefix (or absence of a prefix) in the supplied $qname argument is retained in the returned expanded-QName, as discussed in Section 2.1 TerminologyDM.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$qname
element$element
+ Return type: xs:QName?

+ Examples: + + + + + + + + + + + + + +
QueryResult
resolve-QName("hello", /l:library/l:libraryName)hello
resolve-QName("l:libraryID", /l:library/l:libraryName)l:libraryID

+ + W3C Documentation reference +
+ + fn:QName() +
+ Returns an xs:QName with the namespace URI given in $paramURI. If $paramURI is the zero-length string or the empty sequence, it represents "no namespace"; in this case, if the value of $paramQName contains a colon (:), an error is raised [err:FOCA0002]. The prefix (or absence of a prefix) in $paramQName is retained in the returned xs:QName value. The local name in the result is taken from the local part of $paramQName.
+ + If $paramQName does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
+ + Note that unlike xs:QName this function does not require a xs:string literal as the argument.

+ Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$paramURI
xs:string$paramQName
+ Return type: xs:QName

+ Examples: + + + + + + + + + +
QueryResult
QName("http://www.release11.com/library", "l:libraryName")l:libraryName
+ For more extensive examples see W3C documentation below.
+ + W3C Documentation reference +
+ + fn:prefix-from-QName() +
+ Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:NCName?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))l
+ + W3C Documentation reference +
+ + fn:local-name-from-QName() +
+ Returns an xs:NCName representing the local part of $arg. If $arg is the empty sequence, returns the empty sequence.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:NCName?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))library
+ + W3C Documentation reference +
+ + + fn:prefix-from-QName() +
+ Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:NCName?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))l
+ + W3C Documentation reference +
+ + fn:namespace-uri-from-QName() +
+ Returns the namespace URI for $arg as an xs:anyURI. If $arg is the empty sequence, the empty sequence is returned. If $arg is in no namespace, the zero-length xs:anyURI is returned.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))http://www.release11.com/library
+ + W3C Documentation reference +
+ + + fn:namespace-uri-for-prefix() +
+ Returns the namespace URI of one of the in-scope namespaces for $element, identified by its namespace prefix.
+ + If $element has an in-scope namespace whose namespace prefix is equal to $prefix, it returns the namespace URI of that namespace. If $prefix is the zero-length string or the empty sequence, it returns the namespace URI of the default (unnamed) namespace. Otherwise, it returns the empty sequence.
+ + Prefixes are equal only if their Unicode code points match exactly.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$prefix
element()$element
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + +
QueryResult
namespace-uri-for-prefix("l", /l:library)http://www.release11.com/library
+ + W3C Documentation reference +
+ + + fn:in-scope-prefixes() +
+ Returns the prefixes of the in-scope namespaces for $element. For namespaces that have a prefix, it returns the prefix as an xs:NCName. For the default namespace, which has no prefix, it returns the zero-length string.

+ + Arguments: + + + + + + + + + +
TypeDescription
element()$element
+ Return type: xs:string*

+ Examples: + + + + + + + + + +
QueryResult
in-scope-prefixes(/l:library)b
l
p
xsi
xml
+ + W3C Documentation reference +
+ + fn:static-base-uri() +
+ Returns the value of the Base URI property from the static context. If the Base URI property is undefined, the empty sequence is returned. Components of the static context are discussed in Section C.1 Static Context ComponentsXP.

+ + Return type: xs:anyURI?

+ Examples:
+ + + + + + + + + + +
ExpressionResult
static-base-uri()()<empty sequence>

+ W3C Documentation reference +
From 7c0d79612af1dba8410547d41b55c9850c9f6cf3 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 6 Apr 2023 14:03:39 +0200 Subject: [PATCH 06/59] Added numeric functions and some string --- Frontend/tools/xpath.html | 472 +++++++++++++++++++++++++++++++------- 1 file changed, 385 insertions(+), 87 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 065d4a9..999cb7c 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -286,104 +286,402 @@ W3C Documentation reference: Node-Set-Functions
-
+
- - - -
- - - fn:boolean() + + +
- The boolean function converts its argument to a boolean as follows: -
    -
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • -
  • a node-set is true if and only if it is non-empty
  • -
  • a string is true if and only if its length is non-zero
  • -
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • -
- Arguments: - - - - - - - - - -
TypeDescription
objectThe object to convert to a boolean
Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Boolean-Functions -
+ + fn:boolean() +
+ The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • +
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a boolean
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
boolean("Release11")true
boolean("")false

+ W3C Documentation reference: Boolean-Functions +
- fn:not() -
- The not function returns true if its argument is false, and false otherwise.
+ fn:not() +
+ The not function returns true if its argument is false, and false otherwise.
+
+ W3C Documentation reference: Boolean-Functions +
+ + + fn:true() +
+ The true function returns true.
+
+ W3C Documentation reference: Boolean-Functions +
+ + + fn:false() +
+ The true function returns false.
+
+ W3C Documentation reference: Boolean-Functions +
+ + fn:lang() +
+ The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
+ Arguments: + + + + + + + + + +
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation

- W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions +
+ +
- - - fn:true() -
- The true function returns true.
-
- W3C Documentation reference: Boolean-Functions -
- - - fn:false() -
- The true function returns false.
-
- W3C Documentation reference: Boolean-Functions -
- - fn:lang() -
- The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
- Arguments: - - - - - - - - - -
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation
-
- W3C Documentation reference: Boolean-Functions -
- -
+ + + +
+ + + +
+ + fn:string() +
+ The string function converts an object to a string as follows: A node-set is converted to a string by returning the string-value of the node in the node-set that is first in document order. If the node-set is empty, an empty string is returned.
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a string
Examples:
+ + + + + + + + + +
ExpressionResult
string(10)true

+ W3C Documentation reference: String-Functions +
+ + + fn:concat() +
+ The concat function returns the concatenation of its arguments.
+ + Arguments: + + + + + + + + + +
TypeDescription
string*Strings to concatenate
Examples:
+ + + + + + + + + +
ExpressionResult
concat("Release", 11)Release11

+ W3C Documentation reference: String-Functions +
+ + fn:starts-with() +
+ The concat function returns the concatenation of its arguments.
+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
string
stringThe object to convert to a string
Examples:
+ + + + + + + + + +
ExpressionResult
concat("Release", 11)Release11

+ W3C Documentation reference: String-Functions +
+ + +
+ +
+ + + +
+ + + fn:number() +
+ The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • +
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
number(10)10
number("")NaN

+ W3C Documentation reference +
+ + fn:sum() +
+ The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + +
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

+ W3C Documentation reference +
+ + fn:floor() +
+ The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)4
floor(3.9)4
floor(3.5)4

+ W3C Documentation reference +
+ + fn:ceiling() +
+ The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)3
floor(3.5)3

+ W3C Documentation reference +
+ + + fn:round() +
+ The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. + +

NOTE

+ For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)4
floor(3.5)3

+ W3C Documentation reference +
+ +
+
+ From de94eca0ac10e6846137b2ce465015f9dad8a7f2 Mon Sep 17 00:00:00 2001 From: Dariusz Augustyniak Date: Fri, 14 Apr 2023 10:42:47 +0200 Subject: [PATCH 07/59] Fixed error codes and added logging (#138) fixed error codes (400 not 500) and added logging for json Co-authored-by: augustyd Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/138 Co-authored-by: Dariusz Augustyniak Co-committed-by: Dariusz Augustyniak --- .../java/com/r11/tools/SparkApplication.java | 6 +++- .../r11/tools/controller/JsonController.java | 33 ++++++++++++------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java b/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java index affcebb..cee98f2 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java @@ -32,12 +32,16 @@ public class SparkApplication { .setPrettyPrinting() .create(); + Gson jsongson = new GsonBuilder() + .disableHtmlEscaping() + .create(); + RestControllerRegistry registry = new RestControllerRegistry(); registry.registerController(new ProcessorInfoController(logger)); registry.registerController(new XsdController(gson, logger)); registry.registerController(new XPathController(gson, logger)); registry.registerController(new XsltController(gson, logger)); - registry.registerController(new JsonController()); + registry.registerController(new JsonController(gson, jsongson, logger)); registry.register(); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java index 1d465fd..8574c3b 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java @@ -1,7 +1,7 @@ package com.r11.tools.controller; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +//import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.r11.tools.controller.internal.GlobalControllerManifest; import com.r11.tools.controller.internal.HandlerType; @@ -9,18 +9,22 @@ import com.r11.tools.controller.internal.RestController; import com.r11.tools.controller.internal.ScopedControllerManifest; import spark.Request; import spark.Response; +import org.apache.logging.log4j.Logger; @GlobalControllerManifest(path = "/json") public class JsonController implements RestController { - private final Gson prettyGson = new GsonBuilder() - .disableHtmlEscaping() - .setPrettyPrinting() - .create(); + private final Logger logger; - private final Gson gson = new GsonBuilder() - .disableHtmlEscaping() - .create(); + private final Gson prettyGson; + + private final Gson gson; + + public JsonController(Gson prettyGson, Gson jsongson,Logger logger) { + this.logger = logger; + this.prettyGson = prettyGson; + this.gson = jsongson; + } @ScopedControllerManifest(method = HandlerType.POST, path = "/formatting") public void formatting(Request request, Response response) { @@ -35,17 +39,20 @@ public class JsonController implements RestController { responseJson.addProperty("data", this.prettyGson.toJson(requestJson)); responseJson.addProperty("time", System.currentTimeMillis() - startProcess); - response.body(this.prettyGson.toJson(responseJson)); + } catch (Exception e) { + this.logger.error("Error on formatting Json " + e); Throwable cause = e.getCause(); - response.status(500); + response.status(400); responseJson.addProperty("data", cause == null ? e.getMessage() : cause.getMessage()); responseJson.addProperty("time", System.currentTimeMillis() - startProcess); + + } + this.logger.info("Json processed in " + responseJson.get("time").toString() + " ms."); response.body(this.prettyGson.toJson(responseJson)); - } } @ScopedControllerManifest(method = HandlerType.POST, path = "/minimize") @@ -63,14 +70,16 @@ public class JsonController implements RestController { response.body(this.gson.toJson(responseJson)); } catch (Exception e) { + this.logger.error("Error on minimizeing Json " + e); Throwable cause = e.getCause(); - response.status(500); + response.status(400); responseJson.addProperty("data", cause == null ? e.getMessage() : cause.getMessage()); responseJson.addProperty("time", System.currentTimeMillis() - startProcess); response.body(this.prettyGson.toJson(responseJson)); } + this.logger.info("Json processed in " + responseJson.get("time").toString() + " ms."); } } From 8098aeacd93a41b696fbf6dd7048df2a337d5e15 Mon Sep 17 00:00:00 2001 From: Mikolaj Widla Date: Tue, 18 Apr 2023 10:05:44 +0200 Subject: [PATCH 08/59] Added new tooltips for XPath 3.0 and 3.1 Co-authored-by: widlam Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/139 Reviewed-by: Adam Bem Reviewed-by: Dariusz Augustyniak Co-authored-by: Mikolaj Widla Co-committed-by: Mikolaj Widla --- Frontend/assets/css/tools/r11form.css | 3 +- Frontend/tools/xpath.html | 14087 ++++++++++++++++++++++-- 2 files changed, 12875 insertions(+), 1215 deletions(-) diff --git a/Frontend/assets/css/tools/r11form.css b/Frontend/assets/css/tools/r11form.css index 2c70e8c..4430b85 100644 --- a/Frontend/assets/css/tools/r11form.css +++ b/Frontend/assets/css/tools/r11form.css @@ -440,12 +440,11 @@ body { .content { padding: 0px 15px 0px 15px ; - text-align: justify; + text-align: left; overflow: hidden; transition: max-height .2s ease-out; max-height: 0px; border-left: #c0c2c3 2px solid; - } .collapsibleMini::before{ diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 999cb7c..7f82f5d 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -29,7 +29,7 @@

What is XPath?

-

XPath is a query language used for selecting nodes from XML and processing them.
- It may perform operations on strings, numbers and boolean values.

+

+ XPath is a query language used for selecting nodes from XML and processing them.
+ It may perform operations on strings, numbers and boolean values.
+

+

+

Semantics legend:

+

+ "+" - 1 or more elements +

+

+ "*" - 0 or more elements +

+

+ "?" - optional element +

+

- +

XPath 2.0 introduced many new features XQuery-cośtam:
@@ -120,42 +135,42 @@ fn:position()

- Returns the position of the current context node
-
- W3C Documentation reference: Node-Set-Functions + Returns the position of the current context node
+
+ W3C Documentation reference: Node-Set-Functions
fn:count()
- Returns the number of nodes in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-setNode-set to count nodes in
Examples:
- - - - - - - - - - - - - -
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

- W3C Documentation reference: Node-Set-Functions + Returns the number of nodes in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-setNode-set to count nodes in
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

+ W3C Documentation reference: Node-Set-Functions
@@ -163,9 +178,9 @@ fn:id()
- Returns the element specified by it's unique id, requires DTD
-
- W3C Documentation reference: Node-Set-Functions + Returns the element specified by it's unique id, requires DTD
+
+ W3C Documentation reference: Node-Set-Functions
@@ -173,33 +188,33 @@ fn:local-name()
- Returns the local-name for the first node in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-setExtract first node and return its local name
Examples:
- - - - - - - - - - - - - -
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

- W3C Documentation reference: Node-Set-Functions + Returns the local-name for the first node in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-setExtract first node and return its local name
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

+ W3C Documentation reference: Node-Set-Functions
@@ -207,9 +222,9 @@ fn:local-name()
- Returns the local-name for the context node
-
- W3C Documentation reference: Node-Set-Functions + Returns the local-name for the context node
+
+ W3C Documentation reference: Node-Set-Functions
@@ -217,29 +232,29 @@ fn:namespace-uri()
- Returns the namespace-uri for the first node in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
- - - - - - - - - -
ExpressionResult
namespace-uri(//b:book)http://www.book.com

- W3C Documentation reference: Node-Set-Functions + Returns the namespace-uri for the first node in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
+ + + + + + + + + +
ExpressionResult
namespace-uri(//b:book)http://www.book.com

+ W3C Documentation reference: Node-Set-Functions
@@ -247,9 +262,9 @@ fn:namespace-uri()
- Returns the namespace-uri for the context node
-
- W3C Documentation reference: Node-Set-Functions + Returns the namespace-uri for the context node
+
+ W3C Documentation reference: Node-Set-Functions
@@ -257,37 +272,37 @@ fn:name()
- Returns the name for the first node in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-set (Optional)Extract first node and return QName
Examples:
- - - - - - - - - - - - - -
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

- W3C Documentation reference: Node-Set-Functions + Returns the name for the first node in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-set (Optional)Extract first node and return QName
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

+ W3C Documentation reference: Node-Set-Functions
- +
- +
@@ -298,95 +313,101 @@ fn:boolean()
- The boolean function converts its argument to a boolean as follows: -
    -
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • -
  • a node-set is true if and only if it is non-empty
  • -
  • a string is true if and only if its length is non-zero
  • -
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • -
+ The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN +
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in + a way that is dependent on that type
  • +
- Arguments: - - - - - - - - - -
TypeDescription
objectThe object to convert to a boolean
Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Boolean-Functions + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a boolean
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
boolean("Release11")true
boolean("")false

+ W3C Documentation reference: Boolean-Functions
- - fn:not()
- The not function returns true if its argument is false, and false otherwise.
-
- W3C Documentation reference: Boolean-Functions + The not function returns true if its argument is false, and false otherwise.
+
+ W3C Documentation reference: Boolean-Functions
fn:true()
- The true function returns true.
-
- W3C Documentation reference: Boolean-Functions + The true function returns true.
+
+ W3C Documentation reference: Boolean-Functions
fn:false()
- The true function returns false.
-
- W3C Documentation reference: Boolean-Functions + The true function returns false.
+
+ W3C Documentation reference: Boolean-Functions
fn:lang()
- The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
- Arguments: - - - - - - - - - -
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation
+ The lang function returns true or false depending on whether the language of the context + node as specified by xml:lang attributes is the same as or is a sublanguage of the + language specified by the argument string. The language of the context node is + determined by the value of the xml:lang attribute on the context node, or, if the + context node has no xml:lang attribute, by the value of the xml:lang attribute on the + nearest ancestor of the context node that has an xml:lang attribute. If there is no such + attribute, then lang returns false. If there is such an attribute, then lang returns + true if the attribute value is equal to the argument ignoring case, or if there is some + suffix starting with - such that the attribute value is equal to the argument ignoring + that suffix of the attribute value and ignoring case.
+ Arguments: + + + + + + + + + +
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation

- W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions
- - -
@@ -396,99 +417,100 @@ fn:string()
- The string function converts an object to a string as follows: A node-set is converted to a string by returning the string-value of the node in the node-set that is first in document order. If the node-set is empty, an empty string is returned.
+ The string function converts an object to a string as follows: A node-set is converted + to a string by returning the string-value of the node in the node-set that is first in + document order. If the node-set is empty, an empty string is returned.
- Arguments: - - - - - - - - - -
TypeDescription
objectThe object to convert to a string
Examples:
- - - - - - - - - -
ExpressionResult
string(10)true

- W3C Documentation reference: String-Functions + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a string
Examples:
+ + + + + + + + + +
ExpressionResult
string(10)true

+ W3C Documentation reference: String-Functions
fn:concat()
- The concat function returns the concatenation of its arguments.
+ The concat function returns the concatenation of its arguments.
- Arguments: - - - - - - - - - -
TypeDescription
string*Strings to concatenate
Examples:
- - - - - - - - - -
ExpressionResult
concat("Release", 11)Release11

- W3C Documentation reference: String-Functions + Arguments: + + + + + + + + + +
TypeDescription
string*Strings to concatenate
Examples:
+ + + + + + + + + +
ExpressionResult
concat("Release", 11)Release11

+ W3C Documentation reference: String-Functions
fn:starts-with()
- The concat function returns the concatenation of its arguments.
+ The concat function returns the concatenation of its arguments.
- Arguments: - - - - - - - - - - - - - -
TypeDescription
string
stringThe object to convert to a string
Examples:
- - - - - - - - - -
ExpressionResult
concat("Release", 11)Release11

- W3C Documentation reference: String-Functions + Arguments: + + + + + + + + + + + + + +
TypeDescription
string
stringThe object to convert to a string
Examples:
+ + + + + + + + + +
ExpressionResult
concat("Release", 11)Release11

+ W3C Documentation reference: String-Functions
-
@@ -499,211 +521,233 @@ fn:number()
- The number function converts its argument to a number as follows: -
    -
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • -
  • boolean true is converted to 1; boolean false is converted to 0
  • -
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • -
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • -
+ The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign + followed by a Number followed by whitespace is converted to the IEEE 754 number + that is nearest (according to the IEEE 754 round-to-nearest rule) to the + mathematical value represented by the string; any other string is converted to + NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function + and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in + a way that is dependent on that type
  • +
- Arguments: - - - - - - - - - -
TypeDescription
objectThe object to convert to a number
Examples:
- - - - - - - - - - - - - -
ExpressionResult
number(10)10
number("")NaN

- W3C Documentation reference + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
number(10)10
number("")NaN

+ W3C Documentation reference
fn:sum()
- The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
+ The sum function returns the sum, for each node in the argument node-set, of the result + of converting the string-values of the node to a number.
- Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - -
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

- W3C Documentation reference + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + +
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

+ W3C Documentation reference
fn:floor()
- The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
+ The floor function returns the largest (closest to positive infinity) number that is not + greater than the argument and that is an integer.
- Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - - - - - - - - - -
ExpressionResult
floor(3.1)4
floor(3.9)4
floor(3.5)4

- W3C Documentation reference + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)4
floor(3.9)4
floor(3.5)4

+ W3C Documentation reference
fn:ceiling()
- The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
+ The ceiling function returns the smallest (closest to negative infinity) number that is + not less than the argument and that is an integer.
- Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - - - - - - - - - -
ExpressionResult
floor(3.1)3
floor(3.9)3
floor(3.5)3

- W3C Documentation reference + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)3
floor(3.5)3

+ W3C Documentation reference
fn:round()
- The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. + The round function returns the number that is closest to the argument and that is an + integer. If there are two such numbers, then the one that is closest to positive + infinity is returned. If the argument is NaN, then NaN is returned. If the argument is + positive infinity, then positive infinity is returned. If the argument is negative + infinity, then negative infinity is returned. If the argument is positive zero, then + positive zero is returned. If the argument is negative zero, then negative zero is + returned. If the argument is less than zero, but greater than or equal to -0.5, then + negative zero is returned. -

NOTE

- For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
+

NOTE

+ For these last two cases, the result of calling the round function is not the same as + the result of adding 0.5 and then calling the floor function.
- Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - - - - - - - - - -
ExpressionResult
floor(3.1)3
floor(3.9)4
floor(3.5)3

- W3C Documentation reference + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)4
floor(3.5)3

+ W3C Documentation reference
- -
- - + + fn:name() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:name()
- Returns the name of a node, as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName.
+ Returns the name of a node, as an xs:string that is either the zero-length string, or + has the lexical form of an xs:QName.
- If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ If the argument is omitted, it defaults to the context item (.). The behavior of the + function if the argument is omitted is exactly the same as if the context item had been + passed as the argument.
- The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; + if the context item is not a node [err:XPTY0004]XP.
- If the argument is supplied and is the empty sequence, the function returns the zero-length string.
+ If the argument is supplied and is the empty sequence, the function returns the + zero-length string.
- If the target node has no name (that is, if it is a document node, a comment, a text node, or a namespace binding having no name), the function returns the zero-length string.
+ If the target node has no name (that is, if it is a document node, a comment, a text + node, or a namespace binding having no name), the function returns the zero-length + string.
Otherwise, the value returned is fn:string(fn:node-name($arg)).

@@ -731,23 +775,32 @@ l:library
- W3C Documentation reference + W3C Documentation reference
fn:local-name() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:local-name()
- Returns the local part of the name of $arg as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName.
+ Returns the local part of the name of $arg as an xs:string that will either be the + zero-length string or will have the lexical form of an xs:NCName.
- If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ If the argument is omitted, it defaults to the context item (.). The behavior of the + function if the argument is omitted is exactly the same as if the context item had been + passed as the argument.
- The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; + if the context item is not a node [err:XPTY0004]XP.
- If the argument is supplied and is the empty sequence, the function returns the zero-length string.
+ If the argument is supplied and is the empty sequence, the function returns the + zero-length string.
- If the target node has no name (that is, if it is a document node, a comment, or a text node), the function returns the zero-length string.
+ If the target node has no name (that is, if it is a document node, a comment, or a text + node), the function returns the zero-length string.
- Otherwise, the value returned will be the local part of the expanded-QName of the target node (as determined by the dm:node-name accessor in Section 5.11 node-name Accessor). This will be an xs:string whose lexical form is an xs:NCName.
+ Otherwise, the value returned will be the local part of the expanded-QName of the target + node (as determined by the dm:node-name accessor in Section 5.11 node-name Accessor). + This will be an xs:string whose lexical form is an xs:NCName.

Arguments: @@ -774,13 +827,16 @@
- W3C Documentation reference + W3C Documentation reference
fn:nilled() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:nilled()
- Returns an xs:boolean indicating whether the argument node is "nilled". If the argument is not an element node, returns the empty sequence. If the argument is the empty sequence, returns the empty sequence.
+ Returns an xs:boolean indicating whether the argument node is "nilled". If the argument + is not an element node, returns the empty sequence. If the argument is the empty + sequence, returns the empty sequence.

Arguments: @@ -807,17 +863,28 @@
- W3C Documentation reference + W3C Documentation reference
fn:base-uri() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:base-uri()
- Returns the value of the base-uri URI property for $arg as defined by the accessor function dm:base-uri() for that kind of node in Section 5.2 base-uri AccessorDM. If $arg is not specified, the behavior is identical to calling the function with the context item (.) as argument. The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ Returns the value of the base-uri URI property for $arg as defined by the accessor + function dm:base-uri() for that kind of node in Section 5.2 base-uri AccessorDM. If $arg + is not specified, the behavior is identical to calling the function with the context + item (.) as argument. The following errors may be raised: if the context item is + undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
If $arg is the empty sequence, the empty sequence is returned.
- - Document, element and processing-instruction nodes have a base-uri property which may be empty. The base-uri property of all other node types is the empty sequence. The value of the base-uri property is returned if it exists and is not empty. Otherwise, if the node has a parent, the value of dm:base-uri() applied to its parent is returned, recursively. If the node does not have a parent, or if the recursive ascent up the ancestor chain encounters a node whose base-uri property is empty and it does not have a parent, the empty sequence is returned.
+ + Document, element and processing-instruction nodes have a base-uri property which may be + empty. The base-uri property of all other node types is the empty sequence. The value of + the base-uri property is returned if it exists and is not empty. Otherwise, if the node + has a parent, the value of dm:base-uri() applied to its parent is returned, recursively. + If the node does not have a parent, or if the recursive ascent up the ancestor chain + encounters a node whose base-uri property is empty and it does not have a parent, the + empty sequence is returned.

Arguments: @@ -844,19 +911,28 @@
- W3C Documentation reference + W3C Documentation reference
fn:document-uri() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:document-uri()
- Returns the value of the document-uri property for $arg as defined by the dm:document-uri accessor function defined in Section 6.1.2 AccessorsDM.
+ Returns the value of the document-uri property for $arg as defined by the + dm:document-uri accessor function defined in Section 6.1.2 AccessorsDM.
If $arg is the empty sequence, the empty sequence is returned.
- Returns the empty sequence if the node is not a document node. Otherwise, returns the value of the dm:document-uri accessor of the document node.
+ Returns the empty sequence if the node is not a document node. Otherwise, returns the + value of the dm:document-uri accessor of the document node.
- In the case of a document node $D returned by the fn:doc function, or a document node at the root of a tree containing a node returned by the fn:collection function, it will always be true that either fn:document-uri($D) returns the empty sequence, or that the following expression is true: fn:doc(fn:document-uri($D)) is $D. It is implementation-defined whether this guarantee also holds for document nodes obtained by other means, for example a document node passed as the initial context node of a query or transformation.
+ In the case of a document node $D returned by the fn:doc function, or a document node at + the root of a tree containing a node returned by the fn:collection function, it will + always be true that either fn:document-uri($D) returns the empty sequence, or that the + following expression is true: fn:doc(fn:document-uri($D)) is $D. It is + implementation-defined whether this guarantee also holds for document nodes obtained by + other means, for example a document node passed as the initial context node of a query + or transformation.

Arguments: @@ -883,21 +959,32 @@ document-uri(/library/fiction:book[1]) - http://example.com/library.xml (assuming the document URI of the first fiction:book element is "http://example.com/library.xml") + http://example.com/library.xml (assuming the document URI of the first + fiction:book element is "http://example.com/library.xml") document-uri(/library) - http://example.com/library.xml (assuming the document URI of the library element is "http://example.com/library.xml") + http://example.com/library.xml (assuming the document URI of the library + element is "http://example.com/library.xml")
- W3C Documentation reference + W3C Documentation reference
fn:lang() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:lang()
- This function tests whether the language of $node, or the context item if the second argument is omitted, as specified by xml:lang attributes is the same as, or is a sublanguage of, the language specified by $testlang. The behavior of the function if the second argument is omitted is exactly the same as if the context item (.) had been passed as the second argument. The language of the argument node, or the context item if the second argument is omitted, is determined by the value of the xml:lang attribute on the node, or, if the node has no such attribute, by the value of the xml:lang attribute on the nearest ancestor of the node that has an xml:lang attribute. If there is no such ancestor, then the function returns false

+ This function tests whether the language of $node, or the context item if the second + argument is omitted, as specified by xml:lang attributes is the same as, or is a + sublanguage of, the language specified by $testlang. The behavior of the function if the + second argument is omitted is exactly the same as if the context item (.) had been + passed as the second argument. The language of the argument node, or the context item if + the second argument is omitted, is determined by the value of the xml:lang attribute on + the node, or, if the node has no such attribute, by the value of the xml:lang attribute + on the nearest ancestor of the node that has an xml:lang attribute. If there is no such + ancestor, then the function returns false

Arguments: @@ -918,21 +1005,26 @@ Examples: Look W3C documentation below.
- W3C Documentation reference + W3C Documentation referencefn:root() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:root()
- Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.
+ Returns the root of the tree to which $arg belongs. This will usually, but not + necessarily, be a document node.
If $arg is the empty sequence, the empty sequence is returned.
If $arg is a document node, $arg is returned.
- If the function is called without an argument, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ If the function is called without an argument, the context item (.) is used as the + default argument. The behavior of the function if the argument is omitted is exactly the + same as if the context item had been passed as the argument.
- The following errors may be raised: if the context item is undefined [err:XPDY0002]; if the context item is not a node [err:XPTY0004].

+ The following errors may be raised: if the context item is undefined [err:XPDY0002]; if + the context item is not a node [err:XPTY0004].

Arguments:
@@ -958,13 +1050,15 @@

- W3C Documentation reference + W3C Documentation reference
fn:count() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:count()
- Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

+ Returns the number of items in the value of $arg. Returns 0 if $arg is the empty + sequence.

Arguments: @@ -994,14 +1088,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:avg() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:avg()
- Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

+ Returns the number of items in the value of $arg. Returns 0 if $arg is the empty + sequence.

Arguments: @@ -1027,14 +1123,17 @@

- W3C Documentation reference + W3C Documentation reference
fn:max() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:max()
- Selects an item from the input sequence $arg whose value is greater than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is ·implementation dependent·.

+ Selects an item from the input sequence $arg whose value is greater than or equal to the + value of every other item in the input sequence. If there are two or more such items, + then the specific item whose value is returned is ·implementation dependent·.

Arguments: @@ -1068,13 +1167,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:min() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:min()
- Selects an item from the input sequence $arg whose value is less than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is ·implementation dependent·.

+ Selects an item from the input sequence $arg whose value is less than or equal to the + value of every other item in the input sequence. If there are two or more such items, + then the specific item whose value is returned is ·implementation dependent·.

Arguments: @@ -1108,16 +1210,21 @@

- W3C Documentation reference + W3C Documentation reference
fn:sum() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:sum()
- Returns a value obtained by adding together the values in $arg. If $zero is not specified, then the value returned for an empty sequence is the xs:integer value 0. If $zero is specified, then the value returned for an empty sequence is $zero.
+ Returns a value obtained by adding together the values in $arg. If $zero is not + specified, then the value returned for an empty sequence is the xs:integer value 0. If + $zero is specified, then the value returned for an empty sequence is $zero.
- Any values of type xs:untypedAtomic in $arg are cast to xs:double. The items in the resulting sequence may be reordered in an arbitrary order. The resulting sequence is referred to below as the converted sequence.

+ Any values of type xs:untypedAtomic in $arg are cast to xs:double. The items in the + resulting sequence may be reordered in an arbitrary order. The resulting sequence is + referred to below as the converted sequence.

Arguments: @@ -1147,9 +1254,10 @@

- W3C Documentation reference + W3C Documentation reference
- +
@@ -1157,26 +1265,33 @@
- - + + fn:boolean() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:boolean()
- Computes the effective boolean value of the sequence $arg. See Section 2.4.3 Effective Boolean ValueXP
+ Computes the effective boolean value of the sequence $arg. See Section 2.4.3 Effective + Boolean ValueXP
If $arg is the empty sequence, fn:boolean returns false.
If $arg is a sequence whose first item is a node, fn:boolean returns true.
- If $arg is a singleton value of type xs:boolean or a derived from xs:boolean, fn:boolean returns $arg.
+ If $arg is a singleton value of type xs:boolean or a derived from xs:boolean, fn:boolean + returns $arg.
- If $arg is a singleton value of type xs:string or a type derived from xs:string, xs:anyURI or a type derived from xs:anyURI or xs:untypedAtomic, fn:boolean returns false if the operand value has zero length; otherwise it returns true.
+ If $arg is a singleton value of type xs:string or a type derived from xs:string, + xs:anyURI or a type derived from xs:anyURI or xs:untypedAtomic, fn:boolean returns false + if the operand value has zero length; otherwise it returns true.
- If $arg is a singleton value of any numeric type or a type derived from a numeric type, fn:boolean returns false if the operand value is NaN or is numerically equal to zero; otherwise it returns true. + If $arg is a singleton value of any numeric type or a type derived from a numeric type, + fn:boolean returns false if the operand value is NaN or is numerically equal to zero; + otherwise it returns true. In all other cases, fn:boolean raises a type error [err:FORG0006].
- The static semantics of this function are described in Section 7.2.4 The fn:boolean and fn:not functionsFS.

+ The static semantics of this function are described in Section 7.2.4 The fn:boolean and + fn:not functionsFS.

Arguments: @@ -1210,15 +1325,16 @@

- W3C Documentation reference + W3C Documentation reference
- + fn:true()
Returns the xs:boolean value true. Equivalent to xs:boolean("1").

- + Return type: xs:boolean

Examples:
@@ -1231,7 +1347,8 @@
true

- W3C Documentation reference + W3C Documentation reference
false
-
W3C Documentation reference + W3C Documentation reference
fn:not()
- $arg is first reduced to an effective boolean value by applying the fn:boolean() function. Returns true if the effective boolean value is false, and false if the effective boolean value is true.

- + $arg is first reduced to an effective boolean value by applying the fn:boolean() + function. Returns true if the effective boolean value is false, and false if the + effective boolean value is true.

+ Arguments and return type: @@ -1286,10 +1406,11 @@
false

- W3C Documentation reference + W3C Documentation reference
- - + +
@@ -1297,123 +1418,140 @@
- + fn:string(object)
- Returns the value of $arg represented as a xs:string. If no argument is supplied, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ Returns the value of $arg represented as a xs:string. If no argument is supplied, the + context item (.) is used as the default argument. The behavior of the function if the + argument is omitted is exactly the same as if the context item had been passed as the + argument.
- If the context item is undefined, error [err:XPDY0002]XP is raised.
- - If $arg is the empty sequence, the zero-length string is returned.
- - If $arg is a node, the function returns the string-value of the node, as obtained using the dm:string-value accessor defined in the Section 5.13 string-value AccessorDM.
- - If $arg is an atomic value, then the function returns the same string as is returned by the expression " $arg cast as xs:string " (see 17 Casting).
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringThe object to convert to a string
- Return type: xs:string

- Examples:
- - - - - - - - - - - - - -
ExpressionResult
string((1<0))false
string(.11)0.11

- W3C Documentation reference + If the context item is undefined, error [err:XPDY0002]XP is raised.
+ + If $arg is the empty sequence, the zero-length string is returned.
+ + If $arg is a node, the function returns the string-value of the node, as obtained using + the dm:string-value accessor defined in the Section 5.13 string-value AccessorDM.
+ + If $arg is an atomic value, then the function returns the same string as is returned by + the expression " $arg cast as xs:string " (see 17 Casting).
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference
- + fn:codepoints-to-string()
- Creates an xs:string from a sequence of The Unicode Standard code points. Returns the zero-length string if $arg is the empty sequence. If any of the code points in $arg is not a legal XML character, an error is raised [err:FOCH0001].
- Arguments and return type: - - - - - - - - - -
TypeDescription
xs:integer*$arg
- Return type: xs:string

- Examples:
- - - - - - - - - - - - - -
ExpressionResult
codepoints-to-string((2309, 2358, 2378, 2325))अशॊक
codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41))( ͡° ͜ʖ ͡°)

- W3C Documentation reference + Creates an xs:string from a sequence of The Unicode Standard code points. Returns the + zero-length string if $arg is the empty sequence. If any of the code points in $arg is + not a legal XML character, an error is raised [err:FOCH0001].
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:integer*$arg
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
codepoints-to-string((2309, 2358, 2378, 2325))अशॊक
codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)) + ( ͡° ͜ʖ ͡°)

+ W3C Documentation reference
fn:string-to-codepoints()
- Returns the sequence of The Unicode Standard code points that constitute an xs:string. If $arg is a zero-length string or the empty sequence, the empty sequence is returned.
- Arguments and return type: - - - - - - - - - -
TypeDescription
xs:string*$arg
- Return type: xs:integer*

- Examples:
- - - - - - - - - -
ExpressionResult
string-to-codepoints("Thérèse")(84, 104, 233, 114, 232, 115, 101)

- W3C Documentation reference + Returns the sequence of The Unicode Standard code points that constitute an xs:string. + If $arg is a zero-length string or the empty sequence, the empty sequence is + returned.
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string*$arg
+ Return type: xs:integer*

+ Examples:
+ + + + + + + + + +
ExpressionResult
string-to-codepoints("Thérèse")(84, 104, 233, 114, 232, 115, 101)

+ W3C Documentation reference
fn:compare()
- Returns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively less than, equal to, or greater than the value of $comparand2, according to the rules of the collation that is used.
+ Returns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively + less than, equal to, or greater than the value of $comparand2, according to the rules of + the collation that is used.
+ + The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations.
- The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations.
- If either argument is the empty sequence, the result is the empty sequence.
- - This function, invoked with the first signature, backs up the "eq", "ne", "gt", "lt", "le" and "ge" operators on string values.
+ + This function, invoked with the first signature, backs up the "eq", "ne", "gt", "lt", + "le" and "ge" operators on string values.
Arguments and return type: @@ -1453,13 +1591,17 @@
1

- W3C Documentation reference + W3C Documentation reference
fn:codepoint-equal()
- Returns true or false depending on whether the value of $comparand1 is equal to the value of $comparand2, according to the Unicode code point collation.
+ Returns true or false depending on whether the value of $comparand1 is equal to the + value of $comparand2, according to the Unicode code + point collation.
If either argument is the empty sequence, the result is the empty sequence.
Arguments and return type: @@ -1493,15 +1635,22 @@ false
- W3C Documentation reference + W3C Documentation reference
fn:concat()
- Accepts two or more xs:anyAtomicType arguments and casts them to xs:string. Returns the xs:string that is the concatenation of the values of its arguments after conversion. If any of the arguments is the empty sequence, the argument is treated as the zero-length string.
+ Accepts two or more xs:anyAtomicType arguments and casts them to xs:string. Returns the + xs:string that is the concatenation of the values of its arguments after conversion. If + any of the arguments is the empty sequence, the argument is treated as the zero-length + string.
- The fn:concat function is specified to allow two or more arguments, which are concatenated together. This is the only function specified in this document that allows a variable number of arguments. This capability is retained for compatibility with [XML Path Language (XPath) Version 1.0].
+ The fn:concat function is specified to allow two or more arguments, which are + concatenated together. This is the only function specified in this document that allows + a variable number of arguments. This capability is retained for compatibility with [XML + Path Language (XPath) Version 1.0].
Arguments and return type: @@ -1533,7 +1682,8 @@ - + @@ -1541,13 +1691,16 @@
ungrateful
concat('Thy ', (), 'old ', "groans", "", ' ring', ' yet', ' in', ' my', ' ancient',' ears.')concat('Thy ', (), 'old ', "groans", "", ' ring', ' yet', ' in', ' my', ' + ancient',' ears.') Thy old groans ring yet in my ancient ears.
Ciao!

- W3C Documentation reference + W3C Documentation reference
fn:string-join()
- Returns a xs:string created by concatenating the members of the $arg1 sequence using $arg2 as a separator. If the value of $arg2 is the zero-length string, then the members of $arg1 are concatenated without a separator.
+ Returns a xs:string created by concatenating the members of the $arg1 sequence using + $arg2 as a separator. If the value of $arg2 is the zero-length string, then the members + of $arg1 are concatenated without a separator.
If the value of $arg1 is the empty sequence, the zero-length string is returned.
Arguments and return type: @@ -1581,19 +1734,28 @@ Blow, blow, thou winter wind!
- W3C Documentation reference + W3C Documentation reference
- + fn:substring()
- Returns the portion of the value of $sourceString beginning at the position indicated by the value of $startingLoc and continuing for the number of characters indicated by the value of $length. The characters returned do not extend beyond $sourceString. If $startingLoc is zero or negative, only those characters in positions greater than zero are returned.
- More specifically, the three argument version of the function returns the characters in $sourceString whose position $p obeys:
+ Returns the portion of the value of $sourceString beginning at the position indicated by + the value of $startingLoc and continuing for the number of characters indicated by the + value of $length. The characters returned do not extend beyond $sourceString. If + $startingLoc is zero or negative, only those characters in positions greater than zero + are returned.
+ More specifically, the three argument version of the function returns the characters in + $sourceString whose position $p obeys:
fn:round($startingLoc) <= $p < fn:round($startingLoc) + fn:round($length)
- The two argument version of the function assumes that $length is infinite and returns the characters in $sourceString whose position $p obeys:
+ The two argument version of the function assumes that $length is infinite and returns + the characters in $sourceString whose position $p obeys:
fn:round($startingLoc) <= $p < fn:round(INF)
- In the above computations, the rules for op:numeric-less-than() and op:numeric-greater-than() apply.
- If the value of $sourceString is the empty sequence, the zero-length string is returned.
+ In the above computations, the rules for op:numeric-less-than() and + op:numeric-greater-than() apply.
+ If the value of $sourceString is the empty sequence, the zero-length string is + returned.
Note:
The first character of a string is located at position 1, not position 0.
@@ -1633,7 +1795,8 @@ ada
- W3C Documentation reference + W3C Documentation reference
- If no argument is supplied, $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
+ If no argument is supplied, $arg defaults to the string value (calculated using + fn:string()) of the context item (.). If no argument is supplied and the context item is + undefined an error is raised: [err:XPDY0002].
Arguments and return type: @@ -1672,17 +1837,22 @@
0

-
W3C Documentation reference + W3C Documentation reference
fn:normalize-space()
- Returns the value of $arg with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of one or more than one whitespace character with a single space, #x20.
+ Returns the value of $arg with whitespace normalized by stripping leading and trailing + whitespace and replacing sequences of one or more than one whitespace character with a + single space, #x20.
If the value of $arg is the empty sequence, returns the zero-length string.
- If no argument is supplied, then $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
+ If no argument is supplied, then $arg defaults to the string value (calculated using + fn:string()) of the context item (.). If no argument is supplied and the context item is + undefined an error is raised: [err:XPDY0002].
Arguments and return type: @@ -1703,7 +1873,7 @@ - + @@ -1711,13 +1881,17 @@
Result
normalize-space(" The wealthy curled darlings of our nation. ")normalize-space(" The wealthy curled darlings of our nation. ") The wealthy curled darlings of our nation.
""

- W3C Documentation reference + W3C Documentation reference
fn:normalize-unicode()
- Returns the value of $arg normalized according to the normalization criteria for a normalization form identified by the value of $normalizationForm. The effective value of the $normalizationForm is computed by removing leading and trailing blanks, if present, and converting to upper case.
+ Returns the value of $arg normalized according to the normalization criteria for a + normalization form identified by the value of $normalizationForm. The effective value of + the $normalizationForm is computed by removing leading and trailing blanks, if present, + and converting to upper case.
If the value of $arg is the empty sequence, returns the zero-length string.
@@ -1744,17 +1918,26 @@ Result - normalize-unicode("test ") + normalize-unicode("test ") test
- W3C Documentation reference + W3C Documentation reference
fn:upper-case()
- Returns the value of $arg after translating every character to its upper-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every lower-case character that does not have an upper-case correspondent, as well as every upper-case character, is included in the returned value in its original form.
+ Returns the value of $arg after translating every character to its upper-case + correspondent as defined in the appropriate case mappings section in the Unicode + standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 + update, only locale-insensitive case mappings should be applied. Beginning with version + 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default + case operations, which are full case mappings in the absence of tailoring for particular + languages and environments. Every lower-case character that does not have an upper-case + correspondent, as well as every upper-case character, is included in the returned value + in its original form.
If the value of $arg is the empty sequence, the zero-length string is returned.
@@ -1781,13 +1964,22 @@ ABCD0
- W3C Documentation reference + W3C Documentation reference
fn:lower-case()
- Returns the value of $arg after translating every character to its lower-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every upper-case character that does not have a lower-case correspondent, as well as every lower-case character, is included in the returned value in its original form.
+ Returns the value of $arg after translating every character to its lower-case + correspondent as defined in the appropriate case mappings section in the Unicode + standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 + update, only locale-insensitive case mappings should be applied. Beginning with version + 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default + case operations, which are full case mappings in the absence of tailoring for particular + languages and environments. Every upper-case character that does not have a lower-case + correspondent, as well as every lower-case character, is included in the returned value + in its original form.
If the value of $arg is the empty sequence, the zero-length string is returned.
@@ -1814,21 +2006,30 @@ abcd0
- W3C Documentation reference + W3C Documentation reference
fn:translate()
- Returns the value of $arg modified so that every character in the value of $arg that occurs at some position N in the value of $mapString has been replaced by the character that occurs at position N in the value of $transString.
+ Returns the value of $arg modified so that every character in the value of $arg that + occurs at some position N in the value of $mapString has been replaced by the character + that occurs at position N in the value of $transString.
If the value of $arg is the empty sequence, the zero-length string is returned.
- Every character in the value of $arg that does not appear in the value of $mapString is unchanged.
+ Every character in the value of $arg that does not appear in the value of $mapString is + unchanged.
- Every character in the value of $arg that appears at some position M in the value of $mapString, where the value of $transString is less than M characters in length, is omitted from the returned value. If $mapString is the zero-length string $arg is returned.
+ Every character in the value of $arg that appears at some position M in the value of + $mapString, where the value of $transString is less than M characters in length, is + omitted from the returned value. If $mapString is the zero-length string $arg is + returned.
- If a character occurs more than once in $mapString, then the first occurrence determines the replacement character. If $transString is longer than $mapString, the excess characters are ignored.
+ If a character occurs more than once in $mapString, then the first occurrence determines + the replacement character. If $transString is longer than $mapString, the excess + characters are ignored.
Arguments and return type: @@ -1869,21 +2070,32 @@
ABdAB

- W3C Documentation reference + W3C Documentation reference
fn:encode-for-uri()
- This function encodes reserved characters in an xs:string that is intended to be used in the path segment of a URI. It is invertible but not idempotent. This function applies the URI escaping rules defined in section 2 of [RFC 3986] to the xs:string supplied as $uri-part. The effect of the function is to escape reserved characters. Each such character in the string is replaced with its percent-encoded form as described in [RFC 3986].
+ This function encodes reserved characters in an xs:string that is intended to be used in + the path segment of a URI. It is invertible but not idempotent. This function applies + the URI escaping rules defined in section 2 of [RFC 3986] to the xs:string supplied as + $uri-part. The effect of the function is to escape reserved characters. Each such + character in the string is replaced with its percent-encoded form as described in [RFC + 3986].
If $uri-part is the empty sequence, returns the zero-length string.
- All characters are escaped except those identified as "unreserved" by [RFC 3986], that is the upper- and lower-case letters A-Z, the digits 0-9, HYPHEN-MINUS ("-"), LOW LINE ("_"), FULL STOP ".", and TILDE "~".
+ All characters are escaped except those identified as "unreserved" by [RFC 3986], that + is the upper- and lower-case letters A-Z, the digits 0-9, HYPHEN-MINUS ("-"), LOW LINE + ("_"), FULL STOP ".", and TILDE "~".
- Note that this function escapes URI delimiters and therefore cannot be used indiscriminately to encode "invalid" characters in a path segment.
+ Note that this function escapes URI delimiters and therefore cannot be used + indiscriminately to encode "invalid" characters in a path segment.
- Since [RFC 3986] recommends that, for consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings, this function must always generate hexadecimal values using the upper-case letters A-F.
+ Since [RFC 3986] recommends that, for consistency, URI producers and normalizers should + use uppercase hexadecimal digits for all percent-encodings, this function must always + generate hexadecimal values using the upper-case letters A-F.
Arguments and return type: @@ -1916,16 +2128,20 @@
http://www.example.com/
100%25%20organic

- W3C Documentation reference + W3C Documentation reference
fn:iri-to-uri()
- This function converts an xs:string containing an IRI into a URI according to the rules spelled out in Section 3.1 of [RFC 3987]. It is idempotent but not invertible.
+ This function converts an xs:string containing an IRI into a URI according to the rules + spelled out in Section 3.1 of [RFC 3987]. It is idempotent but not invertible.
+ + If $iri contains a character that is invalid in an IRI, such as the space character (see + note below), the invalid character is replaced by its percent-encoded form as described + in [RFC 3986] before the conversion is performed.
- If $iri contains a character that is invalid in an IRI, such as the space character (see note below), the invalid character is replaced by its percent-encoded form as described in [RFC 3986] before the conversion is performed.
- If $iri is the empty sequence, returns the zero-length string.
Arguments and return type: @@ -1955,17 +2171,26 @@ http://www.example.com/
~b%C3%A9b%C3%A9
- W3C Documentation reference + W3C Documentation reference
fn:escape-html-uri()
- This function escapes all characters except printable characters of the US-ASCII coded character set, specifically the octets ranging from 32 to 126 (decimal). The effect of the function is to escape a URI in the manner html user agents handle attribute values that expect URIs. Each character in $uri to be escaped is replaced by an escape sequence, which is formed by encoding the character as a sequence of octets in UTF-8, and then representing each of these octets in the form %HH, where HH is the hexadecimal representation of the octet. This function must always generate hexadecimal values using the upper-case letters A-F.
+ This function escapes all characters except printable characters of the US-ASCII coded + character set, specifically the octets ranging from 32 to 126 (decimal). The effect of + the function is to escape a URI in the manner html user agents handle attribute values + that expect URIs. Each character in $uri to be escaped is replaced by an escape + sequence, which is formed by encoding the character as a sequence of octets in UTF-8, + and then representing each of these octets in the form %HH, where HH is the hexadecimal + representation of the octet. This function must always generate hexadecimal values using + the upper-case letters A-F.
If $uri is the empty sequence, returns the zero-length string.

Note:

- The behavior of this function corresponds to the recommended handling of non-ASCII characters in URI attribute values as described in [HTML 4.0] Appendix B.2.1.

+ The behavior of this function corresponds to the recommended handling of non-ASCII + characters in URI attribute values as described in [HTML 4.0] Appendix B.2.1.

Arguments and return type: @@ -1987,25 +2212,33 @@ Result - escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean") + escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean") + http://www.example.com/00/Weather/CA/Los Angeles#ocean
- W3C Documentation reference + W3C Documentation reference
fn:contains()
- Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of $arg2, according to the collation that is used. + Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the + beginning, at the end, or anywhere within) at least one sequence of collation units that + provides a minimal match to the collation units in the value of $arg2, according to the + collation that is used. - If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
If the value of $arg2 is the zero-length string, then the function returns true.
If the value of $arg1 is the zero-length string, the function returns false.
- The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations. If the specified collation does not support collation units + an error ·may· be raised [err:FOCH0004].

Arguments and return type: @@ -2047,19 +2280,27 @@ true
- W3C Documentation reference + W3C Documentation reference
fn:starts-with()
- Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used. + Returns an xs:boolean indicating whether or not the value of $arg1 starts with a + sequence of collation units that provides a match to the collation units of $arg2 + according to the collation that is used. - If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
- If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
+ If the value of $arg2 is the zero-length string, then the function returns true. If the + value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length + string, then the function returns false.
- The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations. If the specified collation does not support collation units + an error ·may· be raised [err:FOCH0004].

Arguments and return type: @@ -2101,19 +2342,27 @@ true
- W3C Documentation reference + W3C Documentation reference
fn:ends-with()
- Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used.
+ Returns an xs:boolean indicating whether or not the value of $arg1 starts with a + sequence of collation units that provides a match to the collation units of $arg2 + according to the collation that is used.
- If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
- If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
+ If the value of $arg2 is the zero-length string, then the function returns true. If the + value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length + string, then the function returns false.
- The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations. If the specified collation does not support collation units + an error ·may· be raised [err:FOCH0004].

Arguments and return type: @@ -2155,21 +2404,29 @@ true
- W3C Documentation reference + W3C Documentation reference
fn:substring-before()
- Returns the substring of the value of $arg1 that precedes in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
+ Returns the substring of the value of $arg1 that precedes in the value of $arg1 the + first occurrence of a sequence of collation units that provides a minimal match to the + collation units of $arg2 according to the collation that is used.
- If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
- If the value of $arg2 is the zero-length string, then the function returns the zero-length string.
+ If the value of $arg2 is the zero-length string, then the function returns the + zero-length string.
- If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
+ If the value of $arg1 does not contain a string that is equal to the value of $arg2, + then the function returns the zero-length string.
- The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations If the specified collation does not support collation units an + error ·may· be raised [err:FOCH0004].

Arguments and return type: @@ -2207,21 +2464,29 @@ <empty string>
- W3C Documentation reference + W3C Documentation reference
fn:substring-after()
- Returns the substring of the value of $arg1 that follows in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
+ Returns the substring of the value of $arg1 that follows in the value of $arg1 the first + occurrence of a sequence of collation units that provides a minimal match to the + collation units of $arg2 according to the collation that is used.
- If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
- If the value of $arg2 is the zero-length string, then the function returns the value of $arg1.
+ If the value of $arg2 is the zero-length string, then the function returns the value of + $arg1.
- If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
+ If the value of $arg1 does not contain a string that is equal to the value of $arg2, + then the function returns the zero-length string.
- The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations If the specified collation does not support collation units an + error ·may· be raised [err:FOCH0004].

Arguments and return type: @@ -2259,23 +2524,32 @@ too
- W3C Documentation reference + W3C Documentation reference
fn:matches()
- The function returns true if $input matches the regular expression supplied as $pattern as influenced by the value of $flags, if present; otherwise, it returns false.
+ The function returns true if $input matches the regular expression supplied as $pattern + as influenced by the value of $flags, if present; otherwise, it returns false.
- The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ The effect of calling the first version of this function (omitting the argument $flags) + is the same as the effect of calling the second version with the $flags argument set to + a zero-length string. Flags are defined in 7.6.1.1 Flags.
If $input is the empty sequence, it is interpreted as the zero-length string.
- Unless the metacharacters ^ and $ are used as anchors, the string is considered to match the pattern if any substring matches the pattern. But if anchors are used, the anchors must match the start/end of the string (in string mode), or the start/end of a line (in multiline mode).
+ Unless the metacharacters ^ and $ are used as anchors, the string is considered to match + the pattern if any substring matches the pattern. But if anchors are used, the anchors + must match the start/end of the string (in string mode), or the start/end of a line (in + multiline mode).
- An error is raised [err:FORX0002] if the value of $pattern is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.
+ An error is raised [err:FORX0002] if the value of $pattern is invalid according to the + rules described in section 7.6.1 Regular Expression Syntax.
- An error is raised [err:FORX0001] if the value of $flags is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.

+ An error is raised [err:FORX0001] if the value of $flags is invalid according to the + rules described in section 7.6.1 Regular Expression Syntax.

Arguments and return type: @@ -2313,23 +2587,36 @@ false
- W3C Documentation reference + W3C Documentation reference
fn:replace()
- The function returns the xs:string that is obtained by replacing each non-overlapping substring of $input that matches the given $pattern with an occurrence of the $replacement string.
+ The function returns the xs:string that is obtained by replacing each non-overlapping + substring of $input that matches the given $pattern with an occurrence of the + $replacement string.
- The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ The effect of calling the first version of this function (omitting the argument $flags) + is the same as the effect of calling the second version with the $flags argument set to + a zero-length string. Flags are defined in 7.6.1.1 Flags.
- The $flags argument is interpreted in the same manner as for the fn:matches() function.
+ The $flags argument is interpreted in the same manner as for the fn:matches() + function.
If $input is the empty sequence, it is interpreted as the zero-length string.
- If two overlapping substrings of $input both match the $pattern, then only the
first one (that is, the one whose first character comes first in the $input string) is replaced. + If two overlapping substrings of $input both match the $pattern, then only the
first + one (that is, the one whose first character comes first in the $input string) is + replaced. - Within the $replacement string, a variable $N may be used to refer to the substring captured by the Nth parenthesized sub-expression in the regular expression. For each match of the pattern, these variables are assigned the value of the content matched by the relevant sub-expression, and the modified replacement string is then substituted for the characters in $input that matched the pattern. $0 refers to the substring captured by the regular expression as a whole.

+ Within the $replacement string, a variable $N may be used to refer to the substring + captured by the Nth parenthesized sub-expression in the regular expression. For each + match of the pattern, these variables are assigned the value of the content matched by + the relevant sub-expression, and the modified replacement string is then substituted for + the characters in $input that matched the pattern. $0 refers to the substring captured + by the regular expression as a whole.

Arguments and return type: @@ -2375,23 +2662,33 @@ b
- W3C Documentation reference + W3C Documentation reference
fn:tokenize()
- This function breaks the $input string into a sequence of strings, treating any substring that matches $pattern as a separator. The separators themselves are not returned.
+ This function breaks the $input string into a sequence of strings, treating any + substring that matches $pattern as a separator. The separators themselves are not + returned.
- The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ The effect of calling the first version of this function (omitting the argument $flags) + is the same as the effect of calling the second version with the $flags argument set to + a zero-length string. Flags are defined in 7.6.1.1 Flags.
The $flags argument is interpreted in the same way as for the fn:matches() function.
- If $input is the empty sequence, or if $input is the zero-length string, the result is the empty sequence.
+ If $input is the empty sequence, or if $input is the zero-length string, the result is + the empty sequence.
- If the supplied $pattern matches a zero-length string, that is, if fn:matches("", $pattern, $flags) returns true, then an error is raised: [err:FORX0003].
+ If the supplied $pattern matches a zero-length string, that is, if fn:matches("", + $pattern, $flags) returns true, then an error is raised: [err:FORX0003].
- If a separator occurs at the start of the $input string, the result sequence will start with a zero-length string. Zero-length strings will also occur in the result sequence if a separator occurs at the end of the $input string, or if two adjacent substrings match the supplied $pattern.

+ If a separator occurs at the start of the $input string, the result sequence will start + with a zero-length string. Zero-length strings will also occur in the result sequence if + a separator occurs at the end of the $input string, or if two adjacent substrings match + the supplied $pattern.

Arguments and return type: @@ -2433,7 +2730,8 @@ ("1", "15", "", "24", "50", "")
- W3C Documentation reference + W3C Documentation reference
@@ -2443,18 +2741,25 @@
- - + fn:number() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:number()
- Returns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an xs:double
+ Returns the value indicated by $arg or, if $arg is not specified, the context item after + atomization, converted to an xs:double
- Calling the zero-argument version of the function is defined to give the same result as calling the single-argument version with the context item (.). That is, fn:number() is equivalent to fn:number(.).
+ Calling the zero-argument version of the function is defined to give the same result as + calling the single-argument version with the context item (.). That is, fn:number() is + equivalent to fn:number(.).
- If $arg is the empty sequence or if $arg or the context item cannot be converted to an xs:double, the xs:double value NaN is returned. If the context item is undefined an error is raised: [err:XPDY0002]XP.
+ If $arg is the empty sequence or if $arg or the context item cannot be converted to an + xs:double, the xs:double value NaN is returned. If the context item is undefined an + error is raised: [err:XPDY0002]XP.
- If $arg is the empty sequence, NaN is returned. Otherwise, $arg, or the context item after atomization, is converted to an xs:double following the rules of 17.1.3.2 Casting to xs:double. If the conversion to xs:double fails, the xs:double value NaN is returned.
+ If $arg is the empty sequence, NaN is returned. Otherwise, $arg, or the context item + after atomization, is converted to an xs:double following the rules of 17.1.3.2 Casting + to xs:double. If the conversion to xs:double fails, the xs:double value NaN is + returned.

Arguments: @@ -2469,17 +2774,25 @@ Return type: xs:double

- W3C Documentation reference + W3C Documentation reference
- + fn:abs() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:abs()
- Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise returns $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise returns + $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal + or xs:integer the type of the result is the same as the type of $arg. If the type of + $arg is a type derived from one of the numeric types, the result is an instance of the + base numeric type.
- For xs:float and xs:double arguments, if the argument is positive zero or negative zero, then positive zero is returned. If the argument is positive or negative infinity, positive infinity is returned.
+ For xs:float and xs:double arguments, if the argument is positive zero or negative zero, + then positive zero is returned. If the argument is positive or negative infinity, + positive infinity is returned.
- For detailed type semantics, see Section 7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions.
+ For detailed type semantics, see Section 7.2.3 The fn:abs, fn:ceiling, fn:floor, + fn:round, and fn:round-half-to-even functions.

Arguments: @@ -2509,15 +2822,22 @@
2137

- W3C Documentation reference + W3C Documentation reference
fn:ceiling() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:ceiling()
- Returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ Returns the smallest (closest to negative infinity) number with no fractional part that + is not less than the value of $arg. If type of $arg is one of the four numeric types + xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the + type of $arg. If the type of $arg is a type derived from one of the numeric types, the + result is an instance of the base numeric type.
- For xs:float and xs:double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero and greater than -1, negative zero is returned.
+ For xs:float and xs:double arguments, if the argument is positive zero, then positive + zero is returned. If the argument is negative zero, then negative zero is returned. If + the argument is less than zero and greater than -1, negative zero is returned.

Arguments: @@ -2551,15 +2871,21 @@
11

- W3C Documentation reference + W3C Documentation reference
fn:floor() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:floor()
- Returns the largest (closest to positive infinity) number with no fractional part that is not greater than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ Returns the largest (closest to positive infinity) number with no fractional part that + is not greater than the value of $arg. If type of $arg is one of the four numeric types + xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the + type of $arg. If the type of $arg is a type derived from one of the numeric types, the + result is an instance of the base numeric type.
- For float and double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned.
+ For float and double arguments, if the argument is positive zero, then positive zero is + returned. If the argument is negative zero, then negative zero is returned.

Arguments: @@ -2593,15 +2919,28 @@
10

- W3C Documentation reference + W3C Documentation reference
fn:round() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:round()
- Returns the number with no fractional part that is closest to the argument. If there are two such numbers, then the one that is closest to positive infinity is returned. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ Returns the number with no fractional part that is closest to the argument. If there are + two such numbers, then the one that is closest to positive infinity is returned. If type + of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer + the type of the result is the same as the type of $arg. If the type of $arg is a type + derived from one of the numeric types, the result is an instance of the base numeric + type.
- For xs:float and xs:double arguments, if the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. In the cases where positive zero or negative zero is returned, negative zero or positive zero may be returned as [XML Schema Part 2: Datatypes Second Edition] does not distinguish between the values positive zero and negative zero.
+ For xs:float and xs:double arguments, if the argument is positive infinity, then + positive infinity is returned. If the argument is negative infinity, then negative + infinity is returned. If the argument is positive zero, then positive zero is returned. + If the argument is negative zero, then negative zero is returned. If the argument is + less than zero, but greater than or equal to -0.5, then negative zero is returned. In + the cases where positive zero or negative zero is returned, negative zero or positive + zero may be returned as [XML Schema Part 2: Datatypes Second Edition] does not + distinguish between the values positive zero and negative zero.
For the last two cases, note that the result is not the same as fn:floor(x+0.5).

@@ -2637,23 +2976,39 @@ -10
- W3C Documentation reference + W3C Documentation reference
fn:round-half-to-even() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:round-half-to-even()
- The value returned is the nearest (that is, numerically closest) value to $arg that is a multiple of ten to the power of minus $precision. If two such values are equally near (e.g. if the fractional part in $arg is exactly .500...), the function returns the one whose least significant digit is even.
+ The value returned is the nearest (that is, numerically closest) value to $arg that is a + multiple of ten to the power of minus $precision. If two such values are equally near + (e.g. if the fractional part in $arg is exactly .500...), the function returns the one + whose least significant digit is even.
- If the type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ If the type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or + xs:integer the type of the result is the same as the type of $arg. If the type of $arg + is a type derived from one of the numeric types, the result is an instance of the base + numeric type.
- The first signature of this function produces the same result as the second signature with $precision=0.
+ The first signature of this function produces the same result as the second signature + with $precision=0.
- For arguments of type xs:float and xs:double, if the argument is NaN, positive or negative zero, or positive or negative infinity, then the result is the same as the argument. In all other cases, the argument is cast to xs:decimal, the function is applied to this xs:decimal value, and the resulting xs:decimal is cast back to xs:float or xs:double as appropriate to form the function result. If the resulting xs:decimal value is zero, then positive or negative zero is returned according to the sign of the original argument.
+ For arguments of type xs:float and xs:double, if the argument is NaN, positive or + negative zero, or positive or negative infinity, then the result is the same as the + argument. In all other cases, the argument is cast to xs:decimal, the function is + applied to this xs:decimal value, and the resulting xs:decimal is cast back to xs:float + or xs:double as appropriate to form the function result. If the resulting xs:decimal + value is zero, then positive or negative zero is returned according to the sign of the + original argument.
- Note that the process of casting to xs:decimal may result in an error [err:FOCA0001].
+ Note that the process of casting to xs:decimal may result in an error + [err:FOCA0001].
- If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa computed with exponent = 0.
+ If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa + computed with exponent = 0.

Arguments: @@ -2695,30 +3050,35 @@
3

- W3C Documentation reference + W3C Documentation reference
- +
- +
- + fn:data() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:data()
fn:data takes a sequence of items and returns a sequence of atomic values.
- The result of fn:data is the sequence of atomic values produced by applying the following rules to each item in $arg:
+ The result of fn:data is the sequence of atomic values produced by applying the + following rules to each item in $arg:
  • If the item is an atomic value, it is returned.
  • If the item is a node:
      -
    • If the node does not have a typed value an error is raised [err:FOTY0012].
    • -
    • Otherwise, fn:data() returns the typed value of the node as defined by the accessor function dm:typed-value in Section 5.15 typed-value AccessorDM.
    • +
    • If the node does not have a typed value an error is raised + [err:FOTY0012].
    • +
    • Otherwise, fn:data() returns the typed value of the node as defined by + the accessor function dm:typed-value in Section 5.15 typed-value + AccessorDM.
@@ -2747,21 +3107,26 @@
- W3C Documentation reference + W3C Documentation reference
fn:index-of() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:index-of()
- Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.
+ Returns the root of the tree to which $arg belongs. This will usually, but not + necessarily, be a document node.
If $arg is the empty sequence, the empty sequence is returned.
If $arg is a document node, $arg is returned.
- If the function is called without an argument, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ If the function is called without an argument, the context item (.) is used as the + default argument. The behavior of the function if the argument is omitted is exactly the + same as if the context item had been passed as the argument.
- The following errors may be raised: if the context item is undefined [err:XPDY0002]; if the context item is not a node [err:XPTY0004].

+ The following errors may be raised: if the context item is undefined [err:XPDY0002]; if + the context item is not a node [err:XPTY0004].

Arguments: @@ -2803,14 +3168,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:empty() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:empty()
- If the value of $arg is the empty sequence, the function returns true; otherwise, the function returns false.

+ If the value of $arg is the empty sequence, the function returns true; otherwise, the + function returns false.

Arguments: @@ -2836,14 +3203,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:exists() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:exists()
- If the value of $arg is not the empty sequence, the function returns true; otherwise, the function returns false.

+ If the value of $arg is not the empty sequence, the function returns true; otherwise, + the function returns false.

Arguments: @@ -2869,14 +3238,19 @@

- W3C Documentation reference + W3C Documentation reference
fn:distinct-values() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:distinct-values()
- Returns the sequence that results from removing from $arg all but one of a set of values that are eq to one other. Values of type xs:untypedAtomic are compared as if they were of type xs:string. Values that cannot be compared, i.e. the eq operator is not defined for their types, are considered to be distinct. The order in which the sequence of values is returned is ·implementation dependent·.

+ Returns the sequence that results from removing from $arg all but one of a set of values + that are eq to one other. Values of type xs:untypedAtomic are compared as if they were + of type xs:string. Values that cannot be compared, i.e. the eq operator is not defined + for their types, are considered to be distinct. The order in which the sequence of + values is returned is ·implementation dependent·.

Arguments: @@ -2906,19 +3280,27 @@

- W3C Documentation reference + W3C Documentation reference
fn:insert-before() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:insert-before()
- Returns a new sequence constructed from the value of $target with the value of $inserts inserted at the position specified by the value of $position. (The value of $target is not affected by the sequence construction.)
+ Returns a new sequence constructed from the value of $target with the value of $inserts + inserted at the position specified by the value of $position. (The value of $target is + not affected by the sequence construction.)
- If $target is the empty sequence, $inserts is returned. If $inserts is the empty sequence, $target is returned.
+ If $target is the empty sequence, $inserts is returned. If $inserts is the empty + sequence, $target is returned.
- The value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $inserts, followed by the remaining elements of $target, in that sequence.
+ The value returned by the function consists of all items of $target whose index is less + than $position, followed by all items of $inserts, followed by the remaining elements of + $target, in that sequence.
- If $position is less than one (1), the first position, the effective value of $position is one (1). If $position is greater than the number of items in $target, then the effective value of $position is equal to the number of items in $target plus 1.

+ If $position is less than one (1), the first position, the effective value of $position + is one (1). If $position is greater than the number of items in $target, then the + effective value of $position is equal to the number of items in $target plus 1.

Arguments: @@ -2961,15 +3343,21 @@

- W3C Documentation reference + W3C Documentation reference
fn:remove() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:remove()
- Returns a new sequence constructed from the value of $target with the item at the position specified by the value of $position removed.
+ Returns a new sequence constructed from the value of $target with the item at the + position specified by the value of $position removed.
- If $position is less than 1 or greater than the number of items in $target, $target is returned. Otherwise, the value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $target whose index is greater than $position. If $target is the empty sequence, the empty sequence is returned.

+ If $position is less than 1 or greater than the number of items in $target, $target is + returned. Otherwise, the value returned by the function consists of all items of $target + whose index is less than $position, followed by all items of $target whose index is + greater than $position. If $target is the empty sequence, the empty sequence is + returned.

Arguments: @@ -3008,14 +3396,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:reverse() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:reverse()
- Reverses the order of items in a sequence. If $arg is the empty sequence, the empty sequence is returned.

+ Reverses the order of items in a sequence. If $arg is the empty sequence, the empty + sequence is returned.

Arguments: @@ -3050,21 +3440,27 @@

- W3C Documentation reference + W3C Documentation reference
fn:subsequence() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:subsequence()
- Returns the contiguous sequence of items in the value of $sourceSeq beginning at the position indicated by the value of $startingLoc and continuing for the number of items indicated by the value of $length. + Returns the contiguous sequence of items in the value of $sourceSeq beginning at the + position indicated by the value of $startingLoc and continuing for the number of items + indicated by the value of $length. If $sourceSeq is the empty sequence, the empty sequence is returned.
- If $startingLoc is zero or negative, the subsequence includes items from the beginning of the $sourceSeq.
+ If $startingLoc is zero or negative, the subsequence includes items from the beginning + of the $sourceSeq.
- If $length is not specified, the subsequence includes items to the end of $sourceSeq.
+ If $length is not specified, the subsequence includes items to the end of + $sourceSeq.
- If $length is greater than the number of items in the value of $sourceSeq following $startingLoc, the subsequence includes items to the end of $sourceSeq.
+ If $length is greater than the number of items in the value of $sourceSeq following + $startingLoc, the subsequence includes items to the end of $sourceSeq.
The first item of a sequence is located at position 1, not position 0.

@@ -3105,12 +3501,13 @@
- W3C Documentation reference + W3C Documentation reference
fn:unordered() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:unordered()
Returns the items of $sourceSeq in an implementation dependent order.

@@ -3127,13 +3524,15 @@ Return type: item()*

- W3C Documentation reference + W3C Documentation reference
fn:zero-or-one() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:zero-or-one()
- Returns $arg if it contains zero or one items. Otherwise, raises an error [err:FORG0003].

+ Returns $arg if it contains zero or one items. Otherwise, raises an error + [err:FORG0003].

Arguments: @@ -3159,18 +3558,21 @@ - +
zero-or-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:zero-or-one() ("a", "b") A sequence of more than one item is not allowed as the first argument of + fn:zero-or-one() ("a", "b")

- W3C Documentation reference + W3C Documentation reference
fn:one-or-more() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:one-or-more()
- Returns $arg if it contains one or more items. Otherwise, raises an error [err:FORG0004].

+ Returns $arg if it contains one or more items. Otherwise, raises an error + [err:FORG0004].

Arguments: @@ -3200,14 +3602,16 @@

- W3C Documentation reference + W3C Documentation reference
fn:exactly-one() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:exactly-one()
- Returns $arg if it contains exactly one item. Otherwise, raises an error [err:FORG0005].

+ Returns $arg if it contains exactly one item. Otherwise, raises an error + [err:FORG0005].

Arguments: @@ -3233,25 +3637,36 @@ - +
exactly-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:exactly-one() ("a", "b") A sequence of more than one item is not allowed as the first argument of + fn:exactly-one() ("a", "b")

- W3C Documentation reference + W3C Documentation reference
fn:deep-equal() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:deep-equal()
- This function assesses whether two sequences are deep-equal to each other. To be deep-equal, they must contain items that are pairwise deep-equal; and for two items to be deep-equal, they must either be atomic values that compare equal, or nodes of the same kind, with the same name, whose children are deep-equal. This is defined in more detail below. The $collation argument identifies a collation which is used at all levels of recursion when strings are compared (but not when names are compared), according to the rules in 7.3.1 Collations.
+ This function assesses whether two sequences are deep-equal to each other. To be + deep-equal, they must contain items that are pairwise deep-equal; and for two items to + be deep-equal, they must either be atomic values that compare equal, or nodes of the + same kind, with the same name, whose children are deep-equal. This is defined in more + detail below. The $collation argument identifies a collation which is used at all levels + of recursion when strings are compared (but not when names are compared), according to + the rules in 7.3.1 Collations.
If the two sequences are both empty, the function returns true.
- + If the two sequences are of different lengths, the function returns false.
- - If the two sequences are of the same length, the function returns true if and only if every item in the sequence $parameter1 is deep-equal to the item at the same position in the sequence $parameter2. The rules for deciding whether two items are deep-equal follow. - + + If the two sequences are of the same length, the function returns true if and only if + every item in the sequence $parameter1 is deep-equal to the item at the same position in + the sequence $parameter2. The rules for deciding whether two items are deep-equal + follow. + For more in-depth description look into W3C Documentation

Arguments: @@ -3290,18 +3705,23 @@
- W3C Documentation reference + W3C Documentation reference
fn:id() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:id()
- Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg. + Returns the sequence of element nodes that have an ID value matching the value of one or + more of the IDREF values supplied in $arg.

Note:

- This function does not have the desired effect when searching a document in which elements of type xs:ID are used as identifiers. To preserve backwards compatibility, a new function fn:element-with-id is therefore being introduced; it behaves the same way as fn:id in the case of ID-valued attributes. + This function does not have the desired effect when searching a document in which + elements of type xs:ID are used as identifiers. To preserve backwards compatibility, a + new function fn:element-with-id is therefore being introduced; it behaves the same way + as fn:id in the case of ID-valued attributes.

Arguments: @@ -3325,13 +3745,15 @@ Return type: element()*

- W3C Documentation reference + W3C Documentation reference
fn:idref() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:idref()
- Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

+ Returns the sequence of element or attribute nodes with an IDREF value matching the + value of one or more of the ID values supplied in $arg.

Arguments: @@ -3354,14 +3776,16 @@
Return type: node()*

- W3C Documentation reference + W3C Documentation reference
fn:doc() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:doc()
- Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

+ Returns the sequence of element or attribute nodes with an IDREF value matching the + value of one or more of the ID values supplied in $arg.

Arguments: @@ -3387,20 +3811,24 @@

- W3C Documentation reference + W3C Documentation reference
fn:doc-available() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:doc-available()
- Retrieves a document using a URI supplied as an xs:string, and returns the corresponding document node.
+ Retrieves a document using a URI supplied as an xs:string, and returns the corresponding + document node.
If $uri is the empty sequence, the result is an empty sequence.
- + If $uri is not a valid URI, an error may be raised [err:FODC0005].
- - If $uri is a relative URI reference, it is resolved relative to the value of the base URI property from the static context. The resulting absolute URI is promoted to an xs:string.

+ + If $uri is a relative URI reference, it is resolved relative to the value of the base + URI property from the static context. The resulting absolute URI is promoted to an + xs:string.

Arguments: @@ -3426,15 +3854,24 @@

- W3C Documentation reference + W3C Documentation reference
fn:collection() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:collection()
- This function takes an xs:string as argument and returns a sequence of nodes obtained by interpreting $arg as an xs:anyURI and resolving it according to the mapping specified in Available collections described in Section C.2 Dynamic Context ComponentsXP. If Available collections provides a mapping from this string to a sequence of nodes, the function returns that sequence. If Available collections maps the string to an empty sequence, then the function returns an empty sequence. If Available collections provides no mapping for the string, an error is raised [err:FODC0004].
- If $arg is not specified, the function returns the sequence of the nodes in the default collection in the dynamic context. See Section C.2 Dynamic Context ComponentsXP. If the value of the default collection is undefined an error is raised [err:FODC0002].

+ This function takes an xs:string as argument and returns a sequence of nodes obtained by + interpreting $arg as an xs:anyURI and resolving it according to the mapping specified in + Available collections described in Section C.2 Dynamic Context ComponentsXP. If + Available collections provides a mapping from this string to a sequence of nodes, the + function returns that sequence. If Available collections maps the string to an empty + sequence, then the function returns an empty sequence. If Available collections provides + no mapping for the string, an error is raised [err:FODC0004].
+ If $arg is not specified, the function returns the sequence of the nodes in the default + collection in the dynamic context. See Section C.2 Dynamic Context ComponentsXP. If the + value of the default collection is undefined an error is raised [err:FODC0002].

Arguments: @@ -3460,13 +3897,15 @@

- W3C Documentation reference + W3C Documentation reference
fn:element-with-id() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:element-with-id()
- Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg.

+ Returns the sequence of element nodes that have an ID value matching the value of one or + more of the IDREF values supplied in $arg.

Arguments: @@ -3481,13 +3920,16 @@
Return type: node()*

- W3C Documentation reference + W3C Documentation reference
fn:position() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:position()
- Returns the context position from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

+ Returns the context position from the dynamic context. (See Section C.2 Dynamic Context + ComponentsXP.) If the context item is undefined, an error is raised: + [err:XPDY0002]XP.

Return type: xs:integer

Examples: @@ -3502,14 +3944,17 @@
- W3C Documentation reference + W3C Documentation reference
fn:last() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:last()
- Returns the context size from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

+ Returns the context size from the dynamic context. (See Section C.2 Dynamic Context + ComponentsXP.) If the context item is undefined, an error is raised: + [err:XPDY0002]XP.

Return type: xs:integer

Examples: @@ -3524,27 +3969,30 @@
- W3C Documentation reference + W3C Documentation reference
-
- +
- + fn:years-from-duration()
- Returns an xs:integer representing the years component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the years component as described in 10.3.1.3 Canonical representation.
+ Returns an xs:integer representing the years component in the value of $arg. The result + is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration + types) and then computing the years component as described in 10.3.1.3 Canonical + representation.
The result may be negative.
- + If $arg is an xs:dayTimeDuration returns 0.
- + If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3577,18 +4025,22 @@
0

- W3C Documentation reference + W3C Documentation reference
fn:months-from-duration()
- Returns an xs:integer representing the months component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the months component as described in 10.3.1.3 Canonical representation.
+ Returns an xs:integer representing the months component in the value of $arg. The result + is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration + types) and then computing the months component as described in 10.3.1.3 Canonical + representation.
The result may be negative.
- + If $arg is an xs:dayTimeDuration returns 0.
- + If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3621,18 +4073,22 @@
0

- W3C Documentation reference + W3C Documentation reference
fn:days-from-duration()
- Returns an xs:integer representing the days component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the days component as described in 10.3.2.3 Canonical representation.
+ Returns an xs:integer representing the days component in the value of $arg. The result + is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration + types) and then computing the days component as described in 10.3.2.3 Canonical + representation.
The result may be negative.
- + If $arg is an xs:yearMonthDuration returns 0.
- + If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3665,18 +4121,22 @@
0

- W3C Documentation reference + W3C Documentation reference
fn:hours-from-duration()
- Returns an xs:integer representing the hours component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the hours component as described in 10.3.2.3 Canonical representation.
+ Returns an xs:integer representing the hours component in the value of $arg. The result + is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration + types) and then computing the hours component as described in 10.3.2.3 Canonical + representation.
The result may be negative.
- + If $arg is an xs:yearMonthDuration returns 0.
- + If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3709,14 +4169,18 @@
0

- W3C Documentation reference + W3C Documentation reference
fn:minutes-from-duration()
- Returns an xs:integer representing the minutes component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the minutes component as described in 10.3.2.3 Canonical representation. + Returns an xs:integer representing the minutes component in the value of $arg. The + result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to + duration types) and then computing the minutes component as described in 10.3.2.3 + Canonical representation. The result may be negative. @@ -3750,14 +4214,18 @@ -30
- W3C Documentation reference + W3C Documentation reference
- + fn:seconds-from-duration()
- Returns an xs:decimal representing the seconds component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the seconds component as described in 10.3.2.3 Canonical representation.
+ Returns an xs:decimal representing the seconds component in the value of $arg. The + result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to + duration types) and then computing the seconds component as described in 10.3.2.3 + Canonical representation.
The result may be negative.
@@ -3791,14 +4259,16 @@ -16.0
- W3C Documentation reference + W3C Documentation reference
fn:year-from-dateTime()
- Returns an xs:integer representing the year component in the localized value of $arg. The result may be negative.
+ Returns an xs:integer representing the year component in the localized value of $arg. + The result may be negative.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3832,14 +4302,16 @@ 2000
- W3C Documentation reference + W3C Documentation reference
fn:month-from-dateTime()
- Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
+ Returns an xs:integer between 1 and 12, both inclusive, representing the month component + in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3873,13 +4345,15 @@ 1
- W3C Documentation reference + W3C Documentation reference
fn:day-from-dateTime()
- Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
+ Returns an xs:integer between 1 and 31, both inclusive, representing the day component + in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3913,14 +4387,16 @@ 1
- W3C Documentation reference + W3C Documentation reference
fn:hours-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:hours-from-dateTime()
- Returns an xs:integer between 0 and 23, both inclusive, representing the hours component in the localized value of $arg.
+ Returns an xs:integer between 0 and 23, both inclusive, representing the hours component + in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3954,14 +4430,16 @@ 0
- W3C Documentation reference + W3C Documentation reference
fn:minutes-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:minutes-from-dateTime()
- Returns an xs:integer value between 0 and 59, both inclusive, representing the minute component in the localized value of $arg.
+ Returns an xs:integer value between 0 and 59, both inclusive, representing the minute + component in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -3991,13 +4469,15 @@ 30
- W3C Documentation reference + W3C Documentation reference
fn:seconds-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:seconds-from-dateTime()
- Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4023,13 +4503,15 @@ 0
- W3C Documentation reference + W3C Documentation reference
fn:timezone-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:timezone-from-dateTime()
- Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4063,14 +4545,16 @@ ()
- W3C Documentation reference + W3C Documentation reference
fn:year-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:year-from-date()
- Returns an xs:integer representing the year in the localized value of $arg. The value may be negative.
+ Returns an xs:integer representing the year in the localized value of $arg. The value + may be negative.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4100,13 +4584,15 @@ 2000
- W3C Documentation reference + W3C Documentation reference
fn:month-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:month-from-date()
- Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
+ Returns an xs:integer between 1 and 12, both inclusive, representing the month component + in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4136,13 +4622,15 @@ 1
- W3C Documentation reference + W3C Documentation reference
fn:day-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:day-from-date()
- Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
+ Returns an xs:integer between 1 and 31, both inclusive, representing the day component + in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4172,14 +4660,18 @@ 1
- W3C Documentation reference + W3C Documentation reference
fn:timezone-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:timezone-from-date()
- Returns the timezone component of $arg if any. If $arg has a timezone component, then the result is an xs:dayTimeDuration that indicates deviation from UTC; its value may range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty sequence.
+ Returns the timezone component of $arg if any. If $arg has a timezone component, then + the result is an xs:dayTimeDuration that indicates deviation from UTC; its value may + range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty + sequence.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4209,14 +4701,16 @@ PT0S
- W3C Documentation reference + W3C Documentation reference
fn:hours-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:hours-from-time()
- Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
+ Returns an xs:integer between 0 and 23, both inclusive, representing the value of the + hours component in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4246,14 +4740,16 @@ 0
- W3C Documentation reference + W3C Documentation reference
fn:minutes-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:minutes-from-time()
- Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
+ Returns an xs:integer between 0 and 23, both inclusive, representing the value of the + hours component in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4283,13 +4779,15 @@ 0
- W3C Documentation reference + W3C Documentation reference
fn:seconds-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:seconds-from-time()
- Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4316,14 +4814,16 @@
- W3C Documentation reference + W3C Documentation reference
fn:timezone-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:timezone-from-time()
- Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
If $arg is the empty sequence, returns the empty sequence.

Arguments and return type: @@ -4354,35 +4854,48 @@
- W3C Documentation reference + W3C Documentation reference
fn:adjust-date-to-timezone() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:adjust-date-to-timezone()
- Adjusts an xs:date value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:date without a timezone. Otherwise, returns an xs:date with a timezone. For purposes of timezone adjustment, an xs:date is treated as an xs:dateTime with time 00:00:00.
+ Adjusts an xs:date value to a specific timezone, or to no timezone at all. If $timezone + is the empty sequence, returns an xs:date without a timezone. Otherwise, returns an + xs:date with a timezone. For purposes of timezone adjustment, an xs:date is treated as + an xs:dateTime with time 00:00:00.
+ + If $timezone is not specified, then $timezone is the value of the implicit timezone in + the dynamic context.
- If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
- If $arg is the empty sequence, then the result is the empty sequence.
- - A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
- - If $arg does not have a timezone component and $timezone is the empty sequence, then the result is the value of $arg.
- - If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
- - If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
- + + A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater + than PT14H or if does not contain an integral number of minutes.
+ + If $arg does not have a timezone component and $timezone is the empty sequence, then the + result is the value of $arg.
+ + If $arg does not have a timezone component and $timezone is not the empty sequence, then + the result is $arg with $timezone as the timezone component.
+ + If $arg has a timezone component and $timezone is the empty sequence, then the result is + the localized value of $arg without its timezone component.
+ If $arg has a timezone component and $timezone is not the empty sequence, then:
    -
  • Let $srcdt be an xs:dateTime value, with 00:00:00 for the time component and date and timezone components that are the same as the date and timezone components of $arg.
  • -
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
  • -
  • The result of this function will be a date value that has date and timezone components that are the same as the date and timezone components of $r.
  • +
  • Let $srcdt be an xs:dateTime value, with 00:00:00 for the time component and + date and timezone components that are the same as the date and timezone + components of $arg.
  • +
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, + $timezone)
  • +
  • The result of this function will be a date value that has date and timezone + components that are the same as the date and timezone components of $r.


- + Arguments and return type: @@ -4410,39 +4923,52 @@ - +
2002-03-07-05:00
adjust-date-to-timezone(xs:date("2002-03-07"), xs:dayTimeDuration("-PT10H"))adjust-date-to-timezone(xs:date("2002-03-07"), xs:dayTimeDuration("-PT10H")) + 2002-03-07-10:00

- W3C Documentation reference + W3C Documentation reference
fn:adjust-time-to-timezone() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:adjust-time-to-timezone()
- Adjusts an xs:time value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:time without a timezone. Otherwise, returns an xs:time with a timezone.
+ Adjusts an xs:time value to a specific timezone, or to no timezone at all. If $timezone + is the empty sequence, returns an xs:time without a timezone. Otherwise, returns an + xs:time with a timezone.
- If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
+ If $timezone is not specified, then $timezone is the value of the implicit timezone in + the dynamic context.
If $arg is the empty sequence, then the result is the empty sequence.
- A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
+ A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater + than PT14H or if does not contain an integral number of minutes.
- If $arg does not have a timezone component and $timezone is the empty sequence, then the result is $arg.
+ If $arg does not have a timezone component and $timezone is the empty sequence, then the + result is $arg.
- If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
+ If $arg does not have a timezone component and $timezone is not the empty sequence, then + the result is $arg with $timezone as the timezone component.
- If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
+ If $arg has a timezone component and $timezone is the empty sequence, then the result is + the localized value of $arg without its timezone component.
If $arg has a timezone component and $timezone is not the empty sequence, then:
    -
  • Let $srcdt be an xs:dateTime value, with an arbitrary date for the date component and time and timezone components that are the same as the time and timezone components of $arg.
  • -
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
  • -
  • The result of this function will be a time value that has time and timezone components that are the same as the time and timezone components of $r.
  • +
  • Let $srcdt be an xs:dateTime value, with an arbitrary date for the date + component and time and timezone components that are the same as the time and + timezone components of $arg.
  • +
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, + $timezone)
  • +
  • The result of this function will be a time value that has time and timezone + components that are the same as the time and timezone components of $r.


- + Arguments and return type: @@ -4470,19 +4996,26 @@ - +
10:00:00-05:00
adjust-time-to-timezone(xs:time("10:00:00"), xs:dayTimeDuration("-PT10H"))adjust-time-to-timezone(xs:time("10:00:00"), xs:dayTimeDuration("-PT10H")) + 10:00:00-10:00

- W3C Documentation reference + W3C Documentation reference
fn:current-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:current-dateTime()
- Returns the current dateTime (with timezone) from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) This is an xs:dateTime that is current at some time during the evaluation of a query or transformation in which fn:current-dateTime() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-dateTime() is ·implementation dependent·.

- + Returns the current dateTime (with timezone) from the dynamic context. (See Section C.2 + Dynamic Context ComponentsXP.) This is an xs:dateTime that is current at some time + during the evaluation of a query or transformation in which fn:current-dateTime() is + executed. This function is ·stable·. The precise instant during the query or + transformation represented by the value of fn:current-dateTime() is ·implementation + dependent·.

+ Return type: xs:dateTime

Examples:
@@ -4496,14 +5029,19 @@

- W3C Documentation reference + W3C Documentation reference
fn:current-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:current-date()
- Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

- + Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is + current at some time during the evaluation of a query or transformation in which + fn:current-date() is executed. This function is ·stable·. The precise instant during the + query or transformation represented by the value of fn:current-date() is ·implementation + dependent·.

+ Return type: xs:date

Examples:
@@ -4517,15 +5055,20 @@

- W3C Documentation reference + W3C Documentation reference
fn:current-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:current-time()
- Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

- + Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is + current at some time during the evaluation of a query or transformation in which + fn:current-date() is executed. This function is ·stable·. The precise instant during the + query or transformation represented by the value of fn:current-date() is ·implementation + dependent·.

+ Return type: xs:time

Examples:
@@ -4539,14 +5082,17 @@

- W3C Documentation reference + W3C Documentation reference
fn:implicit-timezone() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:implicit-timezone()
- Returns the value of the implicit timezone property from the dynamic context. Components of the dynamic context are discussed in Section C.2 Dynamic Context ComponentsXP.

- + Returns the value of the implicit timezone property from the dynamic context. Components + of the dynamic context are discussed in Section C.2 Dynamic Context + ComponentsXP.

+ Return type: xs:string

Examples:
@@ -4560,83 +5106,102 @@

- W3C Documentation reference + W3C Documentation reference
- +
- fn:error() -
- The fn:error function is a general function that may be invoked as above but may also be invoked from [XQuery 1.0: An XML Query Language] or [XML Path Language (XPath) 2.0] applications with, for example, an xs:QName argument. -
- W3C Documentation reference -
+ fn:error() +
+ The fn:error function is a general function that may be invoked as above but may also be + invoked from [XQuery 1.0: An XML Query Language] or [XML Path Language (XPath) 2.0] + applications with, for example, an xs:QName argument. +
+ W3C Documentation reference +
- fn:trace() -
- Provides an execution trace intended to be used in debugging queries.
+ fn:trace() +
+ Provides an execution trace intended to be used in debugging queries.
+ + The input $value is returned, unchanged, as the result of the function. In addition, the + inputs $value, converted to an xs:string, and $label may be directed to a trace data + set. The destination of the trace output is ·implementation-defined·. The format of the + trace output is ·implementation dependent·. The ordering of output from invocations of + the fn:trace() function is ·implementation dependent·.
+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
item*$value
xs:string$label
+ Return type: item

+
+ W3C Documentation reference +
- The input $value is returned, unchanged, as the result of the function. In addition, the inputs $value, converted to an xs:string, and $label may be directed to a trace data set. The destination of the trace output is ·implementation-defined·. The format of the trace output is ·implementation dependent·. The ordering of output from invocations of the fn:trace() function is ·implementation dependent·.
- Arguments: - - - - - - - - - - - - - -
TypeDescription
item*$value
xs:string$label
- Return type: item

-
- W3C Documentation reference -
- -
- +
- fn:resolve-uri()
This function enables a relative URI reference to be resolved against an absolute URI. - The first form of this function resolves $relative against the value of the base-uri property from the static context. If the base-uri property is not initialized in the static context an error is raised [err:FONS0005].
- - If $relative is a relative URI reference, it is resolved against $base, or against the base-uri property from the static context, using an algorithm such as those described in [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned.
+ The first form of this function resolves $relative against the value of the base-uri + property from the static context. If the base-uri property is not initialized in the + static context an error is raised [err:FONS0005].
+ + If $relative is a relative URI reference, it is resolved against $base, or against the + base-uri property from the static context, using an algorithm such as those described in + [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned.
If $relative is an absolute URI reference, it is returned unchanged.
- + If $relative is the empty sequence, the empty sequence is returned.
- - If $relative is not a valid URI according to the rules of the xs:anyURI data type, or if it is not a suitable relative reference to use as input to the chosen resolution algorithm, then an error is raised [err:FORG0002].
- - If $base is not a valid URI according to the rules of the xs:anyURI data type, if it is not a suitable URI to use as input to the chosen resolution algorithm (for example, if it is a relative URI reference, if it is a non-hierarchic URI, or if it contains a fragment identifier), then an error is raised [err:FORG0002].
- - If the chosen resolution algorithm fails for any other reason then an error is raised [err:FORG0009].
- + + If $relative is not a valid URI according to the rules of the xs:anyURI data type, or if + it is not a suitable relative reference to use as input to the chosen resolution + algorithm, then an error is raised [err:FORG0002].
+ + If $base is not a valid URI according to the rules of the xs:anyURI data type, if it is + not a suitable URI to use as input to the chosen resolution algorithm (for example, if + it is a relative URI reference, if it is a non-hierarchic URI, or if it contains a + fragment identifier), then an error is raised [err:FORG0002].
+ + If the chosen resolution algorithm fails for any other reason then an error is raised + [err:FORG0009].
+

Note:

- - Resolving a URI does not dereference it. This is merely a syntactic operation on two character strings. + + Resolving a URI does not dereference it. This is merely a syntactic operation on two + character strings.

Arguments and return type: @@ -4655,25 +5220,37 @@
Return type: xs:anyURI?


- W3C Documentation reference + W3C Documentation reference
- - fn:resolve-QName() -
- Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string that has the lexical form of an xs:QName (a string in the form "prefix:local-name" or "local-name") and resolving it using the in-scope namespaces for a given element.
- If $qname does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
+ fn:resolve-QName() +
+ Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string that has + the lexical form of an xs:QName (a string in the form "prefix:local-name" or + "local-name") and resolving it using the in-scope namespaces for a given element.
+ + If $qname does not have the correct lexical form for xs:QName an error is raised + [err:FOCA0002].
If $qname is the empty sequence, returns the empty sequence.
- More specifically, the function searches the namespace bindings of $element for a binding whose name matches the prefix of $qname, or the zero-length string if it has no prefix, and constructs an expanded-QName whose local name is taken from the supplied $qname, and whose namespace URI is taken from the string value of the namespace binding.
+ More specifically, the function searches the namespace bindings of $element for a + binding whose name matches the prefix of $qname, or the zero-length string if it has no + prefix, and constructs an expanded-QName whose local name is taken from the supplied + $qname, and whose namespace URI is taken from the string value of the namespace + binding.
- If the $qname has a prefix and if there is no namespace binding for $element that matches this prefix, then an error is raised [err:FONS0004].
+ If the $qname has a prefix and if there is no namespace binding for $element that + matches this prefix, then an error is raised [err:FONS0004].
- If the $qname has no prefix, and there is no namespace binding for $element corresponding to the default (unnamed) namespace, then the resulting expanded-QName has no namespace part.
+ If the $qname has no prefix, and there is no namespace binding for $element + corresponding to the default (unnamed) namespace, then the resulting expanded-QName has + no namespace part.
- The prefix (or absence of a prefix) in the supplied $qname argument is retained in the returned expanded-QName, as discussed in Section 2.1 TerminologyDM.

+ The prefix (or absence of a prefix) in the supplied $qname argument is retained in the + returned expanded-QName, as discussed in Section 2.1 TerminologyDM.

Arguments: @@ -4707,17 +5284,24 @@

- W3C Documentation reference + W3C Documentation reference
fn:QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:QName()
- Returns an xs:QName with the namespace URI given in $paramURI. If $paramURI is the zero-length string or the empty sequence, it represents "no namespace"; in this case, if the value of $paramQName contains a colon (:), an error is raised [err:FOCA0002]. The prefix (or absence of a prefix) in $paramQName is retained in the returned xs:QName value. The local name in the result is taken from the local part of $paramQName.
+ Returns an xs:QName with the namespace URI given in $paramURI. If $paramURI is the + zero-length string or the empty sequence, it represents "no namespace"; in this case, if + the value of $paramQName contains a colon (:), an error is raised [err:FOCA0002]. The + prefix (or absence of a prefix) in $paramQName is retained in the returned xs:QName + value. The local name in the result is taken from the local part of $paramQName.
- If $paramQName does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
- - Note that unlike xs:QName this function does not require a xs:string literal as the argument.

+ If $paramQName does not have the correct lexical form for xs:QName an error is raised + [err:FOCA0002].
+ + Note that unlike xs:QName this function does not require a xs:string literal as the + argument.

Arguments: @@ -4747,13 +5331,15 @@
For more extensive examples see W3C documentation below.
- W3C Documentation reference + W3C Documentation reference
fn:prefix-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:prefix-from-QName()
- Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

+ Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if + $arg is the empty sequence or if the value of $arg contains no prefix.

Arguments: @@ -4779,13 +5365,15 @@
- W3C Documentation reference + W3C Documentation reference
fn:local-name-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:local-name-from-QName()
- Returns an xs:NCName representing the local part of $arg. If $arg is the empty sequence, returns the empty sequence.

+ Returns an xs:NCName representing the local part of $arg. If $arg is the empty sequence, + returns the empty sequence.

Arguments: @@ -4811,14 +5399,16 @@
- W3C Documentation reference + W3C Documentation reference
fn:prefix-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:prefix-from-QName()
- Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

+ Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if + $arg is the empty sequence or if the value of $arg contains no prefix.

Arguments: @@ -4844,13 +5434,16 @@
- W3C Documentation reference + W3C Documentation reference
fn:namespace-uri-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:namespace-uri-from-QName()
- Returns the namespace URI for $arg as an xs:anyURI. If $arg is the empty sequence, the empty sequence is returned. If $arg is in no namespace, the zero-length xs:anyURI is returned.

+ Returns the namespace URI for $arg as an xs:anyURI. If $arg is the empty sequence, the + empty sequence is returned. If $arg is in no namespace, the zero-length xs:anyURI is + returned.

Arguments: @@ -4876,16 +5469,21 @@
- W3C Documentation reference + W3C Documentation reference
fn:namespace-uri-for-prefix() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:namespace-uri-for-prefix()
- Returns the namespace URI of one of the in-scope namespaces for $element, identified by its namespace prefix.
+ Returns the namespace URI of one of the in-scope namespaces for $element, identified by + its namespace prefix.
- If $element has an in-scope namespace whose namespace prefix is equal to $prefix, it returns the namespace URI of that namespace. If $prefix is the zero-length string or the empty sequence, it returns the namespace URI of the default (unnamed) namespace. Otherwise, it returns the empty sequence.
+ If $element has an in-scope namespace whose namespace prefix is equal to $prefix, it + returns the namespace URI of that namespace. If $prefix is the zero-length string or the + empty sequence, it returns the namespace URI of the default (unnamed) namespace. + Otherwise, it returns the empty sequence.
Prefixes are equal only if their Unicode code points match exactly.

@@ -4917,14 +5515,17 @@ - W3C Documentation reference + W3C Documentation reference
fn:in-scope-prefixes() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:in-scope-prefixes()
- Returns the prefixes of the in-scope namespaces for $element. For namespaces that have a prefix, it returns the prefix as an xs:NCName. For the default namespace, which has no prefix, it returns the zero-length string.

+ Returns the prefixes of the in-scope namespaces for $element. For namespaces that have a + prefix, it returns the prefix as an xs:NCName. For the default namespace, which has no + prefix, it returns the zero-length string.

Arguments: @@ -4950,14 +5551,17 @@
- W3C Documentation reference + W3C Documentation reference
fn:static-base-uri() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:static-base-uri()
- Returns the value of the Base URI property from the static context. If the Base URI property is undefined, the empty sequence is returned. Components of the static context are discussed in Section C.1 Static Context ComponentsXP.

- + Returns the value of the Base URI property from the static context. If the Base URI + property is undefined, the empty sequence is returned. Components of the static context + are discussed in Section C.1 Static Context ComponentsXP.

+ Return type: xs:anyURI?

Examples:
@@ -4971,31 +5575,404 @@

- W3C Documentation reference + W3C Documentation reference
- +
-
- - + fn:last() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:outermost(node()*)
- Returns the position of the last node in the context list
-
- W3C Documentation reference: Node-Set-Functions + 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(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(node()?) +
+ 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(node()?) +
+ 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(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(node()?) +
+ 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(node()?) +
+ 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()?) +
+ 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 +
+ + + + fn:document-uri(node?) +
+ Returns the document URI of the given node or the context item
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the document URI of the specified node or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:document-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the document URI of the first + fiction:book element is "http://example.com/library.xml")
fn:document-uri(/library)http://example.com/library.xml (assuming the document URI of the library + element is "http://example.com/library.xml")

+ W3C Documentation reference: Document-URI +
+ + + fn:base-uri(node?) +
+ Returns the base URI of the node or the context item
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the base URI of the specified node or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:base-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the base URI of the first + fiction:book element is "http://example.com/library.xml")
fn:base-uri(/library)http://example.com/library.xml (assuming the base URI of the library element + is "http://example.com/library.xml")

+ W3C Documentation reference: Base-URI +
+ + + fn:node-name(node?) +
+ + Returns the name of a node as an xs:QName
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the name of the specified node or the context item if the argument + is omitted
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:node-name(/library/*[1])fiction:book
fn:node-name(/library/fiction:book[1]/title)title

+ W3C Documentation reference: Node-Name +
+
@@ -5003,48 +5980,159 @@
- - + fn:boolean(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:not(item()*)
- The boolean function converts its argument to a boolean as follows: -
    -
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • -
  • a node-set is true if and only if it is non-empty
  • -
  • a string is true if and only if its length is non-zero
  • -
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a boolean
Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Boolean-Functions + Returns the negation of the effective boolean value of the argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item()*Argument whose effective boolean value is to be negated
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:not(1)false
fn:not(0)true
fn:not('')true
fn:not('true')false

+ W3C Documentation reference: Not
- - + + + fn:false() +
+ Returns the boolean value false
+ Arguments and return type: + + + + + + + + + +
TypeDescription
NoneReturns the boolean value false
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:false()false
//item[fn:false()]Returns an empty node-set

+ W3C Documentation reference: False +
+ + + fn:true() +
+ Returns the boolean value true
+ Arguments and return type: + + + + + + + + + +
TypeDescription
NoneReturns the boolean value true
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:true()true
//item[fn:true()]Returns all <item> elements

+ W3C Documentation reference: True +
+ + + fn:boolean(item()*) +
+ Converts the argument to a boolean value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item()*Argument to be converted to a boolean value
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:boolean(1)true
fn:boolean(0)false
fn:boolean('')false
fn:boolean('true')true

+ W3C Documentation reference: Boolean +
+ +
@@ -5052,41 +6140,1199 @@
- - + + fn:unparsed-text-available(xs:string?, xs:string?) +
+ 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(xs:string?, 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(xs:string?, 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(xs:string?) +
+ Escapes special characters in a URI to be used in HTML
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?URI to be escaped for use in HTML
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:escape-html-uri('https://example.com/search?q=test&lang=en')https://example.com/search?q=test&lang=en
fn:escape-html-uri('https://example.com/page?id=1§ion=2')https://example.com/page?id=1&section=2

+ W3C Documentation reference: Escape-HTML-URI +
+ + + fn:iri-to-uri(xs:string?) +
+ Converts an IRI to a URI by escaping non-ASCII characters
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?IRI to be converted to a URI
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:iri-to-uri('https://example.com/ümlaut')https://example.com/%C3%BCmlaut
fn:iri-to-uri('https://example.com/日本語')https://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E

+ W3C Documentation reference: IRI-to-URI +
+ + + fn:encode-for-uri(xs:string?) +
+ Encodes a string for use in a URI by escaping special characters
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?String to be encoded for use in a URI
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:encode-for-uri('hello world')hello%20world
fn:encode-for-uri('example?query=value¶m=value2')example%3Fquery%3Dvalue%26param%3Dvalue2

+ W3C Documentation reference: Encode-for-URI +
+ + + fn:resolve-uri(xs:string?, xs:string?) +
+ Resolves a relative URI using a base URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Relative URI to resolve
xs:string?Base URI to use for resolving (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:resolve-uri('example.html', 'https://www.example.com/folder/')https://www.example.com/folder/example.html
fn:resolve-uri('../images/pic.jpg', + 'https://www.example.com/folder/page.html')https://www.example.com/images/pic.jpg

+ W3C Documentation reference: Resolve-URI +
+ + fn:analyze-string(xs:string?, xs:string, xs:string?) +
+ Analyzes the input string and returns an XML fragment containing match and non-match + elements
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to analyze
xs:stringRegular expression pattern to match
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:analyze-string('red,green,blue', ',') + <fn:analyze-string-result><fn:non-match>red</fn:non-match><fn:match>, + <fn:non-match>green</fn:non-match><fn:match>, + <fn:non-match>blue</fn:non-match></fn:analyze-string-result> +

+ W3C Documentation reference: Analyze-String +
+ + + fn:tokenize(xs:string?, xs:string, xs:string?) +
+ Splits the input string into a sequence of substrings using the pattern as a delimiter +
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to tokenize
xs:stringRegular expression pattern to use as delimiter
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:tokenize('XPath 3.0, XQuery 3.0, XSLT 3.0', ',\\s*')('XPath 3.0', 'XQuery 3.0', 'XSLT 3.0')
fn:tokenize('apple,orange,banana', ',')('apple', 'orange', 'banana')

+ W3C Documentation reference: Tokenize +
+ + + fn:replace(xs:string?, xs:string, xs:string, xs:string?) +
+ Replaces occurrences of the pattern in the input string with the replacement string
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:stringRegular expression pattern to match
xs:stringReplacement string
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:replace('XPath 3.0 is great', '3.0', '3.1')'XPath 3.1 is great'
fn:replace('Hello, World!', 'World', 'XPath')'Hello, XPath!'

+ W3C Documentation reference: Replace +
+ + + fn:matches(xs:string?, xs:string, xs:string?) +
+ Returns true if the input string matches the regular expression pattern, otherwise false +
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:stringRegular expression pattern to match
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:matches('XPath 3.0', '\\d\\.\\d')true
fn:matches('Hello, World!', '[A-Z][a-z]*')true
fn:matches('example123', '\\d+', 'q')false

+ W3C Documentation reference: Matches +
+ + + fn:substring-after(xs:string?, xs:string?) +
+ Returns the part of the first string that follows the first occurrence of the second + string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:substring-after('Hello, World!', ',')' World!'
fn:substring-after('XPath 3.0 is awesome!', '3.0')' is awesome!'

+ W3C Documentation reference: Substring-After +
+ + + fn:substring-before(xs:string?, xs:string?) +
+ Returns the part of the first string that precedes the first occurrence of the second + string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:substring-before('Hello, World!', ',')'Hello'
fn:substring-before('XPath 3.0 is awesome!', '3.0')'XPath '

+ W3C Documentation reference: Substring-Before +
+ + + fn:ends-with(xs:string?, xs:string?) +
+ Returns true if the first string ends with the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to check
xs:string?Substring to check for at the end of the first string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:ends-with('Hello, World!', 'World!')true
fn:ends-with('Hello, World!', 'Hello')false
fn:ends-with('XPath 3.0', '3.0')true

+ W3C Documentation reference: Ends-With +
+ + + fn:starts-with(xs:string?, xs:string?) +
+ Returns true if the first string starts with the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to check
xs:string?Substring to check for at the beginning of the first string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:starts-with('Hello, World!', 'Hello')true
fn:starts-with('Hello, World!', 'World')false
fn:starts-with('XPath 3.0', 'XPath')true

+ W3C Documentation reference: Starts-With +
+ + + fn:contains(xs:string?, xs:string?) +
+ Returns true if the first string contains the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:contains('Hello, World!', 'World')true
fn:contains('Hello, World!', 'world')false
fn:contains('XPath 3.0', '3.0')true

+ W3C Documentation reference: Contains +
+ + + fn:translate(xs:string?, xs:string, xs:string) +
+ Returns the input string with specified characters replaced
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to be translated
xs:stringMap string with characters to replace
xs:stringTranslate string with replacement characters
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:translate('apple', 'aeiou', '12345')'1ppl2'
fn:translate('Hello, World!', 'HW', 'hw')'hello, world!'

+ W3C Documentation reference: Translate +
+ + + fn:lower-case(xs:string?) +
+ Returns the input string with all characters converted to lowercase
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to convert to lowercase
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:lower-case('HELLO, WORLD!')'hello, world!'
fn:lower-case('XPath 3.0')'xpath 3.0'
fn:lower-case('BANANA')'banana'

+ W3C Documentation reference: Lower-Case +
+ + + fn:upper-case(xs:string?) +
+ Returns the input string with all characters converted to uppercase
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to convert to uppercase
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:upper-case('Hello, World!')'HELLO, WORLD!'
fn:upper-case('XPath 3.0')'XPATH 3.0'
fn:upper-case('banana')'BANANA'

+ W3C Documentation reference: Upper-Case +
+ + + fn:normalize-unicode(xs:string?, xs:string) +
+ Returns the input string with Unicode normalization applied
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to normalize
xs:stringNormalization form to apply (NFC, NFD, NFKC, NFKD)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:normalize-unicode('Café', 'NFC')'Café'
fn:normalize-unicode('Café', 'NFD')'Café'

+ W3C Documentation reference: Normalize-Unicode +
+ + + fn:normalize-space(xs:string?) +
+ Returns the input string with whitespace normalized
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to normalize whitespace
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:normalize-space(' Hello, World! ')'Hello, World!'
fn:normalize-space(' XPath 3.0 ')'XPath 3.0'
fn:normalize-space('\tbanana\t')'banana'

+ W3C Documentation reference: Normalize-Space +
+ + + fn:string-length(xs:string?) +
+ Returns the length of the input string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to calculate length
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-length('Hello, World!')13
fn:string-length('XPath 3.0')8
fn:string-length('banana')6

+ W3C Documentation reference: String-Length +
+ + + fn:substring(xs:string?, xs:double) +
+ Returns a substring of the source string, starting from a specific location
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input source string
xs:doubleStarting location to extract the substring
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:substring('Hello, World!', 1, 5)'Hello'
fn:substring('XPath 3.0', 7)'3.0'
fn:substring('banana', 2, 3)'ana'

+ W3C Documentation reference: Substring +
+ + fn:string-join(xs:string*, xs:string) +
+ Joins a sequence of strings with a specified separator, returning a single string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*Input sequence of strings to join
xs:stringSeparator string to insert between joined strings
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-join(('apple', 'banana', 'orange'), ', ')'apple, banana, orange'
fn:string-join(('XPath', '3.0', 'Functions'), ' - ')'XPath - 3.0 - Functions'
fn:string-join(('A', 'B', 'C'), '')'ABC'

+ W3C Documentation reference: String-Join +
+ + + fn:concat(xs:anyAtomicType?, xs:anyAtomicType?, ...) +
+ Concatenates two or more strings or atomic values, returning a single string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:anyAtomicType?Input strings or atomic values to concatenate
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:concat('Hello', ' ', 'World')'Hello World'
fn:concat('I have ', 3, ' apples')'I have 3 apples'
fn:concat('XPath ', '3.0')'XPath 3.0'

+ W3C Documentation reference: Concat +
+ + + fn:codepoint-equal(xs:string?, xs:string?) +
+ Compares two strings on a codepoint-by-codepoint basis and returns true if they are + equal, false otherwise
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?First string to compare
xs:string?Second string to compare
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:codepoint-equal('Hello', 'Hello')true
fn:codepoint-equal('Hello', 'hello')false
fn:codepoint-equal('apple', 'banana')false

+ W3C Documentation reference: Codepoint-Equal +
+ + + fn:compare(xs:string?, xs:string?) +
+ Compares two strings and returns -1, 0, or 1 if the first string is less than, equal to, + or greater than the second string, respectively
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?First string to compare
xs:string?Second string to compare
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:compare('apple', 'banana')-1
fn:compare('apple', 'apple')0
fn:compare('banana', 'apple')1

+ W3C Documentation reference: Compare +
+ + + fn:string-to-codepoints(xs:string?) +
+ Returns a sequence of Unicode code points for a given string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-to-codepoints('Hello')(72, 101, 108, 108, 111)
fn:string-to-codepoints('( ͡° ͜ʖ ͡°)')(40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)
fn:string-to-codepoints('😊')(128522)

+ W3C Documentation reference: String-To-Codepoints +
+ + + fn:codepoints-to-string(xs:integer*) +
+ Constructs a string from a sequence of Unicode code points
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:integer*Sequence of Unicode code points
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:codepoints-to-string((72, 101, 108, 108, 111))Hello
codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)) + ( ͡° ͜ʖ ͡°)
fn:codepoints-to-string((128522))😊

+ W3C Documentation reference: Codepoints-To-String +
+ + + fn:string(object)
- Returns the string representation of the object argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringThe object to convert to a string
Examples:
- - - - - - - - - - - - - -
ExpressionResult
string((1<0))false
string(.11)0.11

- W3C Documentation reference: String-Functions + Returns the string representation of the object argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference: String-Functions
- - + +
@@ -5094,49 +7340,1447 @@
- - + + fn:number(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:format-number(numeric?, xs:string, $decimal-format-name)
- The number function converts its argument to a number as follows: -
    -
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • -
  • boolean true is converted to 1; boolean false is converted to 0
  • -
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • -
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a number
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Numeric-Functions + Formats a numeric value according to the supplied picture string and optional decimal + format name
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
numeric?Numeric value to be formatted
xs:stringPicture string defining the format
xs:string?Optional decimal format name
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:format-number(1234.567, '0.00')1,234.57
fn:format-number(-1234.567, '0.00')-1,234.57
fn:format-number(0.12345, '0.00%')12.35%

+ W3C Documentation reference: Format-Number
- - + + + fn:format-integer(xs:integer?, xs:string) +
+ Formats an integer value according to the supplied picture string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:integer?Integer value to be formatted
xs:stringPicture string defining the format
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:format-integer(12345, '0,0')12,345
fn:format-integer(-1234, '0,0')-1,234
fn:format-integer(1234, '00-00-00')01-23-45

+ W3C Documentation reference: Format-Integer +
+ + + fn:round-half-to-even(numeric?) +
+ Returns the closest integer to the given numeric value, rounding half-way cases to the + nearest even integer (also known as "bankers' rounding")
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the rounded value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:round-half-to-even(3.5)4
fn:round-half-to-even(2.5)2
fn:round-half-to-even(-1.5)-2
fn:round-half-to-even(xs:decimal('1.25'), 1)1.2

+ W3C Documentation reference: Round-Half-To-Even +
+ + + fn:round(numeric?) +
+ Returns the closest integer to the given numeric value, rounding half-way cases away + from zero
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the rounded value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:round(3.14)3
fn:round(-4.7)-5
fn:round(xs:decimal('2.5'))3

+ W3C Documentation reference: Round +
+ + + fn:floor(numeric?) +
+ Returns the largest integer less than or equal to the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the floor value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:floor(3.14)3
fn:floor(-4.7)-5
fn:floor(xs:decimal('2.5'))2

+ W3C Documentation reference: Floor +
+ + + + fn:ceiling(numeric?) +
+ Returns the smallest integer greater than or equal to the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the ceiling value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:ceiling(3.14)4
fn:ceiling(-4.7)-4
fn:ceiling(xs:decimal('2.5'))3

+ W3C Documentation reference: Ceiling +
+ + + fn:abs(numeric?) +
+ Returns the absolute value of the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the absolute value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:abs(-42)42
fn:abs(3.14)3.14
fn:abs(xs:decimal('-5.5'))5.5

+ W3C Documentation reference: Abs +
+ + fn:number(item?) +
+ Converts the given value to a number
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item?Returns the numeric value of the specified expression or the context item + (if no argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:number(/library/fiction:book[1]/@id)1 (if the first fiction:book element's id attribute is "1")
fn:number(/library/fiction:book[1]/price)19.99 (if the first fiction:book element's price element contains "19.99") +

+ W3C Documentation reference: Number +
+ + + + +
+
+
+ + + +
+ + fn:fold-right(item()*, item()*, function(item(), 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(item()*, item()*, function(item()*, 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() +
+ 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(xs:string?) +
+ 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(xs:anyAtomicType*, 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(xs:anyAtomicType*, xs:string) +
+ 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(xs:anyAtomicType*, xs:string) +
+ 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(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(item()*) +
+ 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(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(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(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(item()* , item()*) +
+ 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(xs:anyAtomicType*, xs:anyAtomicType) +
+ 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(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(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(item()*, xs:double, xs:double) +
+ 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(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(item()*, xs:integer) +
+ 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(item()*, xs:integer, 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(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(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(item()*) +
+ 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(item()*) +
+ 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:data(item*) +
+ Returns the simple value of an item or a sequence of items
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item?Returns the simple value of the specified item or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:data(/library/fiction:book[1]/title)The Catcher in the Rye
fn:data(/library/fiction:book[2]/author)Harper Lee

+ W3C Documentation reference: Data +
+ +
@@ -5144,46 +8788,1175 @@
- - - fn:adjust-date-to-timezone(date,timezone) -
- If the timezone argument is empty, it returns a date without a timezone. Otherwise, - it returns a date with a timezone
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
datedate to be adjusted
timezonetimezone to be imposed into date
Examples:
- - - - - - - - - -
ExpressionResult
adjust-date-to-timezone(xs:date('2011-11-15'), - xs:dayTimeDuration("PT10H"))2011-11-15+10:00

- W3C Documentation reference: #func-adjust-date-to-timezone -
- - - - - + fn:implicit-timezone() +
+ 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() +
+ 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() +
+ 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() +
+ 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(xs:time?, xs:string, xs:string?, xs:string?, 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(xs:date?, xs:string, xs:string?, xs:string?, 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(xs:dateTime?, xs:string, xs:string?, xs:string?, 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(xs:time?, xs:dayTimeDuration?) +
+ 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(xs:date?, xs:dayTimeDuration?) +
+ 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(xs:dateTime?, xs:dayTimeDuration?) +
+ 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(xs:time?) +
+ 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(xs:time?) +
+ 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(xs:time?) +
+ 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(xs:time?) +
+ 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(xs:date?) +
+ 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(xs:date?) +
+ 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(xs:date?) +
+ 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(xs:date?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:date?, xs:time?) +
+ Constructs an xs:dateTime value from an xs:date and an xs:time value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:date?Date value
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:dateTime(xs:date('2023-03-29'), xs:time('12:30:00'))2023-03-29T12:30:00
fn:dateTime(xs:date('2023-03-29+05:00'), xs:time('12:30:00-08:00'))2023-03-29T12:30:00-08:00

+ W3C Documentation reference: DateTime +
+ + + fn:seconds-from-duration(xs:duration?) +
+ Returns the seconds component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the seconds component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:seconds-from-duration(xs:dayTimeDuration('PT1H30M15.5S'))15.5
fn:seconds-from-duration(xs:dayTimeDuration('-PT2M10.3S'))-10.3

+ W3C Documentation reference: Seconds-From-Duration +
+ + + fn:minutes-from-duration(xs:duration?) +
+ Returns the minutes component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the minutes component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:minutes-from-duration(xs:dayTimeDuration('PT2H30M'))30
fn:minutes-from-duration(xs:dayTimeDuration('-PT1H45M'))-45

+ W3C Documentation reference: Minutes-From-Duration +
+ + + fn:hours-from-duration(xs:duration?) +
+ Returns the hours component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the hours component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:hours-from-duration(xs:dayTimeDuration('PT36H'))36
fn:hours-from-duration(xs:dayTimeDuration('-PT12H30M'))-12

+ W3C Documentation reference: Hours-From-Duration +
+ + + fn:days-from-duration(xs:duration?) +
+ Returns the days component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the days component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:days-from-duration(xs:dayTimeDuration('P5DT12H30M'))5
fn:days-from-duration(xs:dayTimeDuration('-P2DT6H'))-2

+ W3C Documentation reference: Days-From-Duration +
+ + + + fn:months-from-duration(xs:duration?) +
+ Returns the months component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the months component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:months-from-duration(xs:duration('P2Y3M4DT5H6M7S'))3
fn:months-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-3

+ W3C Documentation reference: Months-From-Duration +
+ + + fn:years-from-duration(xs:duration?) +
+ Returns the years component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the years component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:years-from-duration(xs:duration('P2Y3M4DT5H6M7S'))2
fn:years-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-2

+ W3C Documentation reference: Years-From-Duration +
@@ -5191,20 +9964,89 @@
- - - fn:error() -
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error -
- - - - - + + fn:trace(item()*, xs:string) +
+ Outputs the provided label and value for diagnostic purposes and returns the value + unchanged
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Value to be traced
xs:stringLabel to be output along with the value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:trace(42, 'The value is:')Outputs "The value is: 42" for diagnostic purposes and returns 42
fn:trace(/library/book/title, 'Book title:')Outputs "Book title: [book title]" for diagnostic purposes and returns + the book title

+ W3C Documentation reference: Trace +
+ + + fn:error(xs:QName?, xs:string?, $error-object) +
+ Raises an error with the specified error code, description, and error object
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:QName?Error code (optional)
xs:string?Description of the error (optional)
item()*Error object (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:error(xs:QName('err:FOER0000'))Raise error with the code err:FOER0000
fn:error(xs:QName('err:FOER0000'), 'Invalid value')Raise error with the code err:FOER0000 and description "Invalid value" +

+ W3C Documentation reference: Error +
+
@@ -5212,44 +10054,6863 @@
- - - fn:nilled(node) -
- Returns a Boolean value indicating whether the argument node is nilled
-
- W3C Documentation reference: #func-nilled - -
- - - - - + + fn:function-arity(function(*)) +
+ 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(*)) +
+ 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(xs:QName, xs:integer) +
+ 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() +
+ 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() +
+ 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(item()?, item()?) +
+ 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(xs:string?) +
+ 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(xs:string?) +
+ 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() +
+ 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(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(xs:string?) +
+ 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(xs:string?) +
+ 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(xs:string?) +
+ 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()?) +
+ 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(xs:string*) +
+ 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(xs:string*) +
+ 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(xs:string, node()?) +
+ 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()) +
+ 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(xs:string?, element()) +
+ 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(xs:QName?) +
+ 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(xs:QName?) +
+ 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(xs:QName?) +
+ 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(xs:string?, xs:string) +
+ 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(xs:string?, element()) +
+ 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) +
+ Returns a Boolean value indicating whether the argument node is nilled
+
+ W3C Documentation reference: #func-nilled + +
+ + + + +
-
- - fn:for-each(sequence*, function) -
- Applies function item to every element in sequence
-
- W3C Documentation reference: #func-for-each -
- - - + + fn:for-each-pair(item()*, item()*, function(item(), item())) +
+ 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(item()*, function(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(item()*, function(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 +
+
+ +
+ + + +
+ + fn:apply(function(item()*), array(*)) +
+ Applies a function to a sequence of arguments
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
function(item()*) as item()*The function to be applied
SequenceSequence of arguments to pass to the function
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:apply(fn:concat#2, ('Hello', ' World'))'Hello World'
fn:apply(fn:substring#2, ('Hello World', 7))'World'

+ W3C Documentation reference: Apply +
+ + + fn:outermost(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(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(node()?) +
+ 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(node()?) +
+ 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(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(node()?) +
+ 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(node()?) +
+ 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()?) +
+ 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 +
+ + + + fn:document-uri(node?) +
+ Returns the document URI of the given node or the context item
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the document URI of the specified node or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:document-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the document URI of the first + fiction:book element is "http://example.com/library.xml")
fn:document-uri(/library)http://example.com/library.xml (assuming the document URI of the library + element is "http://example.com/library.xml")

+ W3C Documentation reference: Document-URI +
+ + + fn:base-uri(node?) +
+ Returns the base URI of the node or the context item
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the base URI of the specified node or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:base-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the base URI of the first + fiction:book element is "http://example.com/library.xml")
fn:base-uri(/library)http://example.com/library.xml (assuming the base URI of the library element + is "http://example.com/library.xml")

+ W3C Documentation reference: Base-URI +
+ + + fn:node-name(node?) +
+ + Returns the name of a node as an xs:QName
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node?Returns the name of the specified node or the context item if the argument + is omitted
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:node-name(/library/*[1])fiction:book
fn:node-name(/library/fiction:book[1]/title)title

+ W3C Documentation reference: Node-Name +
+ +
+
+
+ + + +
+ + fn:not(item()*) +
+ Returns the negation of the effective boolean value of the argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item()*Argument whose effective boolean value is to be negated
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:not(1)false
fn:not(0)true
fn:not('')true
fn:not('true')false

+ W3C Documentation reference: Not +
+ + + fn:false() +
+ Returns the boolean value false
+ Arguments and return type: + + + + + + + + + +
TypeDescription
NoneReturns the boolean value false
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:false()false
//item[fn:false()]Returns an empty node-set

+ W3C Documentation reference: False +
+ + + fn:true() +
+ Returns the boolean value true
+ Arguments and return type: + + + + + + + + + +
TypeDescription
NoneReturns the boolean value true
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:true()true
//item[fn:true()]Returns all <item> elements

+ W3C Documentation reference: True +
+ + + fn:boolean(item()*) +
+ Converts the argument to a boolean value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item()*Argument to be converted to a boolean value
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:boolean(1)true
fn:boolean(0)false
fn:boolean('')false
fn:boolean('true')true

+ W3C Documentation reference: Boolean +
+ + +
+
+
+ + + +
+ + fn:unparsed-text-available(xs:string?, xs:string?) +
+ 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(xs:string?, 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(xs:string?, 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(xs:string?) +
+ Escapes special characters in a URI to be used in HTML
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?URI to be escaped for use in HTML
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:escape-html-uri('https://example.com/search?q=test&lang=en')https://example.com/search?q=test&lang=en
fn:escape-html-uri('https://example.com/page?id=1§ion=2')https://example.com/page?id=1&section=2

+ W3C Documentation reference: Escape-HTML-URI +
+ + + fn:iri-to-uri(xs:string?) +
+ Converts an IRI to a URI by escaping non-ASCII characters
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?IRI to be converted to a URI
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:iri-to-uri('https://example.com/ümlaut')https://example.com/%C3%BCmlaut
fn:iri-to-uri('https://example.com/日本語')https://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E

+ W3C Documentation reference: IRI-to-URI +
+ + + fn:encode-for-uri(xs:string?) +
+ Encodes a string for use in a URI by escaping special characters
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?String to be encoded for use in a URI
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:encode-for-uri('hello world')hello%20world
fn:encode-for-uri('example?query=value¶m=value2')example%3Fquery%3Dvalue%26param%3Dvalue2

+ W3C Documentation reference: Encode-for-URI +
+ + + fn:resolve-uri(xs:string?, xs:string?) +
+ Resolves a relative URI using a base URI
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Relative URI to resolve
xs:string?Base URI to use for resolving (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:resolve-uri('example.html', 'https://www.example.com/folder/')https://www.example.com/folder/example.html
fn:resolve-uri('../images/pic.jpg', + 'https://www.example.com/folder/page.html')https://www.example.com/images/pic.jpg

+ W3C Documentation reference: Resolve-URI +
+ + + + fn:analyze-string(xs:string?, xs:string, xs:string?) +
+ Analyzes the input string and returns an XML fragment containing match and non-match + elements
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to analyze
xs:stringRegular expression pattern to match
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:analyze-string('red,green,blue', ',') + <fn:analyze-string-result><fn:non-match>red</fn:non-match><fn:match>, + <fn:non-match>green</fn:non-match><fn:match>, + <fn:non-match>blue</fn:non-match></fn:analyze-string-result> +

+ W3C Documentation reference: Analyze-String +
+ + + fn:tokenize(xs:string?, xs:string, xs:string?) +
+ Splits the input string into a sequence of substrings using the pattern as a delimiter +
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to tokenize
xs:stringRegular expression pattern to use as delimiter
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:tokenize('XPath 3.0, XQuery 3.0, XSLT 3.0', ',\\s*')('XPath 3.0', 'XQuery 3.0', 'XSLT 3.0')
fn:tokenize('apple,orange,banana', ',')('apple', 'orange', 'banana')

+ W3C Documentation reference: Tokenize +
+ + + fn:replace(xs:string?, xs:string, xs:string, xs:string?) +
+ Replaces occurrences of the pattern in the input string with the replacement string
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:stringRegular expression pattern to match
xs:stringReplacement string
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:replace('XPath 3.0 is great', '3.0', '3.1')'XPath 3.1 is great'
fn:replace('Hello, World!', 'World', 'XPath')'Hello, XPath!'

+ W3C Documentation reference: Replace +
+ + + fn:matches(xs:string?, xs:string, xs:string?) +
+ Returns true if the input string matches the regular expression pattern, otherwise false +
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:stringRegular expression pattern to match
xs:string?Flags to control the regular expression matching (optional)
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:matches('XPath 3.0', '\\d\\.\\d')true
fn:matches('Hello, World!', '[A-Z][a-z]*')true
fn:matches('example123', '\\d+', 'q')false

+ W3C Documentation reference: Matches +
+ + + fn:substring-after(xs:string?, xs:string?) +
+ Returns the part of the first string that follows the first occurrence of the second + string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:substring-after('Hello, World!', ',')' World!'
fn:substring-after('XPath 3.0 is awesome!', '3.0')' is awesome!'

+ W3C Documentation reference: Substring-After +
+ + + fn:substring-before(xs:string?, xs:string?) +
+ Returns the part of the first string that precedes the first occurrence of the second + string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:substring-before('Hello, World!', ',')'Hello'
fn:substring-before('XPath 3.0 is awesome!', '3.0')'XPath '

+ W3C Documentation reference: Substring-Before +
+ + + fn:ends-with(xs:string?, xs:string?) +
+ Returns true if the first string ends with the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to check
xs:string?Substring to check for at the end of the first string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:ends-with('Hello, World!', 'World!')true
fn:ends-with('Hello, World!', 'Hello')false
fn:ends-with('XPath 3.0', '3.0')true

+ W3C Documentation reference: Ends-With +
+ + + fn:starts-with(xs:string?, xs:string?) +
+ Returns true if the first string starts with the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to check
xs:string?Substring to check for at the beginning of the first string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:starts-with('Hello, World!', 'Hello')true
fn:starts-with('Hello, World!', 'World')false
fn:starts-with('XPath 3.0', 'XPath')true

+ W3C Documentation reference: Starts-With +
+ + + fn:contains(xs:string?, xs:string?) +
+ Returns true if the first string contains the second string, otherwise false
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to search within
xs:string?Substring to search for
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:contains('Hello, World!', 'World')true
fn:contains('Hello, World!', 'world')false
fn:contains('XPath 3.0', '3.0')true

+ W3C Documentation reference: Contains +
+ + + fn:translate(xs:string?, xs:string, xs:string) +
+ Returns the input string with specified characters replaced
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to be translated
xs:stringMap string with characters to replace
xs:stringTranslate string with replacement characters
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:translate('apple', 'aeiou', '12345')'1ppl2'
fn:translate('Hello, World!', 'HW', 'hw')'hello, world!'

+ W3C Documentation reference: Translate +
+ + + fn:lower-case(xs:string?) +
+ Returns the input string with all characters converted to lowercase
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to convert to lowercase
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:lower-case('HELLO, WORLD!')'hello, world!'
fn:lower-case('XPath 3.0')'xpath 3.0'
fn:lower-case('BANANA')'banana'

+ W3C Documentation reference: Lower-Case +
+ + + fn:upper-case(xs:string?) +
+ Returns the input string with all characters converted to uppercase
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to convert to uppercase
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:upper-case('Hello, World!')'HELLO, WORLD!'
fn:upper-case('XPath 3.0')'XPATH 3.0'
fn:upper-case('banana')'BANANA'

+ W3C Documentation reference: Upper-Case +
+ + + fn:normalize-unicode(xs:string?, xs:string) +
+ Returns the input string with Unicode normalization applied
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input string to normalize
xs:stringNormalization form to apply (NFC, NFD, NFKC, NFKD)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:normalize-unicode('Café', 'NFC')'Café'
fn:normalize-unicode('Café', 'NFD')'Café'

+ W3C Documentation reference: Normalize-Unicode +
+ + + fn:normalize-space(xs:string?) +
+ Returns the input string with whitespace normalized
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to normalize whitespace
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:normalize-space(' Hello, World! ')'Hello, World!'
fn:normalize-space(' XPath 3.0 ')'XPath 3.0'
fn:normalize-space('\tbanana\t')'banana'

+ W3C Documentation reference: Normalize-Space +
+ + + fn:string-length(xs:string?) +
+ Returns the length of the input string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string to calculate length
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-length('Hello, World!')13
fn:string-length('XPath 3.0')8
fn:string-length('banana')6

+ W3C Documentation reference: String-Length +
+ + + fn:substring(xs:string?, xs:double) +
+ Returns a substring of the source string, starting from a specific location
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?Input source string
xs:doubleStarting location to extract the substring
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:substring('Hello, World!', 1, 5)'Hello'
fn:substring('XPath 3.0', 7)'3.0'
fn:substring('banana', 2, 3)'ana'

+ W3C Documentation reference: Substring +
+ + fn:string-join(xs:string*, xs:string) +
+ Joins a sequence of strings with a specified separator, returning a single string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*Input sequence of strings to join
xs:stringSeparator string to insert between joined strings
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-join(('apple', 'banana', 'orange'), ', ')'apple, banana, orange'
fn:string-join(('XPath', '3.0', 'Functions'), ' - ')'XPath - 3.0 - Functions'
fn:string-join(('A', 'B', 'C'), '')'ABC'

+ W3C Documentation reference: String-Join +
+ + + fn:concat(xs:anyAtomicType?, xs:anyAtomicType?, ...) +
+ Concatenates two or more strings or atomic values, returning a single string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:anyAtomicType?Input strings or atomic values to concatenate
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:concat('Hello', ' ', 'World')'Hello World'
fn:concat('I have ', 3, ' apples')'I have 3 apples'
fn:concat('XPath ', '3.0')'XPath 3.0'

+ W3C Documentation reference: Concat +
+ + + fn:codepoint-equal(xs:string?, xs:string?) +
+ Compares two strings on a codepoint-by-codepoint basis and returns true if they are + equal, false otherwise
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?First string to compare
xs:string?Second string to compare
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:codepoint-equal('Hello', 'Hello')true
fn:codepoint-equal('Hello', 'hello')false
fn:codepoint-equal('apple', 'banana')false

+ W3C Documentation reference: Codepoint-Equal +
+ + + fn:compare(xs:string?, xs:string?) +
+ Compares two strings and returns -1, 0, or 1 if the first string is less than, equal to, + or greater than the second string, respectively
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?First string to compare
xs:string?Second string to compare
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:compare('apple', 'banana')-1
fn:compare('apple', 'apple')0
fn:compare('banana', 'apple')1

+ W3C Documentation reference: Compare +
+ + + fn:string-to-codepoints(xs:string?) +
+ Returns a sequence of Unicode code points for a given string
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?Input string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:string-to-codepoints('Hello')(72, 101, 108, 108, 111)
fn:string-to-codepoints('( ͡° ͜ʖ ͡°)')(40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)
fn:string-to-codepoints('😊')(128522)

+ W3C Documentation reference: String-To-Codepoints +
+ + + fn:codepoints-to-string(xs:integer*) +
+ Constructs a string from a sequence of Unicode code points
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:integer*Sequence of Unicode code points
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:codepoints-to-string((72, 101, 108, 108, 111))Hello
codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)) + ( ͡° ͜ʖ ͡°)
fn:codepoints-to-string((128522))😊

+ W3C Documentation reference: Codepoints-To-String +
+ + + + fn:string(object) +
+ Returns the string representation of the object argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference: String-Functions +
+ + +
+
+
+ + + +
+ + + fn:format-number(numeric?, xs:string, item()?) +
+ Returns a string that represents a formatted version of a number using a formatting + pattern and an optional + set of properties
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
numeric?The number to format
xs:stringThe formatting pattern
item()?Optional: the set of properties for formatting the number
xs:stringThe formatted number as a string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
format-number(12345.678, "#,##0.00")Returns the formatted number: "12,345.68"
format-number(12345.678, "#,##0")Returns the formatted number: "12,346"
format-number(12345.678, "0.000")Returns the formatted number: "12345.678"

+ W3C Documentation reference: format-number +
+ + + + fn:format-integer(xs:integer?, xs:string) +
+ Formats an integer value according to the supplied picture string
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:integer?Integer value to be formatted
xs:stringPicture string defining the format
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:format-integer(12345, '0,0')12,345
fn:format-integer(-1234, '0,0')-1,234
fn:format-integer(1234, '00-00-00')01-23-45

+ W3C Documentation reference: Format-Integer +
+ + + fn:round-half-to-even(numeric?) +
+ Returns the closest integer to the given numeric value, rounding half-way cases to the + nearest even integer (also known as "bankers' rounding")
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the rounded value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + + + + + +
ExpressionResult
fn:round-half-to-even(3.5)4
fn:round-half-to-even(2.5)2
fn:round-half-to-even(-1.5)-2
fn:round-half-to-even(xs:decimal('1.25'), 1)1.2

+ W3C Documentation reference: Round-Half-To-Even +
+ + + fn:round(numeric?) +
+ Returns the closest integer to the given numeric value, rounding half-way cases away + from zero
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the rounded value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:round(3.14)3
fn:round(-4.7)-5
fn:round(xs:decimal('2.5'))3

+ W3C Documentation reference: Round +
+ + + fn:floor(numeric?) +
+ Returns the largest integer less than or equal to the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the floor value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:floor(3.14)3
fn:floor(-4.7)-5
fn:floor(xs:decimal('2.5'))2

+ W3C Documentation reference: Floor +
+ + + + fn:ceiling(numeric?) +
+ Returns the smallest integer greater than or equal to the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the ceiling value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:ceiling(3.14)4
fn:ceiling(-4.7)-4
fn:ceiling(xs:decimal('2.5'))3

+ W3C Documentation reference: Ceiling +
+ + + fn:abs(numeric?) +
+ Returns the absolute value of the given numeric value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
numeric?Numeric value for which the absolute value will be calculated
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
fn:abs(-42)42
fn:abs(3.14)3.14
fn:abs(xs:decimal('-5.5'))5.5

+ W3C Documentation reference: Abs +
+ + fn:number(item?) +
+ Converts the given value to a number
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item?Returns the numeric value of the specified expression or the context item + (if no argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:number(/library/fiction:book[1]/@id)1 (if the first fiction:book element's id attribute is "1")
fn:number(/library/fiction:book[1]/price)19.99 (if the first fiction:book element's price element contains "19.99") +

+ W3C Documentation reference: Number +
+ + + + +
+
+
+ + + +
+ + fn:sort(item()*) +
+ Sorts an array of items based on their atomic values
+ Arguments and return type: + + + + + + + + + +
TypeDescription
ArrayThe array of items to be sorted
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:sort([10, 5, 20])[5, 10, 20]
fn:sort(['banana', 'apple', 'cherry'])['apple', 'banana', 'cherry']

+ W3C Documentation reference: Sort +
+ + + fn:fold-right(item()*, item()*, function(item(), 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(item()*, item()*, function(item()*, 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() +
+ 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(xs:string?) +
+ Returns a sequence of document nodes obtained from the collection identified by the + argument URI, or the + default collection if no argument is supplied.
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?The URI of the collection to retrieve (Optional)
document-node()*A sequence of document nodes obtained from the collection
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
collection()Returns the sequence of document nodes from the default collection
collection("http://example.com/collection")Returns the sequence of document nodes from the collection identified by the + specified URI
count(collection())Returns the number of document nodes in the default collection

+ W3C Documentation reference: collection +
+ + + fn:sum(xs:anyAtomicType*, 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(xs:anyAtomicType*) +
+ Returns the minimum value of a sequence of atomic values, according to the ordering + rules for the value's + type
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*The input sequence of atomic values
xs:anyAtomicType?The minimum value of the input sequence, or the empty sequence if the input + sequence is empty +
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
min((5, 1, 9, 3))Returns the minimum value: 1
min(())Returns the empty sequence: ()
min(("apple", "banana", "cherry"))Returns the minimum value (alphabetical order): "apple"

+ W3C Documentation reference: min +
+ + + fn:max(xs:anyAtomicType*) +
+ Returns the maximum value of a sequence of atomic values, according to the ordering + rules for the value's + type
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*The input sequence of atomic values
xs:anyAtomicType?The maximum value of the input sequence, or the empty sequence if the input + sequence is empty +
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
max((5, 1, 9, 3))Returns the maximum value: 9
max(())Returns the empty sequence: ()
max(("apple", "banana", "cherry"))Returns the maximum value (alphabetical order): "cherry"

+ W3C Documentation reference: max +
+ + + + fn:avg(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(item()*) +
+ 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(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(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(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(item()* , item()*) +
+ 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(xs:anyAtomicType*, xs:anyAtomicType) +
+ 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(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(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(item()*, xs:double, xs:double) +
+ 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(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(item()*, xs:integer) +
+ 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(item()*, xs:integer, 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(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(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(item()*) +
+ 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(item()*) +
+ 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:data(item*) +
+ Returns the simple value of an item or a sequence of items
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item?Returns the simple value of the specified item or the context item (if no + argument is provided)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:data(/library/fiction:book[1]/title)The Catcher in the Rye
fn:data(/library/fiction:book[2]/author)Harper Lee

+ W3C Documentation reference: Data +
+ + +
+
+
+ + + +
+ + + + fn:implicit-timezone() +
+ 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() +
+ 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() +
+ 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() +
+ 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(xs:time?, xs:string, xs:string?, xs:string?, xs:string?) +
+ Formats a time value according to a formatting picture string, with optional language, + calendar, and + country parameters.
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:time?The time value to be formatted (Optional)
xs:stringThe formatting picture string
xs:string?The language for formatting (Optional)
xs:string?The calendar for formatting (Optional)
xs:string?The country for formatting (Optional)
xs:stringThe formatted time value as a string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
format-time(xs:time("14:30:00"), "[H]:[m]")"14:30"
format-time(xs:time("14:30:00"), "[H]:[m]:[s]")"14:30:00"
format-time(xs:time("14:30:00.456"), "[H]:[m]:[s].[f]")"14:30:00.456"

+ W3C Documentation reference: format-time +
+ + + + fn:format-date(xs:date?, xs:string, xs:string?, xs:string?, 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(xs:dateTime?, xs:string, xs:string?, xs:string?, xs:string?) +
+ Formats a dateTime value according to a formatting picture string, with optional + language, calendar, and + country parameters.
+ Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:dateTime?The dateTime value to be formatted (Optional)
xs:stringThe formatting picture string
xs:string?The language for formatting (Optional)
xs:string?The calendar for formatting (Optional)
xs:string?The country for formatting (Optional)
xs:stringThe formatted dateTime value as a string
+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
format-dateTime(xs:dateTime("2023-04-12T14:30:00"), "[Y]-[M]-[D]T[H]:[m]") + "2023-04-12T14:30"
format-dateTime(xs:dateTime("2023-04-12T14:30:00"), "[FNn, Nn] [D] [MNn] + [Y]")"Wednesday, 12 April 2023"
format-dateTime(xs:dateTime("2023-04-12T14:30:00.123"), + "[Y]-[M]-[D]T[H]:[m]:[s].[f]")"2023-04-12T14:30:00.123"

+ W3C Documentation reference: format-dateTime +
+ + + + fn:adjust-time-to-timezone(xs:time?, xs:dayTimeDuration?) +
+ 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(xs:date?, xs:dayTimeDuration?) +
+ 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(xs:dateTime?, xs:dayTimeDuration?) +
+ 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(xs:time?) +
+ 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(xs:time?) +
+ 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(xs:time?) +
+ 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(xs:time?) +
+ 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(xs:date?) +
+ 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(xs:date?) +
+ 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(xs:date?) +
+ 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(xs:date?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:dateTime?) +
+ 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(xs:date?, xs:time?) +
+ Constructs an xs:dateTime value from an xs:date and an xs:time value
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:date?Date value
xs:time?Time value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:dateTime(xs:date('2023-03-29'), xs:time('12:30:00'))2023-03-29T12:30:00
fn:dateTime(xs:date('2023-03-29+05:00'), xs:time('12:30:00-08:00'))2023-03-29T12:30:00-08:00

+ W3C Documentation reference: DateTime +
+ + + fn:seconds-from-duration(xs:duration?) +
+ Returns the seconds component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the seconds component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:seconds-from-duration(xs:dayTimeDuration('PT1H30M15.5S'))15.5
fn:seconds-from-duration(xs:dayTimeDuration('-PT2M10.3S'))-10.3

+ W3C Documentation reference: Seconds-From-Duration +
+ + + fn:minutes-from-duration(xs:duration?) +
+ Returns the minutes component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the minutes component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:minutes-from-duration(xs:dayTimeDuration('PT2H30M'))30
fn:minutes-from-duration(xs:dayTimeDuration('-PT1H45M'))-45

+ W3C Documentation reference: Minutes-From-Duration +
+ + + fn:hours-from-duration(xs:duration?) +
+ Returns the hours component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the hours component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:hours-from-duration(xs:dayTimeDuration('PT36H'))36
fn:hours-from-duration(xs:dayTimeDuration('-PT12H30M'))-12

+ W3C Documentation reference: Hours-From-Duration +
+ + + fn:days-from-duration(xs:duration?) +
+ Returns the days component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the days component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:days-from-duration(xs:dayTimeDuration('P5DT12H30M'))5
fn:days-from-duration(xs:dayTimeDuration('-P2DT6H'))-2

+ W3C Documentation reference: Days-From-Duration +
+ + + + fn:months-from-duration(xs:duration?) +
+ Returns the months component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the months component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:months-from-duration(xs:duration('P2Y3M4DT5H6M7S'))3
fn:months-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-3

+ W3C Documentation reference: Months-From-Duration +
+ + + fn:years-from-duration(xs:duration?) +
+ Returns the years component of the duration
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?Duration from which to extract the years component
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:years-from-duration(xs:duration('P2Y3M4DT5H6M7S'))2
fn:years-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-2

+ W3C Documentation reference: Years-From-Duration +
+
+
+
+ + + +
+ + fn:trace(item()*, xs:string) +
+ Outputs the provided label and value for diagnostic purposes and returns the value + unchanged
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
item()*Value to be traced
xs:stringLabel to be output along with the value
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:trace(42, 'The value is:')Outputs "The value is: 42" for diagnostic purposes and returns 42
fn:trace(/library/book/title, 'Book title:')Outputs "Book title: [book title]" for diagnostic purposes and returns + the book title

+ W3C Documentation reference: Trace +
+ + + fn:error(xs:QName?, xs:string?, $error-object) +
+ Raises an error with the specified error code, description, and error object
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:QName?Error code (optional)
xs:string?Description of the error (optional)
item()*Error object (optional)
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:error(xs:QName('err:FOER0000'))Raise error with the code err:FOER0000
fn:error(xs:QName('err:FOER0000'), 'Invalid value')Raise error with the code err:FOER0000 and description "Invalid value" +

+ W3C Documentation reference: Error +
+ +
+
+
+ + + +
+ + fn:xml-to-json(node(), map(*)) +
+ Converts an XML representation of a JSON value to its JSON serialization
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
node()XML representation of a JSON value
map(*)Options for the JSON serialization
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:xml-to-json('<map><string + key="name">John</string><number + key="age">30</number></map>')'{"name": "John", "age": 30}'
fn:xml-to-json('<array><number>1</number><number>2</number><number>3</number></array>') + '[1, 2, 3]'

+ W3C Documentation reference: XML-to-JSON +
+ + + fn:json-to-xml(item()) +
+ Converts a JSON value to its XML representation
+ Arguments and return type: + + + + + + + + + +
TypeDescription
item()JSON value to be converted
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:json-to-xml(map{"name": "John", "age": 30}) + <map> + <string key="name">John</string> + <number key="age">30</number> + </map> +
fn:json-to-xml([1, 2, 3]) + <array> + <number>1</number> + <number>2</number> + <number>3</number> + </array> +

+ W3C Documentation reference: JSON-to-XML +
+ + + fn:json-doc(xs:string) +
+ Parses a JSON document from a URI and returns the corresponding value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:stringURI of the JSON document to be parsed
+ Examples:
+ + + + + + + + + +
ExpressionResult
fn:json-doc('https://example.com/data.json')Parsed JSON value from the specified URI

+ W3C Documentation reference: JSON-Doc +
+ + + fn:parse-json(xs:string?) +
+ Parses a JSON string and returns the corresponding value
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?JSON string to be parsed
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
fn:parse-json('{"name": "John", "age": 30}')map{"name": "John", "age": 30}
fn:parse-json('[1, 2, 3]')[1, 2, 3]

+ W3C Documentation reference: Parse-JSON +
+ + + fn:function-arity(function(*)) +
+ 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(*)) +
+ 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(xs:QName, xs:integer) +
+ 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() +
+ 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() +
+ 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(item()?, item()?) +
+ 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(xs:string?) +
+ 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(xs:string?) +
+ 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() +
+ 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(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(xs:string?) +
+ 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(xs:string?) +
+ 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(xs:string?) +
+ 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()?) +
+ 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(xs:string*) +
+ 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(xs:string*) +
+ 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(xs:string, node()?) +
+ 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()) +
+ 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(xs:string?, element()) +
+ 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(xs:QName?) +
+ 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(xs:QName?) +
+ 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(xs:QName?) +
+ 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(xs:string?, xs:string) +
+ 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(xs:string?, element()) +
+ 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) +
+ Returns a Boolean value indicating whether the argument node is nilled
+
+ W3C Documentation reference: #func-nilled + +
+ + + + + +
+
+
+ + + +
+ + fn:for-each-pair(item()*, item()*, function(item(), item())) +
+ 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(item()*, function(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(item()*, function(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 +
+ +
+
+
+
@@ -5295,14 +16956,14 @@ hideList(document.getElementsByName("collapse20")); showList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); - + } else if (filter == "collapse3.1") { document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.1 functions"; hideList(document.getElementsByName("collapse10")); hideList(document.getElementsByName("collapse20")); hideList(document.getElementsByName("collapse30")); showList(document.getElementsByName("collapse31")); - } else if (filter == "collapse2.0"){ + } else if (filter == "collapse2.0") { document.getElementById("tooltipFunctionInfo").innerText = "XPath 2.0 functions"; hideList(document.getElementsByName("collapse10")); showList(document.getElementsByName("collapse20")); @@ -5320,7 +16981,7 @@ var triggerList = document.getElementsByClassName("collapseTrigger"); for (i = 0; i < triggerList.length; i++) { - + triggerList[i].addEventListener("click", function () { var collapsible = this.parentElement; if (this.tagName == "A") { @@ -5330,7 +16991,7 @@ } - + if (collapsibleData.style.maxHeight > "0px") { collapsibleData.style.maxHeight = "0px"; @@ -5365,7 +17026,7 @@ //Handle clicks in whole form and set info in tooltip setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); setDefaultContent(document.getElementById("transformArea"), 'Insert XPath expression here'); - + processVersionSelector(); processTooltip(); tool.addEventListener('change', event => { @@ -5404,4 +17065,4 @@ - + \ No newline at end of file From 0946982ab6e9c2c2b7405d86aff0433a54ca14b3 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Tue, 18 Apr 2023 10:55:45 +0200 Subject: [PATCH 09/59] Added missing functions (#143) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/143 Reviewed-by: Mikolaj Widla Reviewed-by: Dariusz Augustyniak --- Frontend/tools/xpath.html | 1096 ++++++++++++++++++++++--------------- 1 file changed, 649 insertions(+), 447 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 7f82f5d..1f25721 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -135,46 +135,54 @@ fn:position()
- Returns the position of the current context node
+ Returns the position of the current context node.

W3C Documentation reference: Node-Set-Functions
- - + + fn:last() +
+ The last function returns a number equal to the context size from the expression evaluation context.
+
+ W3C Documentation reference: Node-Set-Functions +
+ + fn:count()
- Returns the number of nodes in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-setNode-set to count nodes in
Examples:
- - - - - - - - - - - - - -
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

- W3C Documentation reference: Node-Set-Functions + Returns the number of nodes in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-setNode-set to count nodes in
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

+ W3C Documentation reference: Node-Set-Functions
- - - + + + fn:id()
@@ -182,125 +190,103 @@
W3C Documentation reference: Node-Set-Functions
- - - + + + fn:local-name()
- Returns the local-name for the first node in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-setExtract first node and return its local name
Examples:
- - - - - - - - - - - - - -
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

- W3C Documentation reference: Node-Set-Functions + Returns the local-name for the first node in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-setExtract first node and return its local name
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

+ W3C Documentation reference: Node-Set-Functions
- - - - fn:local-name() -
- Returns the local-name for the context node
-
- W3C Documentation reference: Node-Set-Functions -
- - - + + fn:namespace-uri()
- Returns the namespace-uri for the first node in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
- - - - - - - - - -
ExpressionResult
namespace-uri(//b:book)http://www.book.com

- W3C Documentation reference: Node-Set-Functions + Returns the namespace-uri for the first node in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
+ + + + + + + + + +
ExpressionResult
namespace-uri(//b:book)http://www.book.com

+ W3C Documentation reference: Node-Set-Functions
- - - - fn:namespace-uri() -
- Returns the namespace-uri for the context node
-
- W3C Documentation reference: Node-Set-Functions -
- - - + + fn:name()
- Returns the name for the first node in the node-set
- Arguments: - - - - - - - - - -
TypeDescription
node-set (Optional)Extract first node and return QName
Examples:
- - - - - - - - - - - - - -
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

- W3C Documentation reference: Node-Set-Functions + Returns the name for the first node in the node-set
+ Arguments: + + + + + + + + + +
TypeDescription
node-set (Optional)Extract first node and return QName
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

+ W3C Documentation reference: Node-Set-Functions
- +
@@ -308,104 +294,93 @@
- - + + fn:boolean()
- The boolean function converts its argument to a boolean as follows: -
    -
  • a number is true if and only if it is neither positive or negative zero nor NaN -
  • -
  • a node-set is true if and only if it is non-empty
  • -
  • a string is true if and only if its length is non-zero
  • -
  • an object of a type other than the four basic types is converted to a boolean in - a way that is dependent on that type
  • -
- - Arguments: - - - - - - - - - -
TypeDescription
objectThe object to convert to a boolean
Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Boolean-Functions + The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • +
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a boolean
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
boolean("Release11")true
boolean("")false

+ W3C Documentation reference: Boolean-Functions
- + fn:not()
- The not function returns true if its argument is false, and false otherwise.
-
- W3C Documentation reference: Boolean-Functions + The not function returns true if its argument is false, and false otherwise.
+
+ W3C Documentation reference: Boolean-Functions
- - + + fn:true()
- The true function returns true.
-
- W3C Documentation reference: Boolean-Functions + The true function returns true.
+
+ W3C Documentation reference: Boolean-Functions
- - + + fn:false()
- The true function returns false.
-
- W3C Documentation reference: Boolean-Functions + The true function returns false.
+
+ W3C Documentation reference: Boolean-Functions
- + fn:lang()
- The lang function returns true or false depending on whether the language of the context - node as specified by xml:lang attributes is the same as or is a sublanguage of the - language specified by the argument string. The language of the context node is - determined by the value of the xml:lang attribute on the context node, or, if the - context node has no xml:lang attribute, by the value of the xml:lang attribute on the - nearest ancestor of the context node that has an xml:lang attribute. If there is no such - attribute, then lang returns false. If there is such an attribute, then lang returns - true if the attribute value is equal to the argument ignoring case, or if there is some - suffix starting with - such that the attribute value is equal to the argument ignoring - that suffix of the attribute value and ignoring case.
- Arguments: - - - - - - - - - -
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation
+ The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
+ Arguments: + + + + + + + + + +
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation

- W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions
- - + +
@@ -413,14 +388,71 @@
- + fn:string()
- The string function converts an object to a string as follows: A node-set is converted - to a string by returning the string-value of the node in the node-set that is first in - document order. If the node-set is empty, an empty string is returned.
- + The string function converts an object to a string as follows: A node-set is converted to a string by returning the string-value of the node in the node-set that is first in document order. If the node-set is empty, an empty string is returned.
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a string
Examples:
+ + + + + + + + + +
ExpressionResult
string(10)true

+ W3C Documentation reference: String-Functions +
+ + + fn:concat() +
+ The concat function returns the concatenation of its arguments.
+ + Arguments: + + + + + + + + + +
TypeDescription
string*Strings to concatenate
Examples:
+ + + + + + + + + +
ExpressionResult
concat("Release", 11)Release11

+ W3C Documentation reference: String-Functions +
+ + fn:starts-with() +
+ Returns true if the first argument string starts with the second argument string, and otherwise returns false.
+ Arguments: @@ -428,8 +460,12 @@ - - + + + + + +
Description
objectThe object to convert to a stringstringString to test
stringString that first string has to start from
Examples:
@@ -438,48 +474,18 @@ - +
Result
string(10)starts-with("Release11", "Rel") true

W3C Documentation reference: String-Functions
- - + fn:concat() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:contains()
- The concat function returns the concatenation of its arguments.
- - Arguments: - - - - - - - - - -
TypeDescription
string*Strings to concatenate
Examples:
- - - - - - - - - -
ExpressionResult
concat("Release", 11)Release11

- W3C Documentation reference: String-Functions -
- - fn:starts-with() -
- The concat function returns the concatenation of its arguments.
- + The contains function returns true if the first argument string contains the second argument string, and otherwise returns false.
+ Arguments: @@ -488,11 +494,11 @@ - + - +
stringString to test
stringThe object to convert to a stringString that first string has to contain
Examples:
@@ -501,14 +507,227 @@ - - + +
Result
concat("Release", 11)Release11contains("Release11", "eas")true

W3C Documentation reference: String-Functions
- - + + fn:substring-before() +
+ The substring-before function returns the substring of the first argument string that precedes the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string.
+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
stringString to test
stringString that first string has to contain
Examples:
+ + + + + + + + + +
ExpressionResult
substring-before("1999/04/01","/")1999

+ W3C Documentation reference: String-Functions +
+ + + fn:substring-after() +
+ The substring-after function returns the substring of the first argument string that follows the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string.
+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
stringString to test
stringString that first string has to contain
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
substring-after("1999/04/01","/")04/01
substring-after("1999/04/01","19")99/04/01

+ W3C Documentation reference: String-Functions +
+ + + fn:substring() +
+ The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument.
+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
stringString to test
numberStarting index
number?Length of target substring
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
substring("12345",2)2345
substring("12345",2,3)234

+ W3C Documentation reference: String-Functions +
+ + fn:string-length() +
+ The string-length returns the number of characters in the string. If the argument is omitted, it defaults to the context node converted to a string, in other words the string-value of the context node.
+ + Arguments: + + + + + + + + + +
TypeDescription
string?String to test
Examples:
+ + + + + + + + + +
ExpressionResult
string-length("abcdef")6

+ W3C Documentation reference: String-Functions +
+ + fn:normalize-space() +
+ The normalize-space function returns the argument string with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of whitespace characters by a single space. Whitespace characters are the same as those allowed by the S production in XML. If the argument is omitted, it defaults to the context node converted to a string, in other words the string-value of the context node.
+ + Arguments: + + + + + + + + + +
TypeDescription
string?String to test
Examples:
+ + + + + + + + + +
ExpressionResult
normalize-space(" abc def ")abc def

+ W3C Documentation reference: String-Functions +
+ + + fn:translate() +
+ The translate function returns the first argument string with occurrences of characters in the second argument string replaced by the character at the corresponding position in the third argument string. If there is a character in the second argument string with no character at a corresponding position in the third argument string (because the second argument string is longer than the third argument string), then occurrences of that character in the first argument string are removed.
+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
stringString to translate
stringCharacters to remove
stringString to insert characters from second argument
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
translate("bar","abc","ABC")BAr
translate("--aaa--","abc-","ABC")AAA

+ W3C Documentation reference: String-Functions +
+ +
@@ -516,208 +735,191 @@
- - + + fn:number()
- The number function converts its argument to a number as follows: -
    -
  • a string that consists of optional whitespace followed by an optional minus sign - followed by a Number followed by whitespace is converted to the IEEE 754 number - that is nearest (according to the IEEE 754 round-to-nearest rule) to the - mathematical value represented by the string; any other string is converted to - NaN
  • -
  • boolean true is converted to 1; boolean false is converted to 0
  • -
  • a node-set is first converted to a string as if by a call to the string function - and then converted in the same way as a string argument
  • -
  • an object of a type other than the four basic types is converted to a number in - a way that is dependent on that type
  • -
- - Arguments: - - - - - - - - - -
TypeDescription
objectThe object to convert to a number
Examples:
- - - - - - - - - - - - - -
ExpressionResult
number(10)10
number("")NaN

- W3C Documentation reference + The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • +
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
number(10)10
number("")NaN

+ W3C Documentation reference
- + fn:sum()
- The sum function returns the sum, for each node in the argument node-set, of the result - of converting the string-values of the node to a number.
- - Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - -
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

- W3C Documentation reference + The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + +
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

+ W3C Documentation reference
- + fn:floor()
- The floor function returns the largest (closest to positive infinity) number that is not - greater than the argument and that is an integer.
- - Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - - - - - - - - - -
ExpressionResult
floor(3.1)4
floor(3.9)4
floor(3.5)4

- W3C Documentation reference + The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)4
floor(3.9)4
floor(3.5)4

+ W3C Documentation reference
- + fn:ceiling()
- The ceiling function returns the smallest (closest to negative infinity) number that is - not less than the argument and that is an integer.
- - Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - - - - - - - - - -
ExpressionResult
floor(3.1)3
floor(3.9)3
floor(3.5)3

- W3C Documentation reference + The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)3
floor(3.5)3

+ W3C Documentation reference
- - + + fn:round()
- The round function returns the number that is closest to the argument and that is an - integer. If there are two such numbers, then the one that is closest to positive - infinity is returned. If the argument is NaN, then NaN is returned. If the argument is - positive infinity, then positive infinity is returned. If the argument is negative - infinity, then negative infinity is returned. If the argument is positive zero, then - positive zero is returned. If the argument is negative zero, then negative zero is - returned. If the argument is less than zero, but greater than or equal to -0.5, then - negative zero is returned. - -

NOTE

- For these last two cases, the result of calling the round function is not the same as - the result of adding 0.5 and then calling the floor function.
- - Arguments: - - - - - - - - - -
TypeDescription
node-setNode set to sum
Examples:
- - - - - - - - - - - - - - - - - -
ExpressionResult
floor(3.1)3
floor(3.9)4
floor(3.5)3

- W3C Documentation reference + The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. + +

NOTE

+ For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)4
floor(3.5)3

+ W3C Documentation reference
- +
From b72157377d38a1d6b1d5a6b2a1feaa1c5af0bdab Mon Sep 17 00:00:00 2001 From: Mikolaj Widla Date: Wed, 19 Apr 2023 10:28:04 +0200 Subject: [PATCH 10/59] Disabled caching for frontend (#146) Disable caching for frontend Co-authored-by: widlam Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/146 Reviewed-by: Adam Bem Co-authored-by: Mikolaj Widla Co-committed-by: Mikolaj Widla --- Frontend/Dockerfile | 1 + Frontend/nginx.conf | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Frontend/nginx.conf diff --git a/Frontend/Dockerfile b/Frontend/Dockerfile index c776286..58fdcd5 100644 --- a/Frontend/Dockerfile +++ b/Frontend/Dockerfile @@ -4,6 +4,7 @@ COPY ./tools/ /usr/share/nginx/html/tools/ COPY ./lawful/ /usr/share/nginx/html/lawful/ COPY ./assets/ /usr/share/nginx/html/assets/ COPY ./index.html /usr/share/nginx/html +COPY ./nginx.conf /etc/nginx/conf.d/default.conf RUN mkdir -p /scripts COPY insert_version.sh /scripts/ diff --git a/Frontend/nginx.conf b/Frontend/nginx.conf new file mode 100644 index 0000000..e52fbb2 --- /dev/null +++ b/Frontend/nginx.conf @@ -0,0 +1,24 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + expires -1; + add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + +} \ No newline at end of file From afcd52815f384691055a2a9a2e07e49da3293a74 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 29 Mar 2023 08:49:43 +0200 Subject: [PATCH 11/59] Prepared templates for new XPath tooltips (#133) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/133 --- Frontend/tools/xpath.html | 3730 +++++++------------------------------ 1 file changed, 659 insertions(+), 3071 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 56db7a2..a7e30d1 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -111,248 +111,214 @@ - -
- - - -
- - - [1.0] fn:last() + +
+ + +
-
- Returns the position of the last node in the context list
-
- W3C Documentation reference: Node-Set-Functions + fn:position() +
+ Returns the position of the current context node
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + fn:count(node-set) +
+ Returns the number of nodes in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setNode-set to count nodes in
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:id(object) +
+ Returns the element specified by it's unique id, requires DTD
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:local-name(node-set) +
+ Returns the local-name for the first node in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setExtract first node and return its local name
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:local-name() +
+ Returns the local-name for the context node
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:namespace-uri(node-set) +
+ Returns the namespace-uri for the first node in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
+ + + + + + + + + +
ExpressionResult
namespace-uri(//b:book)http://www.book.com

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:namespace-uri() +
+ Returns the namespace-uri for the context node
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:name(node-set) +
+ Returns the name for the first node in the node-set
+ Arguments and return type: + + + + + + + + + +
TypeDescription
node-setExtract first node and return QName
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

+ W3C Documentation reference: Node-Set-Functions +
+ + + + fn:name() +
+ Returns the name for the context node
+ Examples:
+ + + + + + + + + +
ExpressionResult
current context nodeExtract first node and return QName

+ W3C Documentation reference: Node-Set-Functions
- - - [1.0] fn:position() -
-
- Returns the position of the current context node
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:count(node-set) -
-
- Returns the number of nodes in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setNode-set to count nodes in
Examples:
- - - - - - - - - - - - - -
ExpressionResult
count(//b:book)5
count(//person[@id>5])17

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:id(object) -
-
- Returns the element specified by it's unique id, requires DTD
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:local-name(node-set) -
-
- Returns the local-name for the first node in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setExtract first node and return its local name
Examples:
- - - - - - - - - - - - - -
ExpressionResult
local-name(//b:books)b:book
local-name(//b:book)b:title

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:local-name() -
-
- Returns the local-name for the context node
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:namespace-uri(node-set) -
-
- Returns the namespace-uri for the first node in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setExtract first node and return the namespace URI
Examples:
- - - - - - - - - -
ExpressionResult
namespace-uri(//b:book)http://www.book.com

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:namespace-uri() -
-
- Returns the namespace-uri for the context node
-
- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:name(node-set) -
-
- Returns the name for the first node in the node-set
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setExtract first node and return QName
Examples:
- - - - - - - - - - - - - -
ExpressionResult
name(//b:books/*)b:book
name(//b:book/*)b:title

- W3C Documentation reference: Node-Set-Functions -
-
- - - - [1.0] fn:name() -
-
- Returns the name for the context node
- Examples:
- - - - - - - - - -
ExpressionResult
current context nodeExtract first node and return QName

- W3C Documentation reference: Node-Set-Functions -
-
- - - +
-
-
+ +
- [1.0] fn:boolean(object)
-
The boolean function converts its argument to a boolean as follows:
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • @@ -387,47 +353,39 @@
    W3C Documentation reference: Boolean-Functions -
- [1.0] fn:not()
-
The not function returns true if its argument is false, and false otherwise.

W3C Documentation reference: Boolean-Functions -
- [1.0] fn:true()
-
The true function returns true.

W3C Documentation reference: Boolean-Functions -
- [1.0] fn:false()
-
The true function returns false.

W3C Documentation reference: Boolean-Functions -
- [1.0] fn:lang(string)
-
The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
Arguments and return type: @@ -442,568 +400,51 @@
Examples: Look W3C documentation

W3C Documentation reference: Boolean-Functions -
-
-
- - - -
+
+ - - [1.0] fn:string(object) -
-
- Returns the string representation of the object argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringThe object to convert to a string
Examples:
- - - - - - - - - - - - - -
ExpressionResult
string((1<0))false
string(.11)0.11

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:string() -
-
- Returns a string value representation of the context node
-
- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:concat(string, string, string*) -
-
- Returns the concatenation of its arguments
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringString to be merged
stringString to be merged
string*any number of strings
Examples:
- - - - - - - - - - - - - -
ExpressionResult
concat("aa","bb")aabb
concat("aa", 123)aa123

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:starts-with(string, string) -
-
- Returns true if the first string starts with the second string
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be found
Examples:
- - - - - - - - - - - - - -
ExpressionResult
starts-with("aabb", "aa")true
starts-with("aabb", "cc")false

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:contains(string, string) -
-
- Returns true if the first string contains the second string
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be found
Examples:
- - - - - - - - - - - - - -
ExpressionResult
contains("abc", "c")true
contains("abc", "1")false

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring-before(string, string) -
-
- Returns the substring found before the first occurrence of the second argument
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be used to split
Examples:
- - - - - - - - - - - - - -
ExpressionResult
substring-before("aabbcc","bb")aa
substring-before("aabbcc","c")aabb

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring-after(string, string) -
-
- Returns the substring found after the first occurrence of the second argument
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be searched
stringString to be used to split
Examples:
- - - - - - - - - - - - - -
ExpressionResult
substring-after("aabbcc","bb")cc
substring-after("aabbcc","a")abbcc

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring(string, number, number) -
-
- Returns the substring starting at second argument with lenght of third argument
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringString to be cut
integerStarting position
integerLength of the substring
Examples:
- - - - - - - - - -
ExpressionResult
substring("aabbcc", 1, 2)aa

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:substring(string, number) -
-
- Returns the substring of the first argument from the position specified by the second - argument
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringString to be cut
integerStarting position
Examples:
- - - - - - - - - -
ExpressionResult
substring("aabbcc", 3)bbcc

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:string-length(string) -
-
- Returns the length of the string specified by the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringString of which length should be returned
Examples:
- - - - - - - - - - - - - -
ExpressionResult
string-length("aabbcc")6
string-length("aa bb cc")8

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:string-length() -
-
- Returns the length of the string specified by the context node
-
- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:normalize-space(string) -
-
- Returns a white-space normalized string
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringString to be normalized
Examples:
- - - - - - - - - - - - - -
ExpressionResult
normalize-space("aa bb cc")aa bb cc
normalize-space("aa bb cc")aa bb cc

- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:normalize-space() -
-
- Returns a white-space normalized string specified by the context-node
-
- W3C Documentation reference: String-Functions -
-
- - - - [1.0] fn:translate(string, string, string) -
-
- Replaces characters specified by the second argument using those from the third argument -
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringString to be edited
stringsequence of characters to be replaced
stringsequence of character to be used in replacement
Examples:
- - - - - - - - - - - - - -
ExpressionResult
translate("aabbcc", "ab","xz")xxzzcc
translate("Test sequence", "e","z")Tzst szquzncz

- W3C Documentation reference: String-Functions -
-
- - - - [2.0] fn:string-join((string,string,...),sep) -
-
- Returns a string created by concatenating the string arguments and using the sep - argument as the separator
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
string*string sequence to be joined
stringseparator to be used
Examples:
- - - - - - - - - - - - - -
ExpressionResult
string-join(('fox', 'jumps', 'over', 'dog'), ' ')' fox jumps over dog '
string-join(('fox', 'jumps', 'over', 'dog'))'joxjumpsoverdog'

- W3C Documentation reference: #func-string-join -
-
+ +
+ + - - - [3.0] fn:string-to-codepoints(string) +
+ + + fn:last()
-
- Returns sequence of unicode codepoint representing the provided string
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringstring to be coverted to list of unicode values
Examples:
- - - - - - - - - -
ExpressionResult
string-to-codepoints("test")(116, 101, 115, 116)

- W3C Documentation reference: #func-string-to-codepoints -
+ Returns the position of the last node in the context list
+
+ W3C Documentation reference: Node-Set-Functions
+ + + +
+
+
+ + - - - [2.0] fn:compare(comp1,comp2) +
+ + + fn:boolean(object)
-
- Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 - is greater than comp2 (according to the rules of the collation that is used)
+ The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • +
+ Arguments and return type: @@ -1011,12 +452,8 @@ - - - - - - + +
Description
stringfirst parameter to be compared
stringsecond parameter to be comparedobjectThe object to convert to a boolean
Examples:
@@ -1025,541 +462,123 @@ - - - - - - - - - - - - - - - -
Result
compare('abc', 'abc')0
compare('abc', 'abd')-1
compare('abc1', 'abd')-1
compare("abc1","abc")1

- W3C Documentation reference: #func-compare -
-
- - - - [2.0] fn:compare(comp1,comp2,collation) -
-
- Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 - is greater than comp2 (according to the rules of the collation that is used)
- Arguments and return type: - - - - - - - - - - - - - - - - - -
TypeDescription
stringfirst parameter to be compared
stringsecond parameter to be compared
stringcollation to be used in comparison(letter weight may differ between - languages)
Examples:
- - - - - - - - - -
ExpressionResult
compare('ghi', 'ghi')0

- W3C Documentation reference: #func-compare -
-
-
- - - [2.0] fn:codepoints-to-string((int,int,...)) -
-
- Creates a string from a sequence of the Unicode Standard code points
- Arguments and return type: - - - - - - - - - -
TypeDescription
int*int sequence to be converted to string
Examples:
- - - - - - - - - -
ExpressionResult
codepoints-to-string((116, 101, 115, 116))'test'

- W3C Documentation reference: #func-codepoints-to-string -
-
-
- - - [2.0] fn:codepoint-equal(comp1,comp2) -
-
- Returns true if the value of comp1 is equal to the value of comp2, according to the - Unicode code point collation - (http://www.w3.org/2005/02/xpath-functions/collation/codepoint), otherwise it - returns false
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
intunicode codepoint
intunicode codepoint
Examples:
- - - - - - - + - - - - - - - -
ExpressionResult
codepoint-equal(111, 111)boolean("Release11") true
codepoint-equal(111, 112)false
codepoint-equal("111F", "111F")true

- W3C Documentation reference: #func-codepoint-equal -
-
-
- - - [2.0] fn:normalize-unicode() -
-
- NONE
-
- W3C Documentation reference: #func-normalize-unicode -
-
-
- - - [2.0] fn:upper-case(string) -
-
- Converts the string argument to upper-case
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringstring to be converted to upper case
Examples:
- - - - - - - - - -
ExpressionResult
upper-case('aabbCC')'AABBCC'

- W3C Documentation reference: #func-upper-case -
-
-
- - - [2.0] fn:lower-case(string) -
-
- Converts the string argument to lower-case
- Arguments and return type: - - - - - - - - - -
TypeDescription
stringstring to be converted to upper case
Examples:
- - - - - - - - - -
ExpressionResult
lower-case('aabbCC')'aabbcc'

- W3C Documentation reference: #func-lower-case -
-
-
- - - [2.0] fn:escape-uri(stringURI,esc-res) -
-
- https://www.w3.org/TR/xpath-functions/#func-escape-uri
-
- W3C Documentation reference: #func-escape-uri -
-
-
- - - [2.0] fn:tokenize(string,pattern) -
-
- https://www.w3.org/TR/xpath-functions/#func-tokenize
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringstring to be tokenized
stringstring to be used to split the first argument
Examples:
- - - - - - - - - -
ExpressionResult
tokenize("fox jumps over dog", "s+")("fox", "jumps", "over", "dog")

- W3C Documentation reference: #func-tokenize -
-
-
- - - [2.0] fn:matches(string,pattern) -
-
- Returns true if the string argument matches the pattern, otherwise, it returns false -
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
stringstring to search in
stringpattern to be found
Examples:
- - - - - - - - - - - +
ExpressionResult
matches("Xpath", "pat")true
matches("Xpath", "abc")boolean("") false

- W3C Documentation reference: #func-matches -
+ W3C Documentation reference: Boolean-Functions
-
- - - [2.0] fn:replace(string,pattern,replace) -
-
- Returns a string that is created by replacing the given pattern with the replace - argument
-
- W3C Documentation reference: #func-replace -
-
-
- - - [2.0] fn:ends-with(string1,string2) -
-
- Returns true if string1 ends with string2, otherwise it returns false
-
- W3C Documentation reference: #func-ends-with -
-
-
- - + + + +
-
-
- - - -
- - - [1.0] fn:number(object) +
+ + +
-
- The number function converts its argument to a number as follows: -
    -
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • -
  • boolean true is converted to 1; boolean false is converted to 0
  • -
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • -
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a number
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Numeric-Functions + + + fn:string(object) +
+ Returns the string representation of the object argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference: String-Functions
+ + +
- - - - [1.0] fn:sum(node-set) -
-
- The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
-
- Arguments and return type: - - - - - - - - - -
TypeDescription
node-setSet of nodes whose values will be summed.
- Examples:
- - - - - - - - - -
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

- W3C Documentation reference: Numeric-Functions -
-
- - - [1.0] fn:floor(number) -
-
- The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
-
- Arguments and return type: - - - - - - - - - -
TypeDescription
numberNumber to convert
- Examples:
- - - - - - - - - -
ExpressionResult
floor(2.55)2
- W3C Documentation reference: Numeric-Functions -
-
- - - [1.0] fn:ceiling(number) -
-
- The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
-
- Arguments and return type: - - - - - - - - - -
TypeDescription
numberNumber to convert
- Examples:
- - - - - - - - - -
ExpressionResult
ceiling(2.55)3
- W3C Documentation reference: Numeric-Functions -
-
- - [1.0] fn:round(number) -
-
- The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned.
- - NOTE: For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
- Arguments and return type: - - - - - - - - - -
TypeDescription
numberNumber to convert
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
round(2.55)3
round(2.35)2

- W3C Documentation reference: Numeric-Functions -
-
- -
-
-
- - - -
- +
+ + + +
+ + + fn:number(object) +
+ The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • +
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
boolean("Release11")true
boolean("")false

+ W3C Documentation reference: Numeric-Functions +
+ + +
+
+
- [2.0] Collections + +
+ + fn:avg((arg,arg,...))
-
Returns the average of the argument values
Arguments and return type: @@ -1583,441 +602,129 @@

W3C Documentation reference: #func-avg -
- - - - [2.0] fn:exactly-one(item,item,...) -
-
- Returns the argument if it contains exactly one item, otherwise it raises an error -
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequencesequence to check
Examples:
- - - - - - - - - - - - - -
ExpressionResult
exactly-one((1))1
exactly-one((1,1))fn:exactly-one called with a sequence containing zero or more than one - item.

- W3C Documentation reference: #func-exactly-one -
-
-
- - - [2.0] fn:zero-or-one(item,item,...) -
-
- Returns the argument if it contains zero or one items, otherwise it raises an error -
-
- W3C Documentation reference: #func-zero-or-one -
-
-
- - - [2.0] fn:index-of((item,item,...),searchitem) -
-
- Returns the positions within the sequence of items that are equal to the searchitem - argument
-
- W3C Documentation reference: #func-index-of -
-
-
- - - [2.0] fn:reverse((item,item,...)) -
-
- Returns the reversed order of the items specified
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence of elements to have its order reversed
Examples:
- - - - - - - - - - - - - -
ExpressionResult
reverse(("ab", "cd", "ef"))("ef", "cd", "ab")
reverse(("ab"))("ab")

- W3C Documentation reference: #func-reverse -
-
-
- - - [2.0] fn:one-or-more(item,item,...) -
-
- Returns the argument if it contains one or more items, otherwise it raises an error -
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequencesequence to check
Examples:
- - - - - - - - - - - - - -
ExpressionResult
one-or-more((1, 2, 3))1 2 3
one-or-more()An empty sequence is not allowed as the first argument of - fn:one-or-more()

- W3C Documentation reference: #func-one-or-more -
-
-
- - - [2.0] fn:distinct-values((item,item,...),collation) -
-
- Returns only distinct (different) values
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequencesequence to extract distinct values from
Examples:
- - - - - - - - - -
ExpressionResult
distinct-values((1, 2, 3, 1, 2))(1, 2, 3)

- W3C Documentation reference: #func-distinct-values -
-
-
- - - [2.0] fn:exists(item,item,...) -
-
- Returns true if the value of the arguments IS NOT an empty sequence, otherwise it - returns false
-
- W3C Documentation reference: #func-exists -
-
-
- - - [2.0] fn:subsequence((item,item,...),start,len) -
-
- Returns a sequence of items from the position specified by the start argument and - continuing for the number of items specified by the len argument. The first item is - located at position 1
-
- W3C Documentation reference: #func-subsequence -
-
-
- - - [2.0] fn:empty(item,item,...) -
-
- Returns true if the value of the arguments IS an empty sequence, otherwise it - returns false
-
- W3C Documentation reference: #func-empty -
-
-
- - - [2.0] fn:insert-before((item,item,...),pos,inserts) -
-
- Returns a new sequence constructed from the value of the item arguments
-
- W3C Documentation reference: #func-insert-before -
-
-
- - - [2.0] fn:remove((item,item,...),position) -
-
- Returns a new sequence constructed from the value of the item arguments
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
sequence*sequence to be modified
integerposition to insert element from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
remove(("a","b","c"), 1)b c
remove(("a","b","c"), 0)a b c

- W3C Documentation reference: #func-remove -
-
-
- - - [2.0] fn:unordered((item,item,...)) -
-
- Returns the items in an implementation dependent order
-
- W3C Documentation reference: #func-unordered -
-
-
- - - [2.0] fn:data(item.item,...) -
-
- Takes a sequence of items and returns a sequence of atomic values
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence to be split to atomic values
Examples:
- - - - - - - - - -
ExpressionResult
data((1,2,23, "test"))1 2 23 test

- W3C Documentation reference: #func-data -
-
-
- - - [2.0] fn:collection() -
-
- NONE
-
- W3C Documentation reference: #func-collection -
-
-
- - - [2.0] fn:collection(string) -
-
- NONE
-
- W3C Documentation reference: #func-collection -
-
-
- - - [2.0] fn:min((arg,arg,...)) -
-
- Returns the argument that is less than the others
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence to select minimum from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
min((1,2,3))1
min(('a', 'k'))'a'

- W3C Documentation reference: #func-min -
-
-
- - - [2.0] fn:max((arg,arg,...)) -
-
- Returns the argument that is greater than the others
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*sequence to select maximum from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
max((1,2,3))3
max(('a', 'k'))'k'

- W3C Documentation reference: #func-max -
-
-
- - - [2.0] fn:deep-equal(param1,param2,collation) -
-
- Returns true if param1 and param2 are deep-equal to each other, otherwise it returns - false
-
- W3C Documentation reference: #func-deep-equal -
-
-
- - +
-
-
- - - -
+
- [2.0] fn:adjust-date-to-timezone(date,timezone) + + +
+ + fn:adjust-date-to-timezone(date,timezone) +
+ If the timezone argument is empty, it returns a date without a timezone. Otherwise, + it returns a date with a timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
datedate to be adjusted
timezonetimezone to be imposed into date
Examples:
+ + + + + + + + + +
ExpressionResult
adjust-date-to-timezone(xs:date('2011-11-15'), + xs:dayTimeDuration("PT10H"))2011-11-15+10:00

+ W3C Documentation reference: #func-adjust-date-to-timezone +
+ + +
+
+
+ + + +
+ + fn:error() +
+ https://www.w3.org/TR/xpath-functions/#func-error
+
+ W3C Documentation reference: #func-error +
+ + +
+
+
+ + + +
+ + + fn:nilled(node) +
+ + Returns a Boolean value indicating whether the argument node is nilled
+
+ W3C Documentation reference: #func-nilled +
+ + +
+
+ + + +
+ + + +
+ + + fn:last()
-
- If the timezone argument is empty, it returns a date without a timezone. Otherwise, - it returns a date with a timezone
+ Returns the position of the last node in the context list
+
+ W3C Documentation reference: Node-Set-Functions +
+ + + +
+
+
+ + + +
+ + + fn:boolean(object) +
+ The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • +
+ Arguments and return type: @@ -2025,12 +732,8 @@ - - - - - - + +
Description
datedate to be adjusted
timezonetimezone to be imposed into dateobjectThe object to convert to a boolean
Examples:
@@ -2039,35 +742,91 @@ - - + + + + + +
Result
adjust-date-to-timezone(xs:date('2011-11-15'), - xs:dayTimeDuration("PT10H"))2011-11-15+10:00boolean("Release11")true
boolean("")false

- W3C Documentation reference: #func-adjust-date-to-timezone -
+ W3C Documentation reference: Boolean-Functions
+ + +
+
+
+ + - - - [2.0] fn:adjust-time-to-timezone(time,timezone) +
+ + + fn:string(object)
-
- If the timezone argument is empty, it returns a time without a timezone. Otherwise, - it returns a time with a timezone
-
- W3C Documentation reference: #func-adjust-time-to-timezone -
+ Returns the string representation of the object argument
+ Arguments and return type: + + + + + + + + + +
TypeDescription
stringThe object to convert to a string
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string((1<0))false
string(.11)0.11

+ W3C Documentation reference: String-Functions
+ + +
+
+
+ + - - - [2.0] fn:implicit-timezone() +
+ + + fn:number(object)
-
- Returns the value of the implicit timezone
+ The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • +
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
Examples:
@@ -2075,1305 +834,131 @@ - - + + + + + +
Result
implicit-timezone()PT1Hboolean("Release11")true
boolean("")false

- W3C Documentation reference: #func-implicit-timezone -
+ W3C Documentation reference: Numeric-Functions
- - - - [2.0] fn:dateTime(date,time) -
-
- Converts the arguments to a date and a time
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
datedate to be merged into dateTime
timetime to be merged into dateTime
Examples:
- - - - - - - - - -
ExpressionResult
dateTime(xs:date("2011-11-15"), xs:time("10:22:00"))2011-11-15T10:22:00

- W3C Documentation reference: #func-dateTime -
-
-
- - - [2.0] fn:current-time() -
-
- Returns the current time (with timezone)
- Examples:
- - - - - - - - - -
ExpressionResult
current-time()11:48:04.393361+01:00

- W3C Documentation reference: #func-current-time -
-
-
- - - [2.0] fn:timezone-from-time(time) -
-
- Returns the time zone component of the argument if any
- Arguments and return type: - - - - - - - - - -
TypeDescription
timetime to extract timezone infromation from
Examples:
- - - - - - - - - -
ExpressionResult
timezone-from-time(xs:time("10:22:00+10:00"))PT10H

- W3C Documentation reference: #func-timezone-from-time -
-
-
- - - [2.0] fn:hours-from-time(time) -
-
- Returns an integer that represents the hours component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
timetime to extact hours component from
Examples:
- - - - - - - - - -
ExpressionResult
hours-from-time(xs:time("10:22:00"))10

- W3C Documentation reference: #func-hours-from-time -
-
-
- - - [2.0] fn:minutes-from-time(time) -
-
- Returns an integer that represents the minutes component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
timetime to extract minutes component from
Examples:
- - - - - - - - - -
ExpressionResult
minutes-from-time(xs:time("10:22:00"))22

- W3C Documentation reference: #func-minutes-from-time -
-
-
- - - [2.0] fn:seconds-from-time(time) -
-
- Returns an integer that represents the seconds component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
timeTime to convert to seconds
Examples:
- - - - - - - - - -
ExpressionResult
seconds-from-time(xs:time("10:22:00"))0

- W3C Documentation reference: #func-seconds-from-time -
-
-
- - - [2.0] fn:years-from-duration(datetimedur) -
-
- Returns an integer that represents the years component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract years component from
Examples:
- - - - - - - - - -
ExpressionResult
years-from-duration(xs:duration("P5Y2DT10H59M"))5

- W3C Documentation reference: #func-years-from-duration -
-
-
- - - [2.0] fn:months-from-duration(datetimedur) -
-
- Returns an integer that represents the months component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract months component from
Examples:
- - - - - - - - - -
ExpressionResult
months-from-duration(xs:duration("P5Y10M2DT10H59M"))10

- W3C Documentation reference: #func-years-from-duration -
-
-
- - - [2.0] fn:days-from-duration(datetimedur) -
-
- Returns an integer that represents the days component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract days component from
Examples:
- - - - - - - - - -
ExpressionResult
days-from-duration(xs:duration("P5Y2DT10H59M"))2

- W3C Documentation reference: #func-days-from-duration -
-
-
- - - [2.0] fn:hours-from-duration(datetimedur) -
-
- Returns an integer that represents the hours component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract hours component from
Examples:
- - - - - - - - - -
ExpressionResult
hours-from-duration(xs:duration("P5Y2DT10H59M"))10

- W3C Documentation reference: #func-hours-from-duration -
-
-
- - - [2.0] fn:minutes-from-duration(datetimedur) -
-
- Returns an integer that represents the minutes component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract minute component from
Examples:
- - - - - - - - - -
ExpressionResult
years-from-duration(xs:duration("P5Y2DT10H59M"))59

- W3C Documentation reference: #func-minutes-from-duration -
-
-
- - - [2.0] fn:seconds-from-duration(datetimedur) -
-
- Returns a decimal that represents the seconds component in the canonical lexical - representation of the value of the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedurdatetimedur to extract seconds component from
Examples:
- - - - - - - - - -
ExpressionResult
days-from-duration(xs:duration("P5Y2DT10H59M40S"))40

- W3C Documentation reference: #func-seconds-from-duration -
-
-
- - - [2.0] fn:current-date() -
-
- Returns the current date (with timezone)
-
- W3C Documentation reference: #func-current-date -
-
-
- - - [2.0] fn:timezone-from-date(date) -
-
- Returns the time zone component of the argument if any
- Arguments and return type: - - - - - - - - - -
TypeDescription
datedate to extract timezone information from
Examples:
- - - - - - - - - - - - - -
ExpressionResult
timezone-from-date(xs:date("2011-11-15+11:00"))PT1H
timezone-from-date(xs:date("2011-11-15+11:00"))PT11H

- W3C Documentation reference: #func-timezone-from-date -
-
-
- - - [2.0] fn:year-from-date(date) -
-
- Returns an integer that represents the year in the localized value of the argument -
- Arguments and return type: - - - - - - - - - -
TypeDescription
datedate to extract years component from
Examples:
- - - - - - - - - -
ExpressionResult
year-from-date(xs:date("2011-11-15"))2011

- W3C Documentation reference: #func-year-from-date -
-
-
- - - [2.0] fn:month-from-date(date) -
-
- Returns an integer that represents the month in the localized value of the argument -
- Arguments and return type: - - - - - - - - - -
TypeDescription
dateDate to extrat the month from
Examples:
- - - - - - - - - -
ExpressionResult
month-from-date(xs:date("2011-11-15"))11

- W3C Documentation reference: #func-month-from-date -
-
-
- - - [2.0] fn:day-from-date(date) -
-
- Returns an integer that represents the day in the localized value of the argument -
- Arguments and return type: - - - - - - - - - -
TypeDescription
datedate to extact day component from
Examples:
- - - - - - - - - -
ExpressionResult
day-from-date(xs:date("2011-04-23"))23

- W3C Documentation reference: #func-day-from-date -
-
-
- - - [2.0] fn:current-dateTime() -
-
- Returns the current dateTime (with timezone)
- Examples:
- - - - - - - - - -
ExpressionResult
current-dateTime()2021-03-24T18:15:09.808+01:00

- W3C Documentation reference: #func-current-dateTime -
-
-
- - - [2.0] fn:timezone-from-dateTime(datetime) -
-
- Returns the time zone component of the argument if any
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimeDateTime to extract fimezone information from
Examples:
- - - - - - - - - -
ExpressionResult
timezone-from-dateTime(xs:dateTime("2021-01-15T12:10:00-03:00"))-PT3H

- W3C Documentation reference: #func-timezone-from-dateTime -
-
-
- - - [2.0] fn:year-from-dateTime(datetime) -
-
- Returns an integer that represents the year component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract years component from
Examples:
- - - - - - - - - -
ExpressionResult
year-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))2011

- W3C Documentation reference: #func-year-from-dateTime -
-
-
- - - [2.0] fn:month-from-dateTime(datetime) -
-
- Returns an integer that represents the month component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract month component from
Examples:
- - - - - - - - - -
ExpressionResult
month-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))11

- W3C Documentation reference: #func-month-from-dateTime -
-
-
- - - [2.0] fn:day-from-dateTime(datetime) -
-
- Returns an integer that represents the day component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract day component from
Examples:
- - - - - - - - - -
ExpressionResult
day-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))15

- W3C Documentation reference: #func-day-from-dateTime -
-
-
- - - [2.0] fn:hours-from-dateTime(datetime) -
-
- Returns an integer that represents the hours component in the localized value of the - argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract hours component from
Examples:
- - - - - - - - - -
ExpressionResult
hours-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))12

- W3C Documentation reference: #func-hours-from-dateTime -
-
-
- - - [2.0] fn:minutes-from-dateTime(datetime) -
-
- Returns an integer that represents the minutes component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract minutes component from
Examples:
- - - - - - - - - -
ExpressionResult
minutes-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))30

- W3C Documentation reference: #func-minutes-from-dateTime -
-
-
- - - [2.0] fn:seconds-from-dateTime(datetime) -
-
- Returns a decimal that represents the seconds component in the localized value of - the argument
- Arguments and return type: - - - - - - - - - -
TypeDescription
datetimedatetime to extract seconds component from
Examples:
- - - - - - - - - -
ExpressionResult
seconds-from-dateTime(xs:dateTime("2011-11-15T12:30:00-04:10"))0

- W3C Documentation reference: #func-seconds-from-dateTime -
-
-
- - - [2.0] fn:adjust-dateTime-to-timezone(datetime,timezone) -
-
- If the timezone argument is empty, it returns a dateTime without a timezone. - Otherwise, it returns a dateTime with a timezone
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
datetimedatetime to be adjusted
timezonetimezone to be used in provided date
Examples:
- - - - - - - - - -
ExpressionResult
adjust-dateTime-to-timezone(xs:dateTime('2011-11-15T12:30:00-04:10'), - xs:dayTimeDuration("PT10H"))2011-11-16T02:40:00+10:00

- W3C Documentation reference: #func-adjust-dateTime-to-timezone -
-
-
- - + + +
-
-
- - - -
- - - [2.0] fn:error() -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error -
-
+
+ + - - - [2.0] fn:error(error) -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error +
+ + + fn:adjust-date-to-timezone(date,timezone) +
+ If the timezone argument is empty, it returns a date without a timezone. Otherwise, + it returns a date with a timezone
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
datedate to be adjusted
timezonetimezone to be imposed into date
Examples:
+ + + + + + + + + +
ExpressionResult
adjust-date-to-timezone(xs:date('2011-11-15'), + xs:dayTimeDuration("PT10H"))2011-11-15+10:00

+ W3C Documentation reference: #func-adjust-date-to-timezone
-
- - - - [2.0] fn:error(error,description) -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error -
-
-
- - - [2.0] fn:error(error,description,error-object) -
-
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error -
-
-
- - - [2.0] fn:trace(value,label) -
-
- Used to debug queries
-
- W3C Documentation reference: #func-trace -
-
-
- - + + + + + +
-
-
- - - -
- - - [2.0] fn:nilled(node) -
-
- Returns a Boolean value indicating whether the argument node is nilled
-
- W3C Documentation reference: #func-nilled -
-
+
+ + - - - [2.0] fn:namespace-uri-from-QName() -
-
- NONE
-
- W3C Documentation reference: #func-namespace-uri-from-QName +
+ + + fn:error() +
+ https://www.w3.org/TR/xpath-functions/#func-error
+
+ W3C Documentation reference: #func-error
-
- - - - [2.0] fn:base-uri() -
-
- Returns the value of the base-uri property of the current or specified node
-
- W3C Documentation reference: #func-base-uri -
-
-
- - - [2.0] fn:base-uri(node) -
-
- Returns the value of the base-uri property of the current or specified node
-
- W3C Documentation reference: #func-base-uri -
-
-
- - - [2.0] fn:static-base-uri() -
-
- Returns the value of the base-uri
- Examples:
- - - - - - - - - -
ExpressionResult
default-collation()http://www.w3.org/2005/xpath-functions/collation/codepoint

- W3C Documentation reference: #func-static-base-uri -
-
-
- - - [2.0] fn:doc-available(URI) -
-
- Returns true if the doc() function returns a document node, otherwise it returns - false
-
- W3C Documentation reference: #func-doc-available -
-
-
- - - [2.0] fn:resolve-QName() -
-
- NONE
-
- W3C Documentation reference: #func-resolve-QName -
-
-
- - - [2.0] fn:node-name(node) -
-
- Returns the node-name of the argument node
-
- W3C Documentation reference: #func-node-name -
-
-
- - - [2.0] fn:default-collation() -
-
- Returns the value of the default collation
-
- W3C Documentation reference: #func-default-collation -
-
-
- - - [2.0] fn:idref((string,string,...),node) -
-
- Returns a sequence of element or attribute nodes that have an IDREF value equal to - the value of one or more of the values specified in the string argument
-
- W3C Documentation reference: #func-idref -
-
-
- - - [2.0] fn:document-uri(node) -
-
- Returns the value of the document-uri property for the specified node
-
- W3C Documentation reference: #func-document-uri -
-
-
- - - [2.0] fn:local-name-from-QName() -
-
- NONE
-
- W3C Documentation reference: #func-local-name-from-QName -
-
-
- - - [2.0] fn:in-scope-prefixes() -
-
- NONE
-
- W3C Documentation reference: #func-in-scope-prefixes -
-
-
- - - [2.0] fn:namespace-uri-for-prefix() -
-
- NONE
-
- W3C Documentation reference: #func-namespace-uri-for-prefix -
-
-
- - - [2.0] fn:QName() -
-
- NONE
-
- W3C Documentation reference: #func-QName -
-
-
- - - [2.0] fn:root() fn:root(node) -
-
- Returns the root of the tree to which the current node or the specified belongs. - This will usually be a document node
-
- W3C Documentation reference: #func-root -
-
-
- - - [2.0] fn:doc(URI) -
-
- NONE
-
- W3C Documentation reference: #func-doc -
-
-
- - - [2.0] fn:resolve-uri(relative,base) -
-
- NONE
-
- W3C Documentation reference: #func-resolve-uri -
-
-
- - - [3.0] fn:available-environment-variables() -
-
- Returns a list of environment variable names
-
- W3C Documentation reference: #func-available-environment-variables -
-
-
- - - [3.0] fn:doc-available(uri) -
-
- The function returns true the function call fn:doc(uri) would return a document node -
-
- W3C Documentation reference: #func-doc-available -
-
-
- - - [3.0] fn:element-with-id() -
-
- https://www.w3.org/TR/xpath-functions-31/#func-element-with-id
-
- W3C Documentation reference: #func-element-with-id -
-
-
- - - [3.0] fn:encode-for-uri(uri-part) -
-
- Encodes reserved characters in a string that is intended to be used in the path - segment of a URI.
-
- W3C Documentation reference: #func-encode-for-uri -
-
-
- - - [3.0] fn:environment-variable(name) -
-
- Returns the value of a system environment variable, if it exists
-
- W3C Documentation reference: #func-environment-variable -
-
-
- - - [3.0] fn:escape-html-uri(uri) -
-
- Escapes a URI in the same way that HTML user agents handle attribute values expected - to contain URIs
-
- W3C Documentation reference: #func-escape-html-uri -
-
-
- - - [3.0] fn:iri-to-uri(iri) -
-
- Converts a string containing an IRI into a URI
-
- W3C Documentation reference: #func-iri-to-uri -
-
-
- - + + + + + +
-
- - -
- - - -
- - [3.0] fn:for-each(sequence*, function) -
-
- Applies function item to every element in sequence
-
- W3C Documentation reference: #func-for-each -
-
+
+ + - - - [3.0] fn:for-each-pair(sequence*, sequence*, function) -
-
- Applies the function to consecutive pairs of elements taken from sequences
-
- W3C Documentation reference: #func-for-each-pair +
+ + + fn:nilled(node) +
+ Returns a Boolean value indicating whether the argument node is nilled
+
+ W3C Documentation reference: #func-nilled +
-
- - - - [3.0] fn:fold-left(sequence*, baseValue, function) -
-
- Applies function item to every element in sequence, accumulating value
-
- W3C Documentation reference: #func-fold-left -
-
-
- - - [3.0] fn:fold-right() -
-
- Applies function item to every element in sequence, accumulating value
-
- W3C Documentation reference: #func-fold-right -
-
-
- - - [3.0] fn:filter(sequence*, function) -
-
- Returns those items from the sequence for which the supplied function returns true
-
- W3C Documentation reference: #func-filter -
-
-
+ + + + + +
-
+ +
+ + + +
+ + fn:for-each(sequence*, function) +
+ Applies function item to every element in sequence
+
+ W3C Documentation reference: #func-for-each +
+ + + +
+
+
@@ -3414,24 +999,27 @@ if (filter == "collapse3.0") { - document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0, 2.0 & 3.0 functions"; - showList(document.getElementsByName("collapse20")); + document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.0 functions"; + hideList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); showList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); } else if (filter == "collapse3.1") { - document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0, 2.0, 3.0 & 3.1 functions"; - showList(document.getElementsByName("collapse20")); - showList(document.getElementsByName("collapse30")); + document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.1 functions"; + hideList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); + hideList(document.getElementsByName("collapse30")); showList(document.getElementsByName("collapse31")); - - } else if (filter == "collapse2.0") { - document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 & 2.0 functions"; + } else if (filter == "collapse2.0"){ + document.getElementById("tooltipFunctionInfo").innerText = "XPath 2.0 functions"; + hideList(document.getElementsByName("collapse10")); showList(document.getElementsByName("collapse20")); hideList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); } else { document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 functions"; + showList(document.getElementsByName("collapse10")); hideList(document.getElementsByName("collapse20")); hideList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); From a773022f0d69a3da55750c260c8b94f0eccecef3 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 6 Apr 2023 11:53:53 +0200 Subject: [PATCH 12/59] Added tooltips for XPath 2.0 (#134) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/134 --- Frontend/tools/xpath.html | 4365 +++++++++++++++++++++++++++++++++++-- 1 file changed, 4179 insertions(+), 186 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index a7e30d1..065d4a9 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -127,10 +127,10 @@ fn:count(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:count()
Returns the number of nodes in the node-set
- Arguments and return type: + Arguments: @@ -161,7 +161,7 @@ fn:id(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:id()
Returns the element specified by it's unique id, requires DTD

@@ -171,10 +171,10 @@ fn:local-name(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:local-name()
Returns the local-name for the first node in the node-set
- Arguments and return type: + Arguments:
Type
@@ -215,10 +215,10 @@ fn:namespace-uri(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:namespace-uri()
Returns the namespace-uri for the first node in the node-set
- Arguments and return type: + Arguments:
Type
@@ -255,17 +255,17 @@ fn:name(node-set) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:name()
Returns the name for the first node in the node-set
- Arguments and return type: + Arguments:
Type
- +
Type Description
node-setnode-set (Optional) Extract first node and return QName
Examples:
@@ -285,27 +285,6 @@
W3C Documentation reference: Node-Set-Functions
- - - - fn:name() -
- Returns the name for the context node
- Examples:
- - - - - - - - - -
ExpressionResult
current context nodeExtract first node and return QName

- W3C Documentation reference: Node-Set-Functions -
-
@@ -317,7 +296,7 @@ fn:boolean(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:boolean()
The boolean function converts its argument to a boolean as follows:
    @@ -327,7 +306,7 @@
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
- Arguments and return type: + Arguments: @@ -384,10 +363,10 @@ fn:lang(string) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:lang()
The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
- Arguments and return type: + Arguments:
Type
@@ -416,14 +395,462 @@ fn:last() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:name()
- Returns the position of the last node in the context list
-
- W3C Documentation reference: Node-Set-Functions + Returns the name of a node, as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName.
+ + If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ + If the argument is supplied and is the empty sequence, the function returns the zero-length string.
+ + If the target node has no name (that is, if it is a document node, a comment, a text node, or a namespace binding having no name), the function returns the zero-length string.
+ + Otherwise, the value returned is fn:string(fn:node-name($arg)).
+
+ Arguments: +
Type
+ + + + + + + + +
TypeDescription
node?Node to display name.
+ Return type: xs:string

+ + Examples: + + + + + + + + + +
QueryResult
name(/l:library)l:library

+ W3C Documentation reference +
+ + fn:local-name() +
+ Returns the local part of the name of $arg as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName.
+ + If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ + If the argument is supplied and is the empty sequence, the function returns the zero-length string.
+ + If the target node has no name (that is, if it is a document node, a comment, or a text node), the function returns the zero-length string.
+ + Otherwise, the value returned will be the local part of the expanded-QName of the target node (as determined by the dm:node-name accessor in Section 5.11 node-name Accessor). This will be an xs:string whose lexical form is an xs:NCName.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node to display local-name.
+ Return type: xs:string

+ Examples: + + + + + + + + + +
QueryResult
name(/l:library)library

+ + W3C Documentation reference +
+ + fn:nilled() +
+ Returns an xs:boolean indicating whether the argument node is "nilled". If the argument is not an element node, returns the empty sequence. If the argument is the empty sequence, returns the empty sequence.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node to test.
+ Return type: xs:boolean?

+ Examples: + + + + + + + + + +
QueryResult
nilled(/l:library)false

+ + W3C Documentation reference +
+ + fn:base-uri() +
+ Returns the value of the base-uri URI property for $arg as defined by the accessor function dm:base-uri() for that kind of node in Section 5.2 base-uri AccessorDM. If $arg is not specified, the behavior is identical to calling the function with the context item (.) as argument. The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + Document, element and processing-instruction nodes have a base-uri property which may be empty. The base-uri property of all other node types is the empty sequence. The value of the base-uri property is returned if it exists and is not empty. Otherwise, if the node has a parent, the value of dm:base-uri() applied to its parent is returned, recursively. If the node does not have a parent, or if the recursive ascent up the ancestor chain encounters a node whose base-uri property is empty and it does not have a parent, the empty sequence is returned.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node to find base URI of.
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + +
QueryResult
base-uri(/l:library/l:libraryName)<empty sequence>

+ + W3C Documentation reference +
+ + fn:document-uri() +
+ Returns the value of the document-uri property for $arg as defined by the dm:document-uri accessor function defined in Section 6.1.2 AccessorsDM.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + Returns the empty sequence if the node is not a document node. Otherwise, returns the value of the dm:document-uri accessor of the document node.
+ + In the case of a document node $D returned by the fn:doc function, or a document node at the root of a tree containing a node returned by the fn:collection function, it will always be true that either fn:document-uri($D) returns the empty sequence, or that the following expression is true: fn:doc(fn:document-uri($D)) is $D. It is implementation-defined whether this guarantee also holds for document nodes obtained by other means, for example a document node passed as the initial context node of a query or transformation.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
node?Node which document-uri value needs to be returned.
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + + + + + + + + + +
QueryResult
document-uri(/l:library/l:libraryName)<empty sequence>
document-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the document URI of the first fiction:book element is "http://example.com/library.xml")
document-uri(/library)http://example.com/library.xml (assuming the document URI of the library element is "http://example.com/library.xml")

+ + W3C Documentation reference +
+ + fn:lang() +
+ This function tests whether the language of $node, or the context item if the second argument is omitted, as specified by xml:lang attributes is the same as, or is a sublanguage of, the language specified by $testlang. The behavior of the function if the second argument is omitted is exactly the same as if the context item (.) had been passed as the second argument. The language of the argument node, or the context item if the second argument is omitted, is determined by the value of the xml:lang attribute on the node, or, if the node has no such attribute, by the value of the xml:lang attribute on the nearest ancestor of the node that has an xml:lang attribute. If there is no such ancestor, then the function returns false

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$testlang
node()$node (Optional)
+ Return type: xs:boolean?

+ Examples: Look W3C documentation below. +
+ + W3C Documentation reference +
+ + fn:root() +
+ Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + If $arg is a document node, $arg is returned.
+ + If the function is called without an argument, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]; if the context item is not a node [err:XPTY0004].

+ + Arguments: + + + + + + + + + +
TypeDescription
node()$arg (Optional)
+ Return type: node()?

+ Examples: + + + + + + + + + +
QueryResult
root()<l:library>[...]</l:library>

+ + W3C Documentation reference +
+ + fn:count() +
+ Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:integer

+ Examples: + + + + + + + + + + + + + +
QueryResult
count(/l:library/l:readerList/p:person)2
count(/l:library/l:writers)0

+ + W3C Documentation reference +
+ + + fn:avg() +
+ Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
+ Return type: xs:anyAtomicType

+ Examples: + + + + + + + + + +
QueryResult
avg(/l:library/l:readerList/p:person/p:readerID)6222

+ + W3C Documentation reference +
+ + + fn:max() +
+ Selects an item from the input sequence $arg whose value is greater than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is ·implementation dependent·.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:string$collation (Optional)
+ Return type: xs:anyAtomicType?

+ Examples: + + + + + + + + + + + + + +
QueryResult
max((3,4,5))5
max((5, 5.0e0))5.0e0

+ + W3C Documentation reference +
+ + fn:min() +
+ Selects an item from the input sequence $arg whose value is less than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is ·implementation dependent·.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:string$collation (Optional)
+ Return type: xs:anyAtomicType?

+ Examples: + + + + + + + + + + + + + +
QueryResult
min((3,4,5))3
min((5, 5.0e0))5.0e0

+ + W3C Documentation reference +
+ + + fn:sum() +
+ Returns a value obtained by adding together the values in $arg. If $zero is not specified, then the value returned for an empty sequence is the xs:integer value 0. If $zero is specified, then the value returned for an empty sequence is $zero.
+ + Any values of type xs:untypedAtomic in $arg are cast to xs:double. The items in the resulting sequence may be reordered in an arbitrary order. The resulting sequence is referred to below as the converted sequence.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:anyAtomicType?$zero (Optional)
+ Return type: xs:anyAtomicType?

+ Examples: + + + + + + + + + +
QueryResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

+ + W3C Documentation reference
- -
@@ -435,44 +862,134 @@ fn:boolean(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:boolean()
- The boolean function converts its argument to a boolean as follows: -
    -
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • -
  • a node-set is true if and only if it is non-empty
  • -
  • a string is true if and only if its length is non-zero
  • -
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a boolean
Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Boolean-Functions + Computes the effective boolean value of the sequence $arg. See Section 2.4.3 Effective Boolean ValueXP
+ + If $arg is the empty sequence, fn:boolean returns false.
+ + If $arg is a sequence whose first item is a node, fn:boolean returns true.
+ + If $arg is a singleton value of type xs:boolean or a derived from xs:boolean, fn:boolean returns $arg.
+ + If $arg is a singleton value of type xs:string or a type derived from xs:string, xs:anyURI or a type derived from xs:anyURI or xs:untypedAtomic, fn:boolean returns false if the operand value has zero length; otherwise it returns true.
+ + If $arg is a singleton value of any numeric type or a type derived from a numeric type, fn:boolean returns false if the operand value is NaN or is numerically equal to zero; otherwise it returns true. + + In all other cases, fn:boolean raises a type error [err:FORG0006].
+ + The static semantics of this function are described in Section 7.2.4 The fn:boolean and fn:not functionsFS.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:boolean?

+ Examples: + + + + + + + + + + + + + + + + + +
QueryResult
boolean("/l:library")true
boolean(0)false
boolean(())false

+ + W3C Documentation reference
+ + fn:true() +
+ Returns the xs:boolean value true. Equivalent to xs:boolean("1").

+ + Return type: xs:boolean

+ Examples:
+ + + + + + + + + +
ExpressionResult
true()true

+ W3C Documentation reference +
+ + fn:false() +
+ Returns the xs:boolean value false. Equivalent to xs:boolean("0").

+ + Return type: xs:boolean

+ Examples:
+ + + + + + + + + +
ExpressionResult
false()false

+ W3C Documentation reference +
+ + fn:not() +
+ $arg is first reduced to an effective boolean value by applying the fn:boolean() function. Returns true if the effective boolean value is false, and false if the effective boolean value is true.

+ + Arguments and return type: + + + + + + + + + +
TypeDescription
item$arg
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
not(false())true
not(true())false

+ W3C Documentation reference +
@@ -483,11 +1000,18 @@
- fn:string(object)
- Returns the string representation of the object argument
+ Returns the value of $arg represented as a xs:string. If no argument is supplied, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + If the context item is undefined, error [err:XPDY0002]XP is raised.
+ + If $arg is the empty sequence, the zero-length string is returned.
+ + If $arg is a node, the function returns the string-value of the node, as obtained using the dm:string-value accessor defined in the Section 5.13 string-value AccessorDM.
+ + If $arg is an atomic value, then the function returns the same string as is returned by the expression " $arg cast as xs:string " (see 17 Casting).
Arguments and return type: @@ -498,7 +1022,9 @@ -
string The object to convert to a string
Examples:
+ + Return type: xs:string

+ Examples:
@@ -513,11 +1039,1105 @@
Expression0.11

- W3C Documentation reference: String-Functions + W3C Documentation reference
+ fn:codepoints-to-string() +
+ Creates an xs:string from a sequence of The Unicode Standard code points. Returns the zero-length string if $arg is the empty sequence. If any of the code points in $arg is not a legal XML character, an error is raised [err:FOCH0001].
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:integer*$arg
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
codepoints-to-string((2309, 2358, 2378, 2325))अशॊक
codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41))( ͡° ͜ʖ ͡°)

+ W3C Documentation reference +
+ + fn:string-to-codepoints() +
+ Returns the sequence of The Unicode Standard code points that constitute an xs:string. If $arg is a zero-length string or the empty sequence, the empty sequence is returned.
+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string*$arg
+ Return type: xs:integer*

+ Examples:
+ + + + + + + + + +
ExpressionResult
string-to-codepoints("Thérèse")(84, 104, 233, 114, 232, 115, 101)

+ W3C Documentation reference +
+ + fn:compare() +
+ Returns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively less than, equal to, or greater than the value of $comparand2, according to the rules of the collation that is used.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations.
+ + If either argument is the empty sequence, the result is the empty sequence.
+ + This function, invoked with the first signature, backs up the "eq", "ne", "gt", "lt", "le" and "ge" operators on string values.
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$comparand1
xs:string?$comparand2
xs:string$collation (Optional)
+ Return type: xs:integer*

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
compare('abc', 'abc')0
compare('abc', 'acc')-1
compare('abc', 'acc')1

+ W3C Documentation reference +
+ + fn:codepoint-equal() +
+ Returns true or false depending on whether the value of $comparand1 is equal to the value of $comparand2, according to the Unicode code point collation.
+ + If either argument is the empty sequence, the result is the empty sequence.
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?$comparand1
xs:string?$comparand2
+ Return type: xs:boolean?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
codepoint-equal("asdf", "asdf")true
codepoint-equal("asdf", "asdf ")false

+ W3C Documentation reference +
+ + fn:concat() +
+ Accepts two or more xs:anyAtomicType arguments and casts them to xs:string. Returns the xs:string that is the concatenation of the values of its arguments after conversion. If any of the arguments is the empty sequence, the argument is treated as the zero-length string.
+ + The fn:concat function is specified to allow two or more arguments, which are concatenated together. This is the only function specified in this document that allows a variable number of arguments. This capability is retained for compatibility with [XML Path Language (XPath) Version 1.0].
+ Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType?$arg1
xs:anyAtomicType?$arg2
xs:anyAtomicType?$arg... (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
concat('un', 'grateful')ungrateful
concat('Thy ', (), 'old ', "groans", "", ' ring', ' yet', ' in', ' my', ' ancient',' ears.')Thy old groans ring yet in my ancient ears.
fn:concat('Ciao!',())Ciao!

+ W3C Documentation reference +
+ + fn:string-join() +
+ Returns a xs:string created by concatenating the members of the $arg1 sequence using $arg2 as a separator. If the value of $arg2 is the zero-length string, then the members of $arg1 are concatenated without a separator.
+ + If the value of $arg1 is the empty sequence, the zero-length string is returned.
+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string*$arg1
xs:string$arg2
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string-join(('Now', 'is', 'the', 'time', '...'), ' ')Now is the time ...
string-join(('Blow, ', 'blow, ', 'thou ', 'winter ', 'wind!'), '')Blow, blow, thou winter wind!

+ W3C Documentation reference +
- + fn:substring() +
+ Returns the portion of the value of $sourceString beginning at the position indicated by the value of $startingLoc and continuing for the number of characters indicated by the value of $length. The characters returned do not extend beyond $sourceString. If $startingLoc is zero or negative, only those characters in positions greater than zero are returned.
+ More specifically, the three argument version of the function returns the characters in $sourceString whose position $p obeys:
+ fn:round($startingLoc) <= $p < fn:round($startingLoc) + fn:round($length)
+ The two argument version of the function assumes that $length is infinite and returns the characters in $sourceString whose position $p obeys:
+ fn:round($startingLoc) <= $p < fn:round(INF)
+ In the above computations, the rules for op:numeric-less-than() and op:numeric-greater-than() apply.
+ If the value of $sourceString is the empty sequence, the zero-length string is returned.
+ + Note:
+ The first character of a string is located at position 1, not position 0.
+ + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$sourceString
xs:double$startingLoc
xs:double$length (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
substring("motor car", 6)" car"
substring("metadata", 4, 3)ada

+ W3C Documentation reference +
+ + fn:string-length() +
+ Returns an xs:integer equal to the length in characters of the value of $arg.
+ + If the value of $arg is the empty sequence, the xs:integer 0 is returned.
+ + If no argument is supplied, $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: xs:integer

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
string-length("Harp not on that string, madam; that is past.")45
string-length(())0

+ W3C Documentation reference +
+ + fn:normalize-space() +
+ Returns the value of $arg with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of one or more than one whitespace character with a single space, #x20.
+ + If the value of $arg is the empty sequence, returns the zero-length string.
+ + If no argument is supplied, then $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
normalize-space(" The wealthy curled darlings of our nation. ")The wealthy curled darlings of our nation.
normalize-space(())""

+ W3C Documentation reference +
+ + fn:normalize-unicode() +
+ Returns the value of $arg normalized according to the normalization criteria for a normalization form identified by the value of $normalizationForm. The effective value of the $normalizationForm is computed by removing leading and trailing blanks, if present, and converting to upper case.
+ + If the value of $arg is the empty sequence, returns the zero-length string.
+ + Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg
xs:string$normalizationForm (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
normalize-unicode("test ")test

+ W3C Documentation reference +
+ + fn:upper-case() +
+ Returns the value of $arg after translating every character to its upper-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every lower-case character that does not have an upper-case correspondent, as well as every upper-case character, is included in the returned value in its original form.
+ + If the value of $arg is the empty sequence, the zero-length string is returned.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
upper-case("abCd0")ABCD0

+ W3C Documentation reference +
+ + fn:lower-case() +
+ Returns the value of $arg after translating every character to its lower-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every upper-case character that does not have a lower-case correspondent, as well as every lower-case character, is included in the returned value in its original form.
+ + If the value of $arg is the empty sequence, the zero-length string is returned.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$arg
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
lower-case("abCd0")abcd0

+ W3C Documentation reference +
+ + fn:translate() +
+ Returns the value of $arg modified so that every character in the value of $arg that occurs at some position N in the value of $mapString has been replaced by the character that occurs at position N in the value of $transString.
+ + If the value of $arg is the empty sequence, the zero-length string is returned.
+ + Every character in the value of $arg that does not appear in the value of $mapString is unchanged.
+ + Every character in the value of $arg that appears at some position M in the value of $mapString, where the value of $transString is less than M characters in length, is omitted from the returned value. If $mapString is the zero-length string $arg is returned.
+ + If a character occurs more than once in $mapString, then the first occurrence determines the replacement character. If $transString is longer than $mapString, the excess characters are ignored.
+ + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg
xs:string$mapString
xs:string$mapString
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
translate("bar","abc","ABC")BAr
translate("--aaa--","abc-","ABC")AAA
translate("abcdabc", "abc", "AB")ABdAB

+ W3C Documentation reference +
+ + fn:encode-for-uri() +
+ This function encodes reserved characters in an xs:string that is intended to be used in the path segment of a URI. It is invertible but not idempotent. This function applies the URI escaping rules defined in section 2 of [RFC 3986] to the xs:string supplied as $uri-part. The effect of the function is to escape reserved characters. Each such character in the string is replaced with its percent-encoded form as described in [RFC 3986].
+ + If $uri-part is the empty sequence, returns the zero-length string.
+ + All characters are escaped except those identified as "unreserved" by [RFC 3986], that is the upper- and lower-case letters A-Z, the digits 0-9, HYPHEN-MINUS ("-"), LOW LINE ("_"), FULL STOP ".", and TILDE "~".
+ + Note that this function escapes URI delimiters and therefore cannot be used indiscriminately to encode "invalid" characters in a path segment.
+ + Since [RFC 3986] recommends that, for consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings, this function must always generate hexadecimal values using the upper-case letters A-F.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$uri-part
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
encode-for-uri("https://www.google.com")"https%3A%2F%2Fwww.
google.com"
concat("http://www.example.com/", encode-for-uri("~bébé"))http://www.example.com/
~b%C3%A9b%C3%A9
concat("http://www.example.com/", encode-for-uri("100% organic"))http://www.example.com/
100%25%20organic

+ W3C Documentation reference +
+ + fn:iri-to-uri() +
+ This function converts an xs:string containing an IRI into a URI according to the rules spelled out in Section 3.1 of [RFC 3987]. It is idempotent but not invertible.
+ + If $iri contains a character that is invalid in an IRI, such as the space character (see note below), the invalid character is replaced by its percent-encoded form as described in [RFC 3986] before the conversion is performed.
+ + If $iri is the empty sequence, returns the zero-length string.
+ + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$iri
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
iri-to-uri ("http://www.example.com/00/Weather/CA/Los%20Angeles#ocean")"http://www.example.com/00/
Weather/CA/Los%20Angeles#ocean"
iri-to-uri ("http://www.example.com/~bébé")http://www.example.com/
~b%C3%A9b%C3%A9

+ W3C Documentation reference +
+ + fn:escape-html-uri() +
+ This function escapes all characters except printable characters of the US-ASCII coded character set, specifically the octets ranging from 32 to 126 (decimal). The effect of the function is to escape a URI in the manner html user agents handle attribute values that expect URIs. Each character in $uri to be escaped is replaced by an escape sequence, which is formed by encoding the character as a sequence of octets in UTF-8, and then representing each of these octets in the form %HH, where HH is the hexadecimal representation of the octet. This function must always generate hexadecimal values using the upper-case letters A-F.
+ If $uri is the empty sequence, returns the zero-length string. + +

Note:

+ The behavior of this function corresponds to the recommended handling of non-ASCII characters in URI attribute values as described in [HTML 4.0] Appendix B.2.1.

+ + + Arguments and return type: + + + + + + + + + +
TypeDescription
xs:string?$uri
+ Return type: xs:string

+ Examples:
+ + + + + + + + + +
ExpressionResult
escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean")http://www.example.com/00/Weather/CA/Los Angeles#ocean

+ W3C Documentation reference +
+ + fn:contains() +
+ Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of $arg2, according to the collation that is used. + + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns true.
+ + If the value of $arg1 is the zero-length string, the function returns false.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
contains( "tattoo", "tat")true
contains( "tattoo", "ttt")false
contains ( "", ())true

+ W3C Documentation reference +
+ + fn:starts-with() +
+ Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used. + + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
starts-with( "tattoo", "tat")true
starts-with( "tattoo", "ttt")false
starts-with ( "", ())true

+ W3C Documentation reference +
+ + fn:ends-with() +
+ Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used.
+ + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
ends-with( "tattoo", "too")true
ends-with( "tattoo", "tatoo")false
ends-with ((), ())true

+ W3C Documentation reference +
+ + fn:substring-before() +
+ Returns the substring of the value of $arg1 that precedes in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
+ + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns the zero-length string.
+ + If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
substring-before( "tattoo", "too")tat
substring-before( "tattoo", "tat")<empty string>

+ W3C Documentation reference +
+ + fn:substring-after() +
+ Returns the substring of the value of $arg1 that follows in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
+ + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
+ + If the value of $arg2 is the zero-length string, then the function returns the value of $arg1.
+ + If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
+ + The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$arg1
xs:string?$arg2
xs:string?$collation (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
substring-after( "tattoo", "too")<empty string>
substring-after( "tattoo", "tat")too

+ W3C Documentation reference +
+ + + fn:matches() +
+ The function returns true if $input matches the regular expression supplied as $pattern as influenced by the value of $flags, if present; otherwise, it returns false.
+ + The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ + If $input is the empty sequence, it is interpreted as the zero-length string.
+ Unless the metacharacters ^ and $ are used as anchors, the string is considered to match the pattern if any substring matches the pattern. But if anchors are used, the anchors must match the start/end of the string (in string mode), or the start/end of a line (in multiline mode).
+ + An error is raised [err:FORX0002] if the value of $pattern is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.
+ + An error is raised [err:FORX0001] if the value of $flags is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$input
xs:string$pattern
xs:string$flags (Optional)
+ Return type: xs:boolean

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
matches("abracadabra", "bra")true
matches("abracadabra", "^a.*a$")false

+ W3C Documentation reference +
+ + fn:replace() +
+ The function returns the xs:string that is obtained by replacing each non-overlapping substring of $input that matches the given $pattern with an occurrence of the $replacement string.
+ + The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ + The $flags argument is interpreted in the same manner as for the fn:matches() function.
+ + If $input is the empty sequence, it is interpreted as the zero-length string.
+ + If two overlapping substrings of $input both match the $pattern, then only the
first one (that is, the one whose first character comes first in the $input string) is replaced. + + Within the $replacement string, a variable $N may be used to refer to the substring captured by the Nth parenthesized sub-expression in the regular expression. For each match of the pattern, these variables are assigned the value of the content matched by the relevant sub-expression, and the modified replacement string is then substituted for the characters in $input that matched the pattern. $0 refers to the substring captured by the regular expression as a whole.

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$input
xs:string$pattern
xs:string$replacement
xs:string$flags (Optional)
+ Return type: xs:string

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
replace("abracadabra", "bra", "*")a*cada*
replace("abracadabra", "a.*a", "*")*
replace("AAAA", "A+", "b")b

+ W3C Documentation reference +
+ + fn:tokenize() +
+ This function breaks the $input string into a sequence of strings, treating any substring that matches $pattern as a separator. The separators themselves are not returned.
+ + The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
+ + The $flags argument is interpreted in the same way as for the fn:matches() function.
+ + If $input is the empty sequence, or if $input is the zero-length string, the result is the empty sequence.
+ + If the supplied $pattern matches a zero-length string, that is, if fn:matches("", $pattern, $flags) returns true, then an error is raised: [err:FORX0003].
+ + If a separator occurs at the start of the $input string, the result sequence will start with a zero-length string. Zero-length strings will also occur in the result sequence if a separator occurs at the end of the $input string, or if two adjacent substrings match the supplied $pattern.

+ + + Arguments and return type: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string?$input
xs:string$pattern
xs:string$flags (Optional)
+ Return type: xs:string*

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
tokenize("The cat sat on the mat", "\s+")("The", "cat", "sat", "on", "the", "mat")
tokenize("1, 15, 24, 50", ",\s*")("1", "15", "24", "50")
tokenize("1,15,,24,50,", ",")("1", "15", "", "24", "50", "")

+ W3C Documentation reference +
+
@@ -528,45 +2148,257 @@ fn:number(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:number()
- The number function converts its argument to a number as follows: -
    -
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • -
  • boolean true is converted to 1; boolean false is converted to 0
  • -
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • -
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • -
- - Arguments and return type: - - - - - - - - - -
TypeDescription
objectThe object to convert to a number
- Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Numeric-Functions + Returns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an xs:double
+ + Calling the zero-argument version of the function is defined to give the same result as calling the single-argument version with the context item (.). That is, fn:number() is equivalent to fn:number(.).
+ + If $arg is the empty sequence or if $arg or the context item cannot be converted to an xs:double, the xs:double value NaN is returned. If the context item is undefined an error is raised: [err:XPDY0002]XP.
+ + If $arg is the empty sequence, NaN is returned. Otherwise, $arg, or the context item after atomization, is converted to an xs:double following the rules of 17.1.3.2 Casting to xs:double. If the conversion to xs:double fails, the xs:double value NaN is returned.
+ +
+ Arguments: + + + + + + + + + +
TypeDescription
xs:anyAtomicType?Value to convert to number
+ Return type: xs:double

+ W3C Documentation reference
+ fn:abs() +
+ Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise returns $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For xs:float and xs:double arguments, if the argument is positive zero or negative zero, then positive zero is returned. If the argument is positive or negative infinity, positive infinity is returned.
+ + For detailed type semantics, see Section 7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions.
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + +
QueryResult
abs(-2)2
abs(2137)2137

+ W3C Documentation reference +
+ + fn:ceiling() +
+ Returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For xs:float and xs:double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero and greater than -1, negative zero is returned.
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + +
QueryResult
ceiling(10.5)11
ceiling(-10.5)-10
ceiling(10.1)11

+ W3C Documentation reference +
+ + fn:floor() +
+ Returns the largest (closest to positive infinity) number with no fractional part that is not greater than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For float and double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned.
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + +
QueryResult
floor(10.5)10
floor(-10.5)-11
floor(10.8)10

+ W3C Documentation reference +
+ + fn:round() +
+ Returns the number with no fractional part that is closest to the argument. If there are two such numbers, then the one that is closest to positive infinity is returned. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + For xs:float and xs:double arguments, if the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. In the cases where positive zero or negative zero is returned, negative zero or positive zero may be returned as [XML Schema Part 2: Datatypes Second Edition] does not distinguish between the values positive zero and negative zero.
+ + For the last two cases, note that the result is not the same as fn:floor(x+0.5).
+
+ Arguments: + + + + + + + + + +
TypeDescription
numeric?$arg
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + +
QueryResult
round(10.5)11
round(10.4999)10
round(-10.5)-10

+ W3C Documentation reference +
+ + fn:round-half-to-even() +
+ The value returned is the nearest (that is, numerically closest) value to $arg that is a multiple of ten to the power of minus $precision. If two such values are equally near (e.g. if the fractional part in $arg is exactly .500...), the function returns the one whose least significant digit is even.
+ + If the type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
+ + The first signature of this function produces the same result as the second signature with $precision=0.
+ + For arguments of type xs:float and xs:double, if the argument is NaN, positive or negative zero, or positive or negative infinity, then the result is the same as the argument. In all other cases, the argument is cast to xs:decimal, the function is applied to this xs:decimal value, and the resulting xs:decimal is cast back to xs:float or xs:double as appropriate to form the function result. If the resulting xs:decimal value is zero, then positive or negative zero is returned according to the sign of the original argument.
+ + Note that the process of casting to xs:decimal may result in an error [err:FOCA0001].
+ + If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa computed with exponent = 0.
+
+ Arguments: + + + + + + + + + + + + + +
TypeDescription
numeric?$arg
numeric?$precision (Optional)
+ Return type: numeric?

+ + Examples: + + + + + + + + + + + + + + + + + + + + + +
QueryResult
round-half-to-even(0.5)0
round-half-to-even(1.5)2
round-half-to-even(2.5)2
round-half-to-even(2.6)3

+ W3C Documentation reference +
@@ -577,32 +2409,826 @@
fn:avg((arg,arg,...)) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:data()
- Returns the average of the argument values
- Arguments and return type: - - - - - - - - - -
TypeDescription
sequence*returns average value of provided elements
Examples:
- - - - - - - - - -
ExpressionResult
avg((1,2,3))2

- W3C Documentation reference: #func-avg + fn:data takes a sequence of items and returns a sequence of atomic values.
+ + The result of fn:data is the sequence of atomic values produced by applying the following rules to each item in $arg:
+
    +
  • If the item is an atomic value, it is returned.
  • +
  • + If the item is a node: +
      +
    • If the node does not have a typed value an error is raised [err:FOTY0012].
    • +
    • Otherwise, fn:data() returns the typed value of the node as defined by the accessor function dm:typed-value in Section 5.15 typed-value AccessorDM.
    • +
    +
  • +
+
+ Arguments: + + + + + + + + + +
TypeDescription
item*Items to convert.
+ Return type: xs:anyAtomicType*

+ Examples: + + + + + + + + + +
QueryResult
data(/l:library/l:readerList/p:person[1])7321
Adam
Choke

+ + W3C Documentation reference
+ + fn:index-of() +
+ Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.
+ + If $arg is the empty sequence, the empty sequence is returned.
+ + If $arg is a document node, $arg is returned.
+ + If the function is called without an argument, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
+ + The following errors may be raised: if the context item is undefined [err:XPDY0002]; if the context item is not a node [err:XPTY0004].

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType$seqParam
xs:anyAtomicType$srchParam
xs:string$collation (Optional)
+ Return type: xs:integer*

+ Examples: + + + + + + + + + + + + + + + + + +
QueryResult
index-of((10, 20, 30, 40), 35)()
index-of((10, 20, 30, 30, 20, 10), 20)(2, 5)
index-of(("a", "sport", "and", "a", "pastime"), "a")(1, 4)

+ + W3C Documentation reference +
+ + + fn:empty() +
+ If the value of $arg is the empty sequence, the function returns true; otherwise, the function returns false.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:boolean

+ Examples: + + + + + + + + + +
QueryResult
empty(fn:remove(("hello", "world"), 1))false

+ + W3C Documentation reference +
+ + + fn:exists() +
+ If the value of $arg is not the empty sequence, the function returns true; otherwise, the function returns false.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: xs:boolean

+ Examples: + + + + + + + + + +
QueryResult
exists(fn:remove(("hello"), 1))true

+ + W3C Documentation reference +
+ + + fn:distinct-values() +
+ Returns the sequence that results from removing from $arg all but one of a set of values that are eq to one other. Values of type xs:untypedAtomic are compared as if they were of type xs:string. Values that cannot be compared, i.e. the eq operator is not defined for their types, are considered to be distinct. The order in which the sequence of values is returned is ·implementation dependent·.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:anyAtomicType*$arg
xs:string$collation (Optional)
+ Return type: xs:anyAtomicType*

+ Examples: + + + + + + + + + +
QueryResult
distinct-values((1, 2.0, 3, 2))(1, 3, 2.0)

+ + W3C Documentation reference +
+ + fn:insert-before() +
+ Returns a new sequence constructed from the value of $target with the value of $inserts inserted at the position specified by the value of $position. (The value of $target is not affected by the sequence construction.)
+ + If $target is the empty sequence, $inserts is returned. If $inserts is the empty sequence, $target is returned.
+ + The value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $inserts, followed by the remaining elements of $target, in that sequence.
+ + If $position is less than one (1), the first position, the effective value of $position is one (1). If $position is greater than the number of items in $target, then the effective value of $position is equal to the number of items in $target plus 1.

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*$target
xs:integer$position
item()*$inserts
+ Return type: item()*

+ Examples:
+ let $x := ("a", "b", "c") + + + + + + + + + + + + + + + + + +
QueryResult
insert-before($x, 0, "z")("z", "a", "b", "c")
insert-before($x, 1, "z")("z", "a", "b", "c")
insert-before($x, 2, "z")("a", "z", "b", "c")

+ + W3C Documentation reference +
+ + fn:remove() +
+ Returns a new sequence constructed from the value of $target with the item at the position specified by the value of $position removed.
+ + If $position is less than 1 or greater than the number of items in $target, $target is returned. Otherwise, the value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $target whose index is greater than $position. If $target is the empty sequence, the empty sequence is returned.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
item()*$target
xs:integer$position
+ Return type: item()*

+ Examples:
+ let $x := ("a", "b", "c") + + + + + + + + + + + + + + + + + +
QueryResult
remove($x, 0) ("a", "b", "c")
remove($x, 1)("b", "c")
remove($x, 6)("a", "b", "c")

+ + W3C Documentation reference +
+ + + fn:reverse() +
+ Reverses the order of items in a sequence. If $arg is the empty sequence, the empty sequence is returned.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()*

+ Examples:
+ let $x := ("a", "b", "c") + + + + + + + + + + + + + + + + + +
QueryResult
reverse($x)("c", "b", "a")
reverse(("hello")) ("hello")
reverse(())()

+ + W3C Documentation reference +
+ + + fn:subsequence() +
+ Returns the contiguous sequence of items in the value of $sourceSeq beginning at the position indicated by the value of $startingLoc and continuing for the number of items indicated by the value of $length. + If $sourceSeq is the empty sequence, the empty sequence is returned.
+ + If $startingLoc is zero or negative, the subsequence includes items from the beginning of the $sourceSeq.
+ + If $length is not specified, the subsequence includes items to the end of $sourceSeq.
+ + If $length is greater than the number of items in the value of $sourceSeq following $startingLoc, the subsequence includes items to the end of $sourceSeq.
+ + The first item of a sequence is located at position 1, not position 0.

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*$sourceSeq
xs:double$startingLoc (Optional)
xs:double$length (Optional)
+ Return type: item()*

+ Examples:
+ let $seq = ($item1, $item2, $item3, $item4, ...) + + + + + + + + + + + + + +
QueryResult
subsequence($seq, 4)($item4, ...)
subsequence($seq, 3, 2)($item3, $item4)

+ + W3C Documentation reference +
+ + + fn:unordered() +
+ Returns the items of $sourceSeq in an implementation dependent order.

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$sourceSeq
+ Return type: item()*

+ + W3C Documentation reference +
+ + fn:zero-or-one() +
+ Returns $arg if it contains zero or one items. Otherwise, raises an error [err:FORG0003].

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()?

+ Examples: + + + + + + + + + + + + + +
QueryResult
zero-or-one(("a"))a
zero-or-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:zero-or-one() ("a", "b")

+ + W3C Documentation reference +
+ + + fn:one-or-more() +
+ Returns $arg if it contains one or more items. Otherwise, raises an error [err:FORG0004].

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()?

+ Examples: + + + + + + + + + + + + + +
QueryResult
one-or-more(("a"))a
one-or-more(("a", "b"))a
b

+ + W3C Documentation reference +
+ + + fn:exactly-one() +
+ Returns $arg if it contains exactly one item. Otherwise, raises an error [err:FORG0005].

+ + Arguments: + + + + + + + + + +
TypeDescription
item()*$arg
+ Return type: item()?

+ Examples: + + + + + + + + + + + + + +
QueryResult
exactly-one(("a"))a
exactly-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:exactly-one() ("a", "b")

+ + W3C Documentation reference +
+ + + fn:deep-equal() +
+ This function assesses whether two sequences are deep-equal to each other. To be deep-equal, they must contain items that are pairwise deep-equal; and for two items to be deep-equal, they must either be atomic values that compare equal, or nodes of the same kind, with the same name, whose children are deep-equal. This is defined in more detail below. The $collation argument identifies a collation which is used at all levels of recursion when strings are compared (but not when names are compared), according to the rules in 7.3.1 Collations.
+ + If the two sequences are both empty, the function returns true.
+ + If the two sequences are of different lengths, the function returns false.
+ + If the two sequences are of the same length, the function returns true if and only if every item in the sequence $parameter1 is deep-equal to the item at the same position in the sequence $parameter2. The rules for deciding whether two items are deep-equal follow. + + For more in-depth description look into W3C Documentation

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
item()*$parameter1
item()*$parameter2
xs:string$collation (Optional)
+ Return type: xs:boolean

+ Examples: + + + + + + + + + + + + + +
QueryResult
deep-equal(/l:library/p:person[0], /l:library/p:person[1])true
deep-equal(/l:library/p:person[0], /l:library)false

+ + W3C Documentation reference +
+ + + fn:id() +
+ Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg. + +

Note:

+ + This function does not have the desired effect when searching a document in which elements of type xs:ID are used as identifiers. To preserve backwards compatibility, a new function fn:element-with-id is therefore being introduced; it behaves the same way as fn:id in the case of ID-valued attributes. +

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string*$arg
node()*$node
xs:string$collation (Optional)
+ Return type: element()*

+ + W3C Documentation reference +
+ + fn:idref() +
+ Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

+ + Arguments: + + + + + + + + + + + + + + + + + +
TypeDescription
xs:string*$arg
node()*$node
xs:string$collation (Optional)
+ Return type: node()*

+ + W3C Documentation reference +
+ + + fn:doc() +
+ Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string$uri
+ Return type: document-node()?

+ Examples: + + + + + + + + + +
QueryResult
doc("test.xml")Contents of test.xml file returned as node

+ + W3C Documentation reference +
+ + + fn:doc-available() +
+ Retrieves a document using a URI supplied as an xs:string, and returns the corresponding document node.
+ + If $uri is the empty sequence, the result is an empty sequence.
+ + If $uri is not a valid URI, an error may be raised [err:FODC0005].
+ + If $uri is a relative URI reference, it is resolved relative to the value of the base URI property from the static context. The resulting absolute URI is promoted to an xs:string.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string$uri
+ Return type: xs:boolean

+ Examples: + + + + + + + + + +
QueryResult
doc("test.xml")true (If document is available)

+ + W3C Documentation reference +
+ + + fn:collection() +
+ This function takes an xs:string as argument and returns a sequence of nodes obtained by interpreting $arg as an xs:anyURI and resolving it according to the mapping specified in Available collections described in Section C.2 Dynamic Context ComponentsXP. If Available collections provides a mapping from this string to a sequence of nodes, the function returns that sequence. If Available collections maps the string to an empty sequence, then the function returns an empty sequence. If Available collections provides no mapping for the string, an error is raised [err:FODC0004].
+ If $arg is not specified, the function returns the sequence of the nodes in the default collection in the dynamic context. See Section C.2 Dynamic Context ComponentsXP. If the value of the default collection is undefined an error is raised [err:FODC0002].

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: node()*

+ Examples: + + + + + + + + + +
QueryResult
collection("")<empty sequence>

+ + W3C Documentation reference +
+ + fn:element-with-id() +
+ Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:string?$arg (Optional)
+ Return type: node()*

+ + W3C Documentation reference +
+ + fn:position() +
+ Returns the context position from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

+ + Return type: xs:integer

+ Examples: + + + + + + + + + +
QueryResult
/l:library/l:readerList/position()1

+ + W3C Documentation reference +
+ + + fn:last() +
+ Returns the context size from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

+ + Return type: xs:integer

+ Examples: + + + + + + + + + +
QueryResult
/l:library/l:readerList/p:person/last()2
2

+ + W3C Documentation reference +
+
@@ -612,55 +3238,1074 @@
- fn:adjust-date-to-timezone(date,timezone) -
- If the timezone argument is empty, it returns a date without a timezone. Otherwise, - it returns a date with a timezone
- Arguments and return type: - - - - - - - - - - - - - -
TypeDescription
datedate to be adjusted
timezonetimezone to be imposed into date
Examples:
- - - - - - - - - -
ExpressionResult
adjust-date-to-timezone(xs:date('2011-11-15'), - xs:dayTimeDuration("PT10H"))2011-11-15+10:00

- W3C Documentation reference: #func-adjust-date-to-timezone -
- + fn:years-from-duration() +
+ Returns an xs:integer representing the years component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the years component as described in 10.3.1.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:dayTimeDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
years-from-duration(xs:yearMonthDuration("P20Y15M"))21
years-from-duration(xs:yearMonthDuration("-P15M"))-1
years-from-duration(xs:dayTimeDuration("-P2DT15H"))0

+ W3C Documentation reference +
+ + fn:months-from-duration() +
+ Returns an xs:integer representing the months component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the months component as described in 10.3.1.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:dayTimeDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
months-from-duration(xs:yearMonthDuration("P20Y15M"))3
months-from-duration(xs:yearMonthDuration("-P20Y18M"))-6
months-from-duration(xs:dayTimeDuration("-P2DT15H0M0S"))0

+ W3C Documentation reference +
+ + fn:days-from-duration() +
+ Returns an xs:integer representing the days component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the days component as described in 10.3.2.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:yearMonthDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
days-from-duration(xs:dayTimeDuration("P3DT10H"))3
days-from-duration(xs:dayTimeDuration("P3DT55H"))5
days-from-duration(xs:yearMonthDuration("P3Y5M"))0

+ W3C Documentation reference +
+ + fn:hours-from-duration() +
+ Returns an xs:integer representing the hours component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the hours component as described in 10.3.2.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:yearMonthDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
hours-from-duration(xs:dayTimeDuration("P3DT10H"))10
hours-from-duration(xs:dayTimeDuration("P3DT12H32M12S"))12
hours-from-duration(xs:dayTimeDuration("PT123H"))0

+ W3C Documentation reference +
+ + + fn:minutes-from-duration() +
+ Returns an xs:integer representing the minutes component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the minutes component as described in 10.3.2.3 Canonical representation. + + The result may be negative. + + If $arg is an xs:yearMonthDuration returns 0. + + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
minutes-from-duration(xs:dayTimeDuration("P3DT10H"))0
minutes-from-duration(xs:dayTimeDuration("-P5DT12H30M"))-30

+ W3C Documentation reference +
+ + fn:seconds-from-duration() +
+ Returns an xs:decimal representing the seconds component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the seconds component as described in 10.3.2.3 Canonical representation.
+ + The result may be negative.
+ + If $arg is an xs:yearMonthDuration returns 0.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:duration?$arg
+ Return type: xs:decimal?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
seconds-from-duration(xs:dayTimeDuration("P3DT10H12.5S"))12.5
seconds-from-duration(xs:dayTimeDuration("-PT256S"))-16.0

+ W3C Documentation reference +
+ + + fn:year-from-dateTime() +
+ Returns an xs:integer representing the year component in the localized value of $arg. The result may be negative.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
year-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))1999
year-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))1999
year-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))2000

+ W3C Documentation reference +
+ + + fn:month-from-dateTime() +
+ Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
month-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))5
month-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))12
month-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))1

+ W3C Documentation reference +
+ + fn:day-from-dateTime() +
+ Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
day-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))31
day-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))31
day-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))1

+ W3C Documentation reference +
+ + + fn:hours-from-dateTime() +
+ Returns an xs:integer between 0 and 23, both inclusive, representing the hours component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
hours-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))13
hours-from-dateTime(xs:dateTime("1999-12-31T19:20:00"))19
hours-from-dateTime(xs:dateTime("1999-12-31T24:00:00"))0

+ W3C Documentation reference +
+ + + fn:minutes-from-dateTime() +
+ Returns an xs:integer value between 0 and 59, both inclusive, representing the minute component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
minutes-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))20
minutes-from-dateTime(xs:dateTime("1999-05-31T13:30:00+05:30"))30

+ W3C Documentation reference +
+ + fn:seconds-from-dateTime() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:decimal?

+ Examples:
+ + + + + + + + + +
ExpressionResult
seconds-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))0

+ W3C Documentation reference +
+ + fn:timezone-from-dateTime() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:dateTime?$arg
+ Return type: xs:dayTimeDuration?

+ Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
timezone-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00"))-PT5H
timezone-from-dateTime(xs:dateTime("2000-06-12T13:20:00Z")) PT0S
timezone-from-dateTime(xs:dateTime("2004-08-27T00:00:00"))()

+ W3C Documentation reference +
+ + + fn:year-from-date() +
+ Returns an xs:integer representing the year in the localized value of $arg. The value may be negative.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
year-from-date(xs:date("1999-05-31"))1999
year-from-date(xs:date("2000-01-01+05:00"))2000

+ W3C Documentation reference +
+ + fn:month-from-date() +
+ Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
month-from-date(xs:date("1999-05-31-05:00"))5
month-from-date(xs:date("2000-01-01+05:00"))1

+ W3C Documentation reference +
+ + fn:day-from-date() +
+ Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
day-from-date(xs:date("1999-05-31-05:00"))31
day-from-date(xs:date("2000-01-01+05:00"))1

+ W3C Documentation reference +
+ + + fn:timezone-from-date() +
+ Returns the timezone component of $arg if any. If $arg has a timezone component, then the result is an xs:dayTimeDuration that indicates deviation from UTC; its value may range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty sequence.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:date?$arg
+ Return type: xs:dayTimeDuration?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
timezone-from-date(xs:date("1999-05-31-05:00"))-PT5H
timezone-from-date(xs:date("2000-06-12Z"))PT0S

+ W3C Documentation reference +
+ + + fn:hours-from-time() +
+ Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
hours-from-time(xs:time("11:23:00"))11
hours-from-time(xs:time("24:00:00"))0

+ W3C Documentation reference +
+ + + fn:minutes-from-time() +
+ Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:integer?

+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
hours-from-time(xs:time("11:23:00"))11
hours-from-time(xs:time("24:00:00"))0

+ W3C Documentation reference +
+ + fn:seconds-from-time() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:decimal?

+ Examples:
+ + + + + + + + + + +
ExpressionResult
seconds-from-time(xs:time("13:20:10.5"))10.5

+ W3C Documentation reference +
+ + + fn:timezone-from-time() +
+ Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
+ + If $arg is the empty sequence, returns the empty sequence.

+ Arguments and return type: + + + + + + + + + +
TypeDescription
xs:time?$arg
+ Return type: xs:dayTimeDuration?

+ Examples:
+ + + + + + + + + + + + + + +
ExpressionResult
timezone-from-time(xs:time("13:20:00-05:00"))-PT5H
timezone-from-time(xs:time("13:20:00"))()

+ W3C Documentation reference +
+ + + fn:adjust-date-to-timezone() +
+ Adjusts an xs:date value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:date without a timezone. Otherwise, returns an xs:date with a timezone. For purposes of timezone adjustment, an xs:date is treated as an xs:dateTime with time 00:00:00.
+ + If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
+ + If $arg is the empty sequence, then the result is the empty sequence.
+ + A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
+ + If $arg does not have a timezone component and $timezone is the empty sequence, then the result is the value of $arg.
+ + If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
+ + If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
+ + If $arg has a timezone component and $timezone is not the empty sequence, then: +
    +
  • Let $srcdt be an xs:dateTime value, with 00:00:00 for the time component and date and timezone components that are the same as the date and timezone components of $arg.
  • +
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
  • +
  • The result of this function will be a date value that has date and timezone components that are the same as the date and timezone components of $r.
  • +
+

+ + Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:date?$arg
xs:dayTimeDuration?$timezone
+ Return type: xs:date?

+ Examples:
+ + + + + + + + + + + + + + +
ExpressionResult
adjust-date-to-timezone(xs:date("2002-03-07"))2002-03-07-05:00
adjust-date-to-timezone(xs:date("2002-03-07"), xs:dayTimeDuration("-PT10H"))2002-03-07-10:00

+ W3C Documentation reference +
+ + fn:adjust-time-to-timezone() +
+ Adjusts an xs:time value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:time without a timezone. Otherwise, returns an xs:time with a timezone.
+ + If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
+ + If $arg is the empty sequence, then the result is the empty sequence.
+ + A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
+ + If $arg does not have a timezone component and $timezone is the empty sequence, then the result is $arg.
+ + If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
+ + If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
+ + If $arg has a timezone component and $timezone is not the empty sequence, then: +
    +
  • Let $srcdt be an xs:dateTime value, with an arbitrary date for the date component and time and timezone components that are the same as the time and timezone components of $arg.
  • +
  • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
  • +
  • The result of this function will be a time value that has time and timezone components that are the same as the time and timezone components of $r.
  • +
+

+ + Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:time?$arg
xs:dayTimeDuration?$timezone
+ Return type: xs:time?

+ Examples:
+ + + + + + + + + + + + + + +
ExpressionResult
adjust-time-to-timezone(xs:time("10:00:00"))10:00:00-05:00
adjust-time-to-timezone(xs:time("10:00:00"), xs:dayTimeDuration("-PT10H"))10:00:00-10:00

+ W3C Documentation reference +
+ + fn:current-dateTime() +
+ Returns the current dateTime (with timezone) from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) This is an xs:dateTime that is current at some time during the evaluation of a query or transformation in which fn:current-dateTime() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-dateTime() is ·implementation dependent·.

+ + Return type: xs:dateTime

+ Examples:
+ + + + + + + + + + +
ExpressionResult
current-dateTime()xs:dateTime corresponding to the current date and time

+ W3C Documentation reference +
+ + fn:current-date() +
+ Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

+ + Return type: xs:date

+ Examples:
+ + + + + + + + + + +
ExpressionResult
current-date()xs:date corresponding to the current date

+ W3C Documentation reference +
+ + + fn:current-time() +
+ Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

+ + Return type: xs:time

+ Examples:
+ + + + + + + + + + +
ExpressionResult
current-time()xs:date corresponding to the current time

+ W3C Documentation reference +
+ + fn:implicit-timezone() +
+ Returns the value of the implicit timezone property from the dynamic context. Components of the dynamic context are discussed in Section C.2 Dynamic Context ComponentsXP.

+ + Return type: xs:string

+ Examples:
+ + + + + + + + + + +
ExpressionResult
implicit-timezone()PT0S

+ W3C Documentation reference +
- +
fn:error()
- https://www.w3.org/TR/xpath-functions/#func-error
-
- W3C Documentation reference: #func-error + The fn:error function is a general function that may be invoked as above but may also be invoked from [XQuery 1.0: An XML Query Language] or [XML Path Language (XPath) 2.0] applications with, for example, an xs:QName argument. +
+ W3C Documentation reference +
+ + + fn:trace() +
+ Provides an execution trace intended to be used in debugging queries.
+ + The input $value is returned, unchanged, as the result of the function. In addition, the inputs $value, converted to an xs:string, and $label may be directed to a trace data set. The destination of the trace output is ·implementation-defined·. The format of the trace output is ·implementation dependent·. The ordering of output from invocations of the fn:trace() function is ·implementation dependent·.
+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
item*$value
xs:string$label
+ Return type: item

+
+ W3C Documentation reference
@@ -673,15 +4318,363 @@
- fn:nilled(node) -
+ fn:resolve-uri() +
+ This function enables a relative URI reference to be resolved against an absolute URI. - Returns a Boolean value indicating whether the argument node is nilled
-
- W3C Documentation reference: #func-nilled -
+ The first form of this function resolves $relative against the value of the base-uri property from the static context. If the base-uri property is not initialized in the static context an error is raised [err:FONS0005].
+ + If $relative is a relative URI reference, it is resolved against $base, or against the base-uri property from the static context, using an algorithm such as those described in [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned.
+ If $relative is an absolute URI reference, it is returned unchanged.
+ + If $relative is the empty sequence, the empty sequence is returned.
+ + If $relative is not a valid URI according to the rules of the xs:anyURI data type, or if it is not a suitable relative reference to use as input to the chosen resolution algorithm, then an error is raised [err:FORG0002].
+ + If $base is not a valid URI according to the rules of the xs:anyURI data type, if it is not a suitable URI to use as input to the chosen resolution algorithm (for example, if it is a relative URI reference, if it is a non-hierarchic URI, or if it contains a fragment identifier), then an error is raised [err:FORG0002].
+ + If the chosen resolution algorithm fails for any other reason then an error is raised [err:FORG0009].
+ +

Note:

+ + Resolving a URI does not dereference it. This is merely a syntactic operation on two character strings. +

+ Arguments and return type: + + + + + + + + + + + + + +
TypeDescription
xs:string?$relative
xs:string$base
+ Return type: xs:anyURI?

+
+ W3C Documentation reference +
+ fn:resolve-QName() +
+ Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string that has the lexical form of an xs:QName (a string in the form "prefix:local-name" or "local-name") and resolving it using the in-scope namespaces for a given element.
+ + If $qname does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
+ + If $qname is the empty sequence, returns the empty sequence.
+ + More specifically, the function searches the namespace bindings of $element for a binding whose name matches the prefix of $qname, or the zero-length string if it has no prefix, and constructs an expanded-QName whose local name is taken from the supplied $qname, and whose namespace URI is taken from the string value of the namespace binding.
+ + If the $qname has a prefix and if there is no namespace binding for $element that matches this prefix, then an error is raised [err:FONS0004].
+ + If the $qname has no prefix, and there is no namespace binding for $element corresponding to the default (unnamed) namespace, then the resulting expanded-QName has no namespace part.
+ + The prefix (or absence of a prefix) in the supplied $qname argument is retained in the returned expanded-QName, as discussed in Section 2.1 TerminologyDM.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$qname
element$element
+ Return type: xs:QName?

+ Examples: + + + + + + + + + + + + + +
QueryResult
resolve-QName("hello", /l:library/l:libraryName)hello
resolve-QName("l:libraryID", /l:library/l:libraryName)l:libraryID

+ + W3C Documentation reference +
+ + fn:QName() +
+ Returns an xs:QName with the namespace URI given in $paramURI. If $paramURI is the zero-length string or the empty sequence, it represents "no namespace"; in this case, if the value of $paramQName contains a colon (:), an error is raised [err:FOCA0002]. The prefix (or absence of a prefix) in $paramQName is retained in the returned xs:QName value. The local name in the result is taken from the local part of $paramQName.
+ + If $paramQName does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
+ + Note that unlike xs:QName this function does not require a xs:string literal as the argument.

+ Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$paramURI
xs:string$paramQName
+ Return type: xs:QName

+ Examples: + + + + + + + + + +
QueryResult
QName("http://www.release11.com/library", "l:libraryName")l:libraryName
+ For more extensive examples see W3C documentation below.
+ + W3C Documentation reference +
+ + fn:prefix-from-QName() +
+ Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:NCName?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))l
+ + W3C Documentation reference +
+ + fn:local-name-from-QName() +
+ Returns an xs:NCName representing the local part of $arg. If $arg is the empty sequence, returns the empty sequence.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:NCName?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))library
+ + W3C Documentation reference +
+ + + fn:prefix-from-QName() +
+ Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:NCName?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))l
+ + W3C Documentation reference +
+ + fn:namespace-uri-from-QName() +
+ Returns the namespace URI for $arg as an xs:anyURI. If $arg is the empty sequence, the empty sequence is returned. If $arg is in no namespace, the zero-length xs:anyURI is returned.

+ + Arguments: + + + + + + + + + +
TypeDescription
xs:QName?$arg
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + +
QueryResult
prefix-from-QName(resolve-QName("l:library", /l:library))http://www.release11.com/library
+ + W3C Documentation reference +
+ + + fn:namespace-uri-for-prefix() +
+ Returns the namespace URI of one of the in-scope namespaces for $element, identified by its namespace prefix.
+ + If $element has an in-scope namespace whose namespace prefix is equal to $prefix, it returns the namespace URI of that namespace. If $prefix is the zero-length string or the empty sequence, it returns the namespace URI of the default (unnamed) namespace. Otherwise, it returns the empty sequence.
+ + Prefixes are equal only if their Unicode code points match exactly.

+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
xs:string?$prefix
element()$element
+ Return type: xs:anyURI?

+ Examples: + + + + + + + + + +
QueryResult
namespace-uri-for-prefix("l", /l:library)http://www.release11.com/library
+ + W3C Documentation reference +
+ + + fn:in-scope-prefixes() +
+ Returns the prefixes of the in-scope namespaces for $element. For namespaces that have a prefix, it returns the prefix as an xs:NCName. For the default namespace, which has no prefix, it returns the zero-length string.

+ + Arguments: + + + + + + + + + +
TypeDescription
element()$element
+ Return type: xs:string*

+ Examples: + + + + + + + + + +
QueryResult
in-scope-prefixes(/l:library)b
l
p
xsi
xml
+ + W3C Documentation reference +
+ + fn:static-base-uri() +
+ Returns the value of the Base URI property from the static context. If the Base URI property is undefined, the empty sequence is returned. Components of the static context are discussed in Section C.1 Static Context ComponentsXP.

+ + Return type: xs:anyURI?

+ Examples:
+ + + + + + + + + + +
ExpressionResult
static-base-uri()()<empty sequence>

+ W3C Documentation reference +
From 3d41447581ca7ce53be90d09b65bc10659224971 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 6 Apr 2023 14:03:39 +0200 Subject: [PATCH 13/59] Added numeric functions and some string --- Frontend/tools/xpath.html | 472 +++++++++++++++++++++++++++++++------- 1 file changed, 385 insertions(+), 87 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 065d4a9..999cb7c 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -286,104 +286,402 @@ W3C Documentation reference: Node-Set-Functions
-
+
- - - -
- - - fn:boolean() + + +
- The boolean function converts its argument to a boolean as follows: -
    -
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • -
  • a node-set is true if and only if it is non-empty
  • -
  • a string is true if and only if its length is non-zero
  • -
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • -
- Arguments: - - - - - - - - - -
TypeDescription
objectThe object to convert to a boolean
Examples:
- - - - - - - - - - - - - -
ExpressionResult
boolean("Release11")true
boolean("")false

- W3C Documentation reference: Boolean-Functions -
+ + fn:boolean() +
+ The boolean function converts its argument to a boolean as follows: +
    +
  • a number is true if and only if it is neither positive or negative zero nor NaN
  • +
  • a node-set is true if and only if it is non-empty
  • +
  • a string is true if and only if its length is non-zero
  • +
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • +
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a boolean
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
boolean("Release11")true
boolean("")false

+ W3C Documentation reference: Boolean-Functions +
- fn:not() -
- The not function returns true if its argument is false, and false otherwise.
+ fn:not() +
+ The not function returns true if its argument is false, and false otherwise.
+
+ W3C Documentation reference: Boolean-Functions +
+ + + fn:true() +
+ The true function returns true.
+
+ W3C Documentation reference: Boolean-Functions +
+ + + fn:false() +
+ The true function returns false.
+
+ W3C Documentation reference: Boolean-Functions +
+ + fn:lang() +
+ The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
+ Arguments: + + + + + + + + + +
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation

- W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions +
+ +
- - - fn:true() -
- The true function returns true.
-
- W3C Documentation reference: Boolean-Functions -
- - - fn:false() -
- The true function returns false.
-
- W3C Documentation reference: Boolean-Functions -
- - fn:lang() -
- The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
- Arguments: - - - - - - - - - -
TypeDescription
stringLanguage that will be looked for in context node
Examples: Look W3C documentation
-
- W3C Documentation reference: Boolean-Functions -
- -
+ + + +
+ + + +
+ + fn:string() +
+ The string function converts an object to a string as follows: A node-set is converted to a string by returning the string-value of the node in the node-set that is first in document order. If the node-set is empty, an empty string is returned.
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a string
Examples:
+ + + + + + + + + +
ExpressionResult
string(10)true

+ W3C Documentation reference: String-Functions +
+ + + fn:concat() +
+ The concat function returns the concatenation of its arguments.
+ + Arguments: + + + + + + + + + +
TypeDescription
string*Strings to concatenate
Examples:
+ + + + + + + + + +
ExpressionResult
concat("Release", 11)Release11

+ W3C Documentation reference: String-Functions +
+ + fn:starts-with() +
+ The concat function returns the concatenation of its arguments.
+ + Arguments: + + + + + + + + + + + + + +
TypeDescription
string
stringThe object to convert to a string
Examples:
+ + + + + + + + + +
ExpressionResult
concat("Release", 11)Release11

+ W3C Documentation reference: String-Functions +
+ + +
+ +
+ + + +
+ + + fn:number() +
+ The number function converts its argument to a number as follows: +
    +
  • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
  • +
  • boolean true is converted to 1; boolean false is converted to 0
  • +
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • +
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • +
+ + Arguments: + + + + + + + + + +
TypeDescription
objectThe object to convert to a number
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
number(10)10
number("")NaN

+ W3C Documentation reference +
+ + fn:sum() +
+ The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + +
ExpressionResult
sum(/l:library/l:readerList/p:person/p:readerID)12444

+ W3C Documentation reference +
+ + fn:floor() +
+ The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)4
floor(3.9)4
floor(3.5)4

+ W3C Documentation reference +
+ + fn:ceiling() +
+ The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)3
floor(3.5)3

+ W3C Documentation reference +
+ + + fn:round() +
+ The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. + +

NOTE

+ For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
+ + Arguments: + + + + + + + + + +
TypeDescription
node-setNode set to sum
Examples:
+ + + + + + + + + + + + + + + + + +
ExpressionResult
floor(3.1)3
floor(3.9)4
floor(3.5)3

+ W3C Documentation reference +
+ +
+
+ From 420bfaccd91b45542685005dad62be16ff740cae Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 19 Apr 2023 13:18:55 +0200 Subject: [PATCH 14/59] Resolved merge conflict in xpath.html --- Frontend/tools/xpath.html | 13655 +++++++++++++++++++++++++++++++++--- 1 file changed, 12751 insertions(+), 904 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 999cb7c..383888b 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -110,7 +110,6 @@ -
@@ -120,12 +119,20 @@ fn:position()
- Returns the position of the current context node
-
- W3C Documentation reference: Node-Set-Functions + Returns the position of the current context node.
+
+ W3C Documentation reference: Node-Set-Functions
- - + + fn:last() +
+ The last function returns a number equal to the context size from the expression evaluation context.
+
+ W3C Documentation reference: Node-Set-Functions +
+ + fn:count()
@@ -157,19 +164,19 @@
W3C Documentation reference: Node-Set-Functions
- - - + + + fn:id()
- Returns the element specified by it's unique id, requires DTD
-
- W3C Documentation reference: Node-Set-Functions + Returns the element specified by it's unique id, requires DTD
+
+ W3C Documentation reference: Node-Set-Functions
- - - + + + fn:local-name()
@@ -201,19 +208,8 @@
W3C Documentation reference: Node-Set-Functions
- - - - fn:local-name() -
- Returns the local-name for the context node
-
- W3C Documentation reference: Node-Set-Functions -
- - - + + fn:namespace-uri()
@@ -241,19 +237,8 @@
W3C Documentation reference: Node-Set-Functions
- - - - fn:namespace-uri() -
- Returns the namespace-uri for the context node
-
- W3C Documentation reference: Node-Set-Functions -
- - - + + fn:name()
@@ -287,14 +272,14 @@
- +
- - + + fn:boolean()
@@ -305,7 +290,7 @@
  • a string is true if and only if its length is non-zero
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
  • - + Arguments: @@ -333,9 +318,7 @@

    W3C Documentation reference: Boolean-Functions
    - - - + fn:not()
    @@ -343,8 +326,8 @@
    W3C Documentation reference: Boolean-Functions
    - - + + fn:true()
    @@ -352,8 +335,8 @@
    W3C Documentation reference: Boolean-Functions
    - - + + fn:false()
    @@ -361,7 +344,7 @@
    W3C Documentation reference: Boolean-Functions
    - + fn:lang()
    @@ -380,24 +363,21 @@
    W3C Documentation reference: Boolean-Functions
    - - + +
    - - -
    - + fn:string()
    The string function converts an object to a string as follows: A node-set is converted to a string by returning the string-value of the node in the node-set that is first in document order. If the node-set is empty, an empty string is returned.
    - + Arguments: @@ -421,13 +401,13 @@

    W3C Documentation reference: String-Functions
    - - + + fn:concat()
    The concat function returns the concatenation of its arguments.
    - + Arguments: @@ -451,51 +431,296 @@

    W3C Documentation reference: String-Functions
    - + fn:starts-with()
    - The concat function returns the concatenation of its arguments.
    - - Arguments: - - - - - - - - - - - - - -
    TypeDescription
    string
    stringThe object to convert to a string
    Examples:
    - - - - - - - - - -
    ExpressionResult
    concat("Release", 11)Release11

    - W3C Documentation reference: String-Functions + Returns true if the first argument string starts with the second argument string, and otherwise returns false.
    + + Arguments: + + + + + + + + + + + + + +
    TypeDescription
    stringString to test
    stringString that first string has to start from
    Examples:
    + + + + + + + + + +
    ExpressionResult
    starts-with("Release11", "Rel")true

    + W3C Documentation reference: String-Functions
    - - + + fn:contains() +
    + The contains function returns true if the first argument string contains the second argument string, and otherwise returns false.
    + + Arguments: + + + + + + + + + + + + + +
    TypeDescription
    stringString to test
    stringString that first string has to contain
    Examples:
    + + + + + + + + + +
    ExpressionResult
    contains("Release11", "eas")true

    + W3C Documentation reference: String-Functions +
    + + fn:substring-before() +
    + The substring-before function returns the substring of the first argument string that precedes the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string.
    + + Arguments: + + + + + + + + + + + + + +
    TypeDescription
    stringString to test
    stringString that first string has to contain
    Examples:
    + + + + + + + + + +
    ExpressionResult
    substring-before("1999/04/01","/")1999

    + W3C Documentation reference: String-Functions +
    + + + fn:substring-after() +
    + The substring-after function returns the substring of the first argument string that follows the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string.
    + + Arguments: + + + + + + + + + + + + + +
    TypeDescription
    stringString to test
    stringString that first string has to contain
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    substring-after("1999/04/01","/")04/01
    substring-after("1999/04/01","19")99/04/01

    + W3C Documentation reference: String-Functions +
    + + + fn:substring() +
    + The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument.
    + + Arguments: + + + + + + + + + + + + + + + + + +
    TypeDescription
    stringString to test
    numberStarting index
    number?Length of target substring
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    substring("12345",2)2345
    substring("12345",2,3)234

    + W3C Documentation reference: String-Functions +
    + + fn:string-length() +
    + The string-length returns the number of characters in the string. If the argument is omitted, it defaults to the context node converted to a string, in other words the string-value of the context node.
    + + Arguments: + + + + + + + + + +
    TypeDescription
    string?String to test
    Examples:
    + + + + + + + + + +
    ExpressionResult
    string-length("abcdef")6

    + W3C Documentation reference: String-Functions +
    + + fn:normalize-space() +
    + The normalize-space function returns the argument string with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of whitespace characters by a single space. Whitespace characters are the same as those allowed by the S production in XML. If the argument is omitted, it defaults to the context node converted to a string, in other words the string-value of the context node.
    + + Arguments: + + + + + + + + + +
    TypeDescription
    string?String to test
    Examples:
    + + + + + + + + + +
    ExpressionResult
    normalize-space(" abc def ")abc def

    + W3C Documentation reference: String-Functions +
    + + + fn:translate() +
    + The translate function returns the first argument string with occurrences of characters in the second argument string replaced by the character at the corresponding position in the third argument string. If there is a character in the second argument string with no character at a corresponding position in the third argument string (because the second argument string is longer than the third argument string), then occurrences of that character in the first argument string are removed.
    + + Arguments: + + + + + + + + + + + + + + + + + +
    TypeDescription
    stringString to translate
    stringCharacters to remove
    stringString to insert characters from second argument
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    translate("bar","abc","ABC")BAr
    translate("--aaa--","abc-","ABC")AAA

    + W3C Documentation reference: String-Functions +
    + +
    -
    - - + + fn:number()
    @@ -506,7 +731,7 @@
  • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
  • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
  • - + Arguments: @@ -534,12 +759,12 @@

    W3C Documentation reference
    - + fn:sum()
    The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
    - + Arguments: @@ -563,12 +788,12 @@

    W3C Documentation reference
    - + fn:floor()
    The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
    - + Arguments: @@ -600,12 +825,12 @@

    W3C Documentation reference
    - + fn:ceiling()
    The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
    - + Arguments: @@ -637,16 +862,16 @@

    W3C Documentation reference
    - - + + fn:round()
    The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. - +

    NOTE

    For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
    - + Arguments: @@ -678,32 +903,37 @@

    W3C Documentation reference
    - +
    - -
    - - + + fn:name() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:name()
    - Returns the name of a node, as an xs:string that is either the zero-length string, or has the lexical form of an xs:QName.
    + Returns the name of a node, as an xs:string that is either the zero-length string, or + has the lexical form of an xs:QName.
    - If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
    + If the argument is omitted, it defaults to the context item (.). The behavior of the + function if the argument is omitted is exactly the same as if the context item had been + passed as the argument.
    - The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
    + The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; + if the context item is not a node [err:XPTY0004]XP.
    - If the argument is supplied and is the empty sequence, the function returns the zero-length string.
    + If the argument is supplied and is the empty sequence, the function returns the + zero-length string.
    - If the target node has no name (that is, if it is a document node, a comment, a text node, or a namespace binding having no name), the function returns the zero-length string.
    + If the target node has no name (that is, if it is a document node, a comment, a text + node, or a namespace binding having no name), the function returns the zero-length + string.
    Otherwise, the value returned is fn:string(fn:node-name($arg)).

    @@ -731,23 +961,32 @@ l:library
    - W3C Documentation reference + W3C Documentation reference
    fn:local-name() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:local-name()
    - Returns the local part of the name of $arg as an xs:string that will either be the zero-length string or will have the lexical form of an xs:NCName.
    + Returns the local part of the name of $arg as an xs:string that will either be the + zero-length string or will have the lexical form of an xs:NCName.
    - If the argument is omitted, it defaults to the context item (.). The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
    + If the argument is omitted, it defaults to the context item (.). The behavior of the + function if the argument is omitted is exactly the same as if the context item had been + passed as the argument.
    - The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
    + The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; + if the context item is not a node [err:XPTY0004]XP.
    - If the argument is supplied and is the empty sequence, the function returns the zero-length string.
    + If the argument is supplied and is the empty sequence, the function returns the + zero-length string.
    - If the target node has no name (that is, if it is a document node, a comment, or a text node), the function returns the zero-length string.
    + If the target node has no name (that is, if it is a document node, a comment, or a text + node), the function returns the zero-length string.
    - Otherwise, the value returned will be the local part of the expanded-QName of the target node (as determined by the dm:node-name accessor in Section 5.11 node-name Accessor). This will be an xs:string whose lexical form is an xs:NCName.
    + Otherwise, the value returned will be the local part of the expanded-QName of the target + node (as determined by the dm:node-name accessor in Section 5.11 node-name Accessor). + This will be an xs:string whose lexical form is an xs:NCName.

    Arguments: @@ -774,13 +1013,16 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:nilled() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:nilled()
    - Returns an xs:boolean indicating whether the argument node is "nilled". If the argument is not an element node, returns the empty sequence. If the argument is the empty sequence, returns the empty sequence.
    + Returns an xs:boolean indicating whether the argument node is "nilled". If the argument + is not an element node, returns the empty sequence. If the argument is the empty + sequence, returns the empty sequence.

    Arguments: @@ -807,17 +1049,28 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:base-uri() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:base-uri()
    - Returns the value of the base-uri URI property for $arg as defined by the accessor function dm:base-uri() for that kind of node in Section 5.2 base-uri AccessorDM. If $arg is not specified, the behavior is identical to calling the function with the context item (.) as argument. The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
    + Returns the value of the base-uri URI property for $arg as defined by the accessor + function dm:base-uri() for that kind of node in Section 5.2 base-uri AccessorDM. If $arg + is not specified, the behavior is identical to calling the function with the context + item (.) as argument. The following errors may be raised: if the context item is + undefined [err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.
    If $arg is the empty sequence, the empty sequence is returned.
    - - Document, element and processing-instruction nodes have a base-uri property which may be empty. The base-uri property of all other node types is the empty sequence. The value of the base-uri property is returned if it exists and is not empty. Otherwise, if the node has a parent, the value of dm:base-uri() applied to its parent is returned, recursively. If the node does not have a parent, or if the recursive ascent up the ancestor chain encounters a node whose base-uri property is empty and it does not have a parent, the empty sequence is returned.
    + + Document, element and processing-instruction nodes have a base-uri property which may be + empty. The base-uri property of all other node types is the empty sequence. The value of + the base-uri property is returned if it exists and is not empty. Otherwise, if the node + has a parent, the value of dm:base-uri() applied to its parent is returned, recursively. + If the node does not have a parent, or if the recursive ascent up the ancestor chain + encounters a node whose base-uri property is empty and it does not have a parent, the + empty sequence is returned.

    Arguments: @@ -844,19 +1097,28 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:document-uri() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:document-uri()
    - Returns the value of the document-uri property for $arg as defined by the dm:document-uri accessor function defined in Section 6.1.2 AccessorsDM.
    + Returns the value of the document-uri property for $arg as defined by the + dm:document-uri accessor function defined in Section 6.1.2 AccessorsDM.
    If $arg is the empty sequence, the empty sequence is returned.
    - Returns the empty sequence if the node is not a document node. Otherwise, returns the value of the dm:document-uri accessor of the document node.
    + Returns the empty sequence if the node is not a document node. Otherwise, returns the + value of the dm:document-uri accessor of the document node.
    - In the case of a document node $D returned by the fn:doc function, or a document node at the root of a tree containing a node returned by the fn:collection function, it will always be true that either fn:document-uri($D) returns the empty sequence, or that the following expression is true: fn:doc(fn:document-uri($D)) is $D. It is implementation-defined whether this guarantee also holds for document nodes obtained by other means, for example a document node passed as the initial context node of a query or transformation.
    + In the case of a document node $D returned by the fn:doc function, or a document node at + the root of a tree containing a node returned by the fn:collection function, it will + always be true that either fn:document-uri($D) returns the empty sequence, or that the + following expression is true: fn:doc(fn:document-uri($D)) is $D. It is + implementation-defined whether this guarantee also holds for document nodes obtained by + other means, for example a document node passed as the initial context node of a query + or transformation.

    Arguments: @@ -883,21 +1145,32 @@ document-uri(/library/fiction:book[1]) - http://example.com/library.xml (assuming the document URI of the first fiction:book element is "http://example.com/library.xml") + http://example.com/library.xml (assuming the document URI of the first + fiction:book element is "http://example.com/library.xml") document-uri(/library) - http://example.com/library.xml (assuming the document URI of the library element is "http://example.com/library.xml") + http://example.com/library.xml (assuming the document URI of the library + element is "http://example.com/library.xml")
    - W3C Documentation reference + W3C Documentation reference
    fn:lang() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:lang()
    - This function tests whether the language of $node, or the context item if the second argument is omitted, as specified by xml:lang attributes is the same as, or is a sublanguage of, the language specified by $testlang. The behavior of the function if the second argument is omitted is exactly the same as if the context item (.) had been passed as the second argument. The language of the argument node, or the context item if the second argument is omitted, is determined by the value of the xml:lang attribute on the node, or, if the node has no such attribute, by the value of the xml:lang attribute on the nearest ancestor of the node that has an xml:lang attribute. If there is no such ancestor, then the function returns false

    + This function tests whether the language of $node, or the context item if the second + argument is omitted, as specified by xml:lang attributes is the same as, or is a + sublanguage of, the language specified by $testlang. The behavior of the function if the + second argument is omitted is exactly the same as if the context item (.) had been + passed as the second argument. The language of the argument node, or the context item if + the second argument is omitted, is determined by the value of the xml:lang attribute on + the node, or, if the node has no such attribute, by the value of the xml:lang attribute + on the nearest ancestor of the node that has an xml:lang attribute. If there is no such + ancestor, then the function returns false

    Arguments: @@ -918,21 +1191,26 @@ Examples: Look W3C documentation below.
    - W3C Documentation reference + W3C Documentation referencefn:root() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:root()
    - Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.
    + Returns the root of the tree to which $arg belongs. This will usually, but not + necessarily, be a document node.
    If $arg is the empty sequence, the empty sequence is returned.
    If $arg is a document node, $arg is returned.
    - If the function is called without an argument, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
    + If the function is called without an argument, the context item (.) is used as the + default argument. The behavior of the function if the argument is omitted is exactly the + same as if the context item had been passed as the argument.
    - The following errors may be raised: if the context item is undefined [err:XPDY0002]; if the context item is not a node [err:XPTY0004].

    + The following errors may be raised: if the context item is undefined [err:XPDY0002]; if + the context item is not a node [err:XPTY0004].

    Arguments:
    @@ -958,13 +1236,15 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:count() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:count()
    - Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

    + Returns the number of items in the value of $arg. Returns 0 if $arg is the empty + sequence.

    Arguments: @@ -994,14 +1274,16 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:avg() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:avg()
    - Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.

    + Returns the number of items in the value of $arg. Returns 0 if $arg is the empty + sequence.

    Arguments: @@ -1027,14 +1309,17 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:max() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:max()
    - Selects an item from the input sequence $arg whose value is greater than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is ·implementation dependent·.

    + Selects an item from the input sequence $arg whose value is greater than or equal to the + value of every other item in the input sequence. If there are two or more such items, + then the specific item whose value is returned is ·implementation dependent·.

    Arguments: @@ -1068,13 +1353,16 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:min() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:min()
    - Selects an item from the input sequence $arg whose value is less than or equal to the value of every other item in the input sequence. If there are two or more such items, then the specific item whose value is returned is ·implementation dependent·.

    + Selects an item from the input sequence $arg whose value is less than or equal to the + value of every other item in the input sequence. If there are two or more such items, + then the specific item whose value is returned is ·implementation dependent·.

    Arguments: @@ -1108,16 +1396,21 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:sum() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:sum()
    - Returns a value obtained by adding together the values in $arg. If $zero is not specified, then the value returned for an empty sequence is the xs:integer value 0. If $zero is specified, then the value returned for an empty sequence is $zero.
    + Returns a value obtained by adding together the values in $arg. If $zero is not + specified, then the value returned for an empty sequence is the xs:integer value 0. If + $zero is specified, then the value returned for an empty sequence is $zero.
    - Any values of type xs:untypedAtomic in $arg are cast to xs:double. The items in the resulting sequence may be reordered in an arbitrary order. The resulting sequence is referred to below as the converted sequence.

    + Any values of type xs:untypedAtomic in $arg are cast to xs:double. The items in the + resulting sequence may be reordered in an arbitrary order. The resulting sequence is + referred to below as the converted sequence.

    Arguments: @@ -1147,9 +1440,10 @@

    - W3C Documentation reference + W3C Documentation reference
    - +
    @@ -1157,26 +1451,33 @@
    - - + + fn:boolean() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:boolean()
    - Computes the effective boolean value of the sequence $arg. See Section 2.4.3 Effective Boolean ValueXP
    + Computes the effective boolean value of the sequence $arg. See Section 2.4.3 Effective + Boolean ValueXP
    If $arg is the empty sequence, fn:boolean returns false.
    If $arg is a sequence whose first item is a node, fn:boolean returns true.
    - If $arg is a singleton value of type xs:boolean or a derived from xs:boolean, fn:boolean returns $arg.
    + If $arg is a singleton value of type xs:boolean or a derived from xs:boolean, fn:boolean + returns $arg.
    - If $arg is a singleton value of type xs:string or a type derived from xs:string, xs:anyURI or a type derived from xs:anyURI or xs:untypedAtomic, fn:boolean returns false if the operand value has zero length; otherwise it returns true.
    + If $arg is a singleton value of type xs:string or a type derived from xs:string, + xs:anyURI or a type derived from xs:anyURI or xs:untypedAtomic, fn:boolean returns false + if the operand value has zero length; otherwise it returns true.
    - If $arg is a singleton value of any numeric type or a type derived from a numeric type, fn:boolean returns false if the operand value is NaN or is numerically equal to zero; otherwise it returns true. + If $arg is a singleton value of any numeric type or a type derived from a numeric type, + fn:boolean returns false if the operand value is NaN or is numerically equal to zero; + otherwise it returns true. In all other cases, fn:boolean raises a type error [err:FORG0006].
    - The static semantics of this function are described in Section 7.2.4 The fn:boolean and fn:not functionsFS.

    + The static semantics of this function are described in Section 7.2.4 The fn:boolean and + fn:not functionsFS.

    Arguments: @@ -1210,15 +1511,16 @@

    - W3C Documentation reference + W3C Documentation reference
    - + fn:true()
    Returns the xs:boolean value true. Equivalent to xs:boolean("1").

    - + Return type: xs:boolean

    Examples:
    @@ -1231,7 +1533,8 @@
    true

    - W3C Documentation reference + W3C Documentation reference
    false
    -
    W3C Documentation reference + W3C Documentation reference
    fn:not()
    - $arg is first reduced to an effective boolean value by applying the fn:boolean() function. Returns true if the effective boolean value is false, and false if the effective boolean value is true.

    - + $arg is first reduced to an effective boolean value by applying the fn:boolean() + function. Returns true if the effective boolean value is false, and false if the + effective boolean value is true.

    + Arguments and return type: @@ -1286,10 +1592,11 @@
    false

    - W3C Documentation reference + W3C Documentation reference
    - - + +
    @@ -1297,123 +1604,140 @@
    - + fn:string(object)
    - Returns the value of $arg represented as a xs:string. If no argument is supplied, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
    + Returns the value of $arg represented as a xs:string. If no argument is supplied, the + context item (.) is used as the default argument. The behavior of the function if the + argument is omitted is exactly the same as if the context item had been passed as the + argument.
    - If the context item is undefined, error [err:XPDY0002]XP is raised.
    - - If $arg is the empty sequence, the zero-length string is returned.
    - - If $arg is a node, the function returns the string-value of the node, as obtained using the dm:string-value accessor defined in the Section 5.13 string-value AccessorDM.
    - - If $arg is an atomic value, then the function returns the same string as is returned by the expression " $arg cast as xs:string " (see 17 Casting).
    - Arguments and return type: - - - - - - - - - -
    TypeDescription
    stringThe object to convert to a string
    - Return type: xs:string

    - Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    string((1<0))false
    string(.11)0.11

    - W3C Documentation reference + If the context item is undefined, error [err:XPDY0002]XP is raised.
    + + If $arg is the empty sequence, the zero-length string is returned.
    + + If $arg is a node, the function returns the string-value of the node, as obtained using + the dm:string-value accessor defined in the Section 5.13 string-value AccessorDM.
    + + If $arg is an atomic value, then the function returns the same string as is returned by + the expression " $arg cast as xs:string " (see 17 Casting).
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    stringThe object to convert to a string
    + Return type: xs:string

    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    string((1<0))false
    string(.11)0.11

    + W3C Documentation reference
    - + fn:codepoints-to-string()
    - Creates an xs:string from a sequence of The Unicode Standard code points. Returns the zero-length string if $arg is the empty sequence. If any of the code points in $arg is not a legal XML character, an error is raised [err:FOCH0001].
    - Arguments and return type: - - - - - - - - - -
    TypeDescription
    xs:integer*$arg
    - Return type: xs:string

    - Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    codepoints-to-string((2309, 2358, 2378, 2325))अशॊक
    codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41))( ͡° ͜ʖ ͡°)

    - W3C Documentation reference + Creates an xs:string from a sequence of The Unicode Standard code points. Returns the + zero-length string if $arg is the empty sequence. If any of the code points in $arg is + not a legal XML character, an error is raised [err:FOCH0001].
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:integer*$arg
    + Return type: xs:string

    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    codepoints-to-string((2309, 2358, 2378, 2325))अशॊक
    codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)) + ( ͡° ͜ʖ ͡°)

    + W3C Documentation reference
    fn:string-to-codepoints()
    - Returns the sequence of The Unicode Standard code points that constitute an xs:string. If $arg is a zero-length string or the empty sequence, the empty sequence is returned.
    - Arguments and return type: - - - - - - - - - -
    TypeDescription
    xs:string*$arg
    - Return type: xs:integer*

    - Examples:
    - - - - - - - - - -
    ExpressionResult
    string-to-codepoints("Thérèse")(84, 104, 233, 114, 232, 115, 101)

    - W3C Documentation reference + Returns the sequence of The Unicode Standard code points that constitute an xs:string. + If $arg is a zero-length string or the empty sequence, the empty sequence is + returned.
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string*$arg
    + Return type: xs:integer*

    + Examples:
    + + + + + + + + + +
    ExpressionResult
    string-to-codepoints("Thérèse")(84, 104, 233, 114, 232, 115, 101)

    + W3C Documentation reference
    fn:compare()
    - Returns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively less than, equal to, or greater than the value of $comparand2, according to the rules of the collation that is used.
    + Returns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively + less than, equal to, or greater than the value of $comparand2, according to the rules of + the collation that is used.
    + + The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations.
    - The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations.
    - If either argument is the empty sequence, the result is the empty sequence.
    - - This function, invoked with the first signature, backs up the "eq", "ne", "gt", "lt", "le" and "ge" operators on string values.
    + + This function, invoked with the first signature, backs up the "eq", "ne", "gt", "lt", + "le" and "ge" operators on string values.
    Arguments and return type: @@ -1453,13 +1777,17 @@
    1

    - W3C Documentation reference + W3C Documentation reference
    fn:codepoint-equal()
    - Returns true or false depending on whether the value of $comparand1 is equal to the value of $comparand2, according to the Unicode code point collation.
    + Returns true or false depending on whether the value of $comparand1 is equal to the + value of $comparand2, according to the Unicode code + point collation.
    If either argument is the empty sequence, the result is the empty sequence.
    Arguments and return type: @@ -1493,15 +1821,22 @@ false
    - W3C Documentation reference + W3C Documentation reference
    fn:concat()
    - Accepts two or more xs:anyAtomicType arguments and casts them to xs:string. Returns the xs:string that is the concatenation of the values of its arguments after conversion. If any of the arguments is the empty sequence, the argument is treated as the zero-length string.
    + Accepts two or more xs:anyAtomicType arguments and casts them to xs:string. Returns the + xs:string that is the concatenation of the values of its arguments after conversion. If + any of the arguments is the empty sequence, the argument is treated as the zero-length + string.
    - The fn:concat function is specified to allow two or more arguments, which are concatenated together. This is the only function specified in this document that allows a variable number of arguments. This capability is retained for compatibility with [XML Path Language (XPath) Version 1.0].
    + The fn:concat function is specified to allow two or more arguments, which are + concatenated together. This is the only function specified in this document that allows + a variable number of arguments. This capability is retained for compatibility with [XML + Path Language (XPath) Version 1.0].
    Arguments and return type: @@ -1533,7 +1868,8 @@ - + @@ -1541,13 +1877,16 @@
    ungrateful
    concat('Thy ', (), 'old ', "groans", "", ' ring', ' yet', ' in', ' my', ' ancient',' ears.')concat('Thy ', (), 'old ', "groans", "", ' ring', ' yet', ' in', ' my', ' + ancient',' ears.') Thy old groans ring yet in my ancient ears.
    Ciao!

    - W3C Documentation reference + W3C Documentation reference
    fn:string-join()
    - Returns a xs:string created by concatenating the members of the $arg1 sequence using $arg2 as a separator. If the value of $arg2 is the zero-length string, then the members of $arg1 are concatenated without a separator.
    + Returns a xs:string created by concatenating the members of the $arg1 sequence using + $arg2 as a separator. If the value of $arg2 is the zero-length string, then the members + of $arg1 are concatenated without a separator.
    If the value of $arg1 is the empty sequence, the zero-length string is returned.
    Arguments and return type: @@ -1581,19 +1920,28 @@ Blow, blow, thou winter wind!
    - W3C Documentation reference + W3C Documentation reference
    - + fn:substring()
    - Returns the portion of the value of $sourceString beginning at the position indicated by the value of $startingLoc and continuing for the number of characters indicated by the value of $length. The characters returned do not extend beyond $sourceString. If $startingLoc is zero or negative, only those characters in positions greater than zero are returned.
    - More specifically, the three argument version of the function returns the characters in $sourceString whose position $p obeys:
    + Returns the portion of the value of $sourceString beginning at the position indicated by + the value of $startingLoc and continuing for the number of characters indicated by the + value of $length. The characters returned do not extend beyond $sourceString. If + $startingLoc is zero or negative, only those characters in positions greater than zero + are returned.
    + More specifically, the three argument version of the function returns the characters in + $sourceString whose position $p obeys:
    fn:round($startingLoc) <= $p < fn:round($startingLoc) + fn:round($length)
    - The two argument version of the function assumes that $length is infinite and returns the characters in $sourceString whose position $p obeys:
    + The two argument version of the function assumes that $length is infinite and returns + the characters in $sourceString whose position $p obeys:
    fn:round($startingLoc) <= $p < fn:round(INF)
    - In the above computations, the rules for op:numeric-less-than() and op:numeric-greater-than() apply.
    - If the value of $sourceString is the empty sequence, the zero-length string is returned.
    + In the above computations, the rules for op:numeric-less-than() and + op:numeric-greater-than() apply.
    + If the value of $sourceString is the empty sequence, the zero-length string is + returned.
    Note:
    The first character of a string is located at position 1, not position 0.
    @@ -1633,7 +1981,8 @@ ada
    - W3C Documentation reference + W3C Documentation reference
    - If no argument is supplied, $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
    + If no argument is supplied, $arg defaults to the string value (calculated using + fn:string()) of the context item (.). If no argument is supplied and the context item is + undefined an error is raised: [err:XPDY0002].
    Arguments and return type: @@ -1672,17 +2023,22 @@
    0

    -
    W3C Documentation reference + W3C Documentation reference
    fn:normalize-space()
    - Returns the value of $arg with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of one or more than one whitespace character with a single space, #x20.
    + Returns the value of $arg with whitespace normalized by stripping leading and trailing + whitespace and replacing sequences of one or more than one whitespace character with a + single space, #x20.
    If the value of $arg is the empty sequence, returns the zero-length string.
    - If no argument is supplied, then $arg defaults to the string value (calculated using fn:string()) of the context item (.). If no argument is supplied and the context item is undefined an error is raised: [err:XPDY0002].
    + If no argument is supplied, then $arg defaults to the string value (calculated using + fn:string()) of the context item (.). If no argument is supplied and the context item is + undefined an error is raised: [err:XPDY0002].
    Arguments and return type: @@ -1703,7 +2059,7 @@ - + @@ -1711,13 +2067,17 @@
    Result
    normalize-space(" The wealthy curled darlings of our nation. ")normalize-space(" The wealthy curled darlings of our nation. ") The wealthy curled darlings of our nation.
    ""

    - W3C Documentation reference + W3C Documentation reference
    fn:normalize-unicode()
    - Returns the value of $arg normalized according to the normalization criteria for a normalization form identified by the value of $normalizationForm. The effective value of the $normalizationForm is computed by removing leading and trailing blanks, if present, and converting to upper case.
    + Returns the value of $arg normalized according to the normalization criteria for a + normalization form identified by the value of $normalizationForm. The effective value of + the $normalizationForm is computed by removing leading and trailing blanks, if present, + and converting to upper case.
    If the value of $arg is the empty sequence, returns the zero-length string.
    @@ -1744,17 +2104,26 @@ Result - normalize-unicode("test ") + normalize-unicode("test ") test
    - W3C Documentation reference + W3C Documentation reference
    fn:upper-case()
    - Returns the value of $arg after translating every character to its upper-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every lower-case character that does not have an upper-case correspondent, as well as every upper-case character, is included in the returned value in its original form.
    + Returns the value of $arg after translating every character to its upper-case + correspondent as defined in the appropriate case mappings section in the Unicode + standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 + update, only locale-insensitive case mappings should be applied. Beginning with version + 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default + case operations, which are full case mappings in the absence of tailoring for particular + languages and environments. Every lower-case character that does not have an upper-case + correspondent, as well as every upper-case character, is included in the returned value + in its original form.
    If the value of $arg is the empty sequence, the zero-length string is returned.
    @@ -1781,13 +2150,22 @@ ABCD0
    - W3C Documentation reference + W3C Documentation reference
    fn:lower-case()
    - Returns the value of $arg after translating every character to its lower-case correspondent as defined in the appropriate case mappings section in the Unicode standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 update, only locale-insensitive case mappings should be applied. Beginning with version 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default case operations, which are full case mappings in the absence of tailoring for particular languages and environments. Every upper-case character that does not have a lower-case correspondent, as well as every lower-case character, is included in the returned value in its original form.
    + Returns the value of $arg after translating every character to its lower-case + correspondent as defined in the appropriate case mappings section in the Unicode + standard [The Unicode Standard]. For versions of Unicode beginning with the 2.1.8 + update, only locale-insensitive case mappings should be applied. Beginning with version + 3.2.0 (and likely future versions) of Unicode, precise mappings are described in default + case operations, which are full case mappings in the absence of tailoring for particular + languages and environments. Every upper-case character that does not have a lower-case + correspondent, as well as every lower-case character, is included in the returned value + in its original form.
    If the value of $arg is the empty sequence, the zero-length string is returned.
    @@ -1814,21 +2192,30 @@ abcd0
    - W3C Documentation reference + W3C Documentation reference
    fn:translate()
    - Returns the value of $arg modified so that every character in the value of $arg that occurs at some position N in the value of $mapString has been replaced by the character that occurs at position N in the value of $transString.
    + Returns the value of $arg modified so that every character in the value of $arg that + occurs at some position N in the value of $mapString has been replaced by the character + that occurs at position N in the value of $transString.
    If the value of $arg is the empty sequence, the zero-length string is returned.
    - Every character in the value of $arg that does not appear in the value of $mapString is unchanged.
    + Every character in the value of $arg that does not appear in the value of $mapString is + unchanged.
    - Every character in the value of $arg that appears at some position M in the value of $mapString, where the value of $transString is less than M characters in length, is omitted from the returned value. If $mapString is the zero-length string $arg is returned.
    + Every character in the value of $arg that appears at some position M in the value of + $mapString, where the value of $transString is less than M characters in length, is + omitted from the returned value. If $mapString is the zero-length string $arg is + returned.
    - If a character occurs more than once in $mapString, then the first occurrence determines the replacement character. If $transString is longer than $mapString, the excess characters are ignored.
    + If a character occurs more than once in $mapString, then the first occurrence determines + the replacement character. If $transString is longer than $mapString, the excess + characters are ignored.
    Arguments and return type: @@ -1869,21 +2256,32 @@
    ABdAB

    - W3C Documentation reference + W3C Documentation reference
    fn:encode-for-uri()
    - This function encodes reserved characters in an xs:string that is intended to be used in the path segment of a URI. It is invertible but not idempotent. This function applies the URI escaping rules defined in section 2 of [RFC 3986] to the xs:string supplied as $uri-part. The effect of the function is to escape reserved characters. Each such character in the string is replaced with its percent-encoded form as described in [RFC 3986].
    + This function encodes reserved characters in an xs:string that is intended to be used in + the path segment of a URI. It is invertible but not idempotent. This function applies + the URI escaping rules defined in section 2 of [RFC 3986] to the xs:string supplied as + $uri-part. The effect of the function is to escape reserved characters. Each such + character in the string is replaced with its percent-encoded form as described in [RFC + 3986].
    If $uri-part is the empty sequence, returns the zero-length string.
    - All characters are escaped except those identified as "unreserved" by [RFC 3986], that is the upper- and lower-case letters A-Z, the digits 0-9, HYPHEN-MINUS ("-"), LOW LINE ("_"), FULL STOP ".", and TILDE "~".
    + All characters are escaped except those identified as "unreserved" by [RFC 3986], that + is the upper- and lower-case letters A-Z, the digits 0-9, HYPHEN-MINUS ("-"), LOW LINE + ("_"), FULL STOP ".", and TILDE "~".
    - Note that this function escapes URI delimiters and therefore cannot be used indiscriminately to encode "invalid" characters in a path segment.
    + Note that this function escapes URI delimiters and therefore cannot be used + indiscriminately to encode "invalid" characters in a path segment.
    - Since [RFC 3986] recommends that, for consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings, this function must always generate hexadecimal values using the upper-case letters A-F.
    + Since [RFC 3986] recommends that, for consistency, URI producers and normalizers should + use uppercase hexadecimal digits for all percent-encodings, this function must always + generate hexadecimal values using the upper-case letters A-F.
    Arguments and return type: @@ -1916,16 +2314,20 @@
    http://www.example.com/
    100%25%20organic

    - W3C Documentation reference + W3C Documentation reference
    fn:iri-to-uri()
    - This function converts an xs:string containing an IRI into a URI according to the rules spelled out in Section 3.1 of [RFC 3987]. It is idempotent but not invertible.
    + This function converts an xs:string containing an IRI into a URI according to the rules + spelled out in Section 3.1 of [RFC 3987]. It is idempotent but not invertible.
    + + If $iri contains a character that is invalid in an IRI, such as the space character (see + note below), the invalid character is replaced by its percent-encoded form as described + in [RFC 3986] before the conversion is performed.
    - If $iri contains a character that is invalid in an IRI, such as the space character (see note below), the invalid character is replaced by its percent-encoded form as described in [RFC 3986] before the conversion is performed.
    - If $iri is the empty sequence, returns the zero-length string.
    Arguments and return type: @@ -1955,17 +2357,26 @@ http://www.example.com/
    ~b%C3%A9b%C3%A9
    - W3C Documentation reference + W3C Documentation reference
    fn:escape-html-uri()
    - This function escapes all characters except printable characters of the US-ASCII coded character set, specifically the octets ranging from 32 to 126 (decimal). The effect of the function is to escape a URI in the manner html user agents handle attribute values that expect URIs. Each character in $uri to be escaped is replaced by an escape sequence, which is formed by encoding the character as a sequence of octets in UTF-8, and then representing each of these octets in the form %HH, where HH is the hexadecimal representation of the octet. This function must always generate hexadecimal values using the upper-case letters A-F.
    + This function escapes all characters except printable characters of the US-ASCII coded + character set, specifically the octets ranging from 32 to 126 (decimal). The effect of + the function is to escape a URI in the manner html user agents handle attribute values + that expect URIs. Each character in $uri to be escaped is replaced by an escape + sequence, which is formed by encoding the character as a sequence of octets in UTF-8, + and then representing each of these octets in the form %HH, where HH is the hexadecimal + representation of the octet. This function must always generate hexadecimal values using + the upper-case letters A-F.
    If $uri is the empty sequence, returns the zero-length string.

    Note:

    - The behavior of this function corresponds to the recommended handling of non-ASCII characters in URI attribute values as described in [HTML 4.0] Appendix B.2.1.

    + The behavior of this function corresponds to the recommended handling of non-ASCII + characters in URI attribute values as described in [HTML 4.0] Appendix B.2.1.

    Arguments and return type: @@ -1987,25 +2398,33 @@ Result - escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean") + escape-html-uri("http://www.example.com/00/Weather/CA/Los Angeles#ocean") + http://www.example.com/00/Weather/CA/Los Angeles#ocean
    - W3C Documentation reference + W3C Documentation reference
    fn:contains()
    - Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the beginning, at the end, or anywhere within) at least one sequence of collation units that provides a minimal match to the collation units in the value of $arg2, according to the collation that is used. + Returns an xs:boolean indicating whether or not the value of $arg1 contains (at the + beginning, at the end, or anywhere within) at least one sequence of collation units that + provides a minimal match to the collation units in the value of $arg2, according to the + collation that is used. - If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
    + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
    If the value of $arg2 is the zero-length string, then the function returns true.
    If the value of $arg1 is the zero-length string, the function returns false.
    - The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

    + The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations. If the specified collation does not support collation units + an error ·may· be raised [err:FOCH0004].

    Arguments and return type: @@ -2047,19 +2466,27 @@ true
    - W3C Documentation reference + W3C Documentation reference
    fn:starts-with()
    - Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used. + Returns an xs:boolean indicating whether or not the value of $arg1 starts with a + sequence of collation units that provides a match to the collation units of $arg2 + according to the collation that is used. - If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
    + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
    - If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
    + If the value of $arg2 is the zero-length string, then the function returns true. If the + value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length + string, then the function returns false.
    - The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

    + The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations. If the specified collation does not support collation units + an error ·may· be raised [err:FOCH0004].

    Arguments and return type: @@ -2101,19 +2528,27 @@ true
    - W3C Documentation reference + W3C Documentation reference
    fn:ends-with()
    - Returns an xs:boolean indicating whether or not the value of $arg1 starts with a sequence of collation units that provides a match to the collation units of $arg2 according to the collation that is used.
    + Returns an xs:boolean indicating whether or not the value of $arg1 starts with a + sequence of collation units that provides a match to the collation units of $arg2 + according to the collation that is used.
    - If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
    + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
    - If the value of $arg2 is the zero-length string, then the function returns true. If the value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length string, then the function returns false.
    + If the value of $arg2 is the zero-length string, then the function returns true. If the + value of $arg1 is the zero-length string and the value of $arg2 is not the zero-length + string, then the function returns false.
    - The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

    + The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations. If the specified collation does not support collation units + an error ·may· be raised [err:FOCH0004].

    Arguments and return type: @@ -2155,21 +2590,29 @@ true
    - W3C Documentation reference + W3C Documentation reference
    fn:substring-before()
    - Returns the substring of the value of $arg1 that precedes in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
    + Returns the substring of the value of $arg1 that precedes in the value of $arg1 the + first occurrence of a sequence of collation units that provides a minimal match to the + collation units of $arg2 according to the collation that is used.
    - If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
    + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
    - If the value of $arg2 is the zero-length string, then the function returns the zero-length string.
    + If the value of $arg2 is the zero-length string, then the function returns the + zero-length string.
    - If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
    + If the value of $arg1 does not contain a string that is equal to the value of $arg2, + then the function returns the zero-length string.
    - The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

    + The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations If the specified collation does not support collation units an + error ·may· be raised [err:FOCH0004].

    Arguments and return type: @@ -2207,21 +2650,29 @@ <empty string>
    - W3C Documentation reference + W3C Documentation reference
    fn:substring-after()
    - Returns the substring of the value of $arg1 that follows in the value of $arg1 the first occurrence of a sequence of collation units that provides a minimal match to the collation units of $arg2 according to the collation that is used.
    + Returns the substring of the value of $arg1 that follows in the value of $arg1 the first + occurrence of a sequence of collation units that provides a minimal match to the + collation units of $arg2 according to the collation that is used.
    - If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
    + If the value of $arg1 or $arg2 is the empty sequence, or contains only ignorable + collation units, it is interpreted as the zero-length string.
    - If the value of $arg2 is the zero-length string, then the function returns the value of $arg1.
    + If the value of $arg2 is the zero-length string, then the function returns the value of + $arg1.
    - If the value of $arg1 does not contain a string that is equal to the value of $arg2, then the function returns the zero-length string.
    + If the value of $arg1 does not contain a string that is equal to the value of $arg2, + then the function returns the zero-length string.
    - The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations If the specified collation does not support collation units an error ·may· be raised [err:FOCH0004].

    + The collation used by the invocation of this function is determined according to the + rules in 7.3.1 Collations If the specified collation does not support collation units an + error ·may· be raised [err:FOCH0004].

    Arguments and return type: @@ -2259,23 +2710,32 @@ too
    - W3C Documentation reference + W3C Documentation reference
    fn:matches()
    - The function returns true if $input matches the regular expression supplied as $pattern as influenced by the value of $flags, if present; otherwise, it returns false.
    + The function returns true if $input matches the regular expression supplied as $pattern + as influenced by the value of $flags, if present; otherwise, it returns false.
    - The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
    + The effect of calling the first version of this function (omitting the argument $flags) + is the same as the effect of calling the second version with the $flags argument set to + a zero-length string. Flags are defined in 7.6.1.1 Flags.
    If $input is the empty sequence, it is interpreted as the zero-length string.
    - Unless the metacharacters ^ and $ are used as anchors, the string is considered to match the pattern if any substring matches the pattern. But if anchors are used, the anchors must match the start/end of the string (in string mode), or the start/end of a line (in multiline mode).
    + Unless the metacharacters ^ and $ are used as anchors, the string is considered to match + the pattern if any substring matches the pattern. But if anchors are used, the anchors + must match the start/end of the string (in string mode), or the start/end of a line (in + multiline mode).
    - An error is raised [err:FORX0002] if the value of $pattern is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.
    + An error is raised [err:FORX0002] if the value of $pattern is invalid according to the + rules described in section 7.6.1 Regular Expression Syntax.
    - An error is raised [err:FORX0001] if the value of $flags is invalid according to the rules described in section 7.6.1 Regular Expression Syntax.

    + An error is raised [err:FORX0001] if the value of $flags is invalid according to the + rules described in section 7.6.1 Regular Expression Syntax.

    Arguments and return type: @@ -2313,23 +2773,36 @@ false
    - W3C Documentation reference + W3C Documentation reference
    fn:replace()
    - The function returns the xs:string that is obtained by replacing each non-overlapping substring of $input that matches the given $pattern with an occurrence of the $replacement string.
    + The function returns the xs:string that is obtained by replacing each non-overlapping + substring of $input that matches the given $pattern with an occurrence of the + $replacement string.
    - The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
    + The effect of calling the first version of this function (omitting the argument $flags) + is the same as the effect of calling the second version with the $flags argument set to + a zero-length string. Flags are defined in 7.6.1.1 Flags.
    - The $flags argument is interpreted in the same manner as for the fn:matches() function.
    + The $flags argument is interpreted in the same manner as for the fn:matches() + function.
    If $input is the empty sequence, it is interpreted as the zero-length string.
    - If two overlapping substrings of $input both match the $pattern, then only the
    first one (that is, the one whose first character comes first in the $input string) is replaced. + If two overlapping substrings of $input both match the $pattern, then only the
    first + one (that is, the one whose first character comes first in the $input string) is + replaced. - Within the $replacement string, a variable $N may be used to refer to the substring captured by the Nth parenthesized sub-expression in the regular expression. For each match of the pattern, these variables are assigned the value of the content matched by the relevant sub-expression, and the modified replacement string is then substituted for the characters in $input that matched the pattern. $0 refers to the substring captured by the regular expression as a whole.

    + Within the $replacement string, a variable $N may be used to refer to the substring + captured by the Nth parenthesized sub-expression in the regular expression. For each + match of the pattern, these variables are assigned the value of the content matched by + the relevant sub-expression, and the modified replacement string is then substituted for + the characters in $input that matched the pattern. $0 refers to the substring captured + by the regular expression as a whole.

    Arguments and return type: @@ -2375,23 +2848,33 @@ b
    - W3C Documentation reference + W3C Documentation reference
    fn:tokenize()
    - This function breaks the $input string into a sequence of strings, treating any substring that matches $pattern as a separator. The separators themselves are not returned.
    + This function breaks the $input string into a sequence of strings, treating any + substring that matches $pattern as a separator. The separators themselves are not + returned.
    - The effect of calling the first version of this function (omitting the argument $flags) is the same as the effect of calling the second version with the $flags argument set to a zero-length string. Flags are defined in 7.6.1.1 Flags.
    + The effect of calling the first version of this function (omitting the argument $flags) + is the same as the effect of calling the second version with the $flags argument set to + a zero-length string. Flags are defined in 7.6.1.1 Flags.
    The $flags argument is interpreted in the same way as for the fn:matches() function.
    - If $input is the empty sequence, or if $input is the zero-length string, the result is the empty sequence.
    + If $input is the empty sequence, or if $input is the zero-length string, the result is + the empty sequence.
    - If the supplied $pattern matches a zero-length string, that is, if fn:matches("", $pattern, $flags) returns true, then an error is raised: [err:FORX0003].
    + If the supplied $pattern matches a zero-length string, that is, if fn:matches("", + $pattern, $flags) returns true, then an error is raised: [err:FORX0003].
    - If a separator occurs at the start of the $input string, the result sequence will start with a zero-length string. Zero-length strings will also occur in the result sequence if a separator occurs at the end of the $input string, or if two adjacent substrings match the supplied $pattern.

    + If a separator occurs at the start of the $input string, the result sequence will start + with a zero-length string. Zero-length strings will also occur in the result sequence if + a separator occurs at the end of the $input string, or if two adjacent substrings match + the supplied $pattern.

    Arguments and return type: @@ -2433,7 +2916,8 @@ ("1", "15", "", "24", "50", "")
    - W3C Documentation reference + W3C Documentation reference
    @@ -2443,18 +2927,25 @@
    - - + fn:number() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:number()
    - Returns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an xs:double
    + Returns the value indicated by $arg or, if $arg is not specified, the context item after + atomization, converted to an xs:double
    - Calling the zero-argument version of the function is defined to give the same result as calling the single-argument version with the context item (.). That is, fn:number() is equivalent to fn:number(.).
    + Calling the zero-argument version of the function is defined to give the same result as + calling the single-argument version with the context item (.). That is, fn:number() is + equivalent to fn:number(.).
    - If $arg is the empty sequence or if $arg or the context item cannot be converted to an xs:double, the xs:double value NaN is returned. If the context item is undefined an error is raised: [err:XPDY0002]XP.
    + If $arg is the empty sequence or if $arg or the context item cannot be converted to an + xs:double, the xs:double value NaN is returned. If the context item is undefined an + error is raised: [err:XPDY0002]XP.
    - If $arg is the empty sequence, NaN is returned. Otherwise, $arg, or the context item after atomization, is converted to an xs:double following the rules of 17.1.3.2 Casting to xs:double. If the conversion to xs:double fails, the xs:double value NaN is returned.
    + If $arg is the empty sequence, NaN is returned. Otherwise, $arg, or the context item + after atomization, is converted to an xs:double following the rules of 17.1.3.2 Casting + to xs:double. If the conversion to xs:double fails, the xs:double value NaN is + returned.

    Arguments: @@ -2469,17 +2960,25 @@ Return type: xs:double

    - W3C Documentation reference + W3C Documentation reference
    - + fn:abs() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:abs()
    - Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise returns $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
    + Returns the absolute value of $arg. If $arg is negative returns -$arg otherwise returns + $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal + or xs:integer the type of the result is the same as the type of $arg. If the type of + $arg is a type derived from one of the numeric types, the result is an instance of the + base numeric type.
    - For xs:float and xs:double arguments, if the argument is positive zero or negative zero, then positive zero is returned. If the argument is positive or negative infinity, positive infinity is returned.
    + For xs:float and xs:double arguments, if the argument is positive zero or negative zero, + then positive zero is returned. If the argument is positive or negative infinity, + positive infinity is returned.
    - For detailed type semantics, see Section 7.2.3 The fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions.
    + For detailed type semantics, see Section 7.2.3 The fn:abs, fn:ceiling, fn:floor, + fn:round, and fn:round-half-to-even functions.

    Arguments: @@ -2509,15 +3008,22 @@
    2137

    - W3C Documentation reference + W3C Documentation reference
    fn:ceiling() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:ceiling()
    - Returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
    + Returns the smallest (closest to negative infinity) number with no fractional part that + is not less than the value of $arg. If type of $arg is one of the four numeric types + xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the + type of $arg. If the type of $arg is a type derived from one of the numeric types, the + result is an instance of the base numeric type.
    - For xs:float and xs:double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero and greater than -1, negative zero is returned.
    + For xs:float and xs:double arguments, if the argument is positive zero, then positive + zero is returned. If the argument is negative zero, then negative zero is returned. If + the argument is less than zero and greater than -1, negative zero is returned.

    Arguments: @@ -2551,15 +3057,21 @@
    11

    - W3C Documentation reference + W3C Documentation reference
    fn:floor() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:floor()
    - Returns the largest (closest to positive infinity) number with no fractional part that is not greater than the value of $arg. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
    + Returns the largest (closest to positive infinity) number with no fractional part that + is not greater than the value of $arg. If type of $arg is one of the four numeric types + xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the + type of $arg. If the type of $arg is a type derived from one of the numeric types, the + result is an instance of the base numeric type.
    - For float and double arguments, if the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned.
    + For float and double arguments, if the argument is positive zero, then positive zero is + returned. If the argument is negative zero, then negative zero is returned.

    Arguments: @@ -2593,15 +3105,28 @@
    10

    - W3C Documentation reference + W3C Documentation reference
    fn:round() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:round()
    - Returns the number with no fractional part that is closest to the argument. If there are two such numbers, then the one that is closest to positive infinity is returned. If type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
    + Returns the number with no fractional part that is closest to the argument. If there are + two such numbers, then the one that is closest to positive infinity is returned. If type + of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer + the type of the result is the same as the type of $arg. If the type of $arg is a type + derived from one of the numeric types, the result is an instance of the base numeric + type.
    - For xs:float and xs:double arguments, if the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. In the cases where positive zero or negative zero is returned, negative zero or positive zero may be returned as [XML Schema Part 2: Datatypes Second Edition] does not distinguish between the values positive zero and negative zero.
    + For xs:float and xs:double arguments, if the argument is positive infinity, then + positive infinity is returned. If the argument is negative infinity, then negative + infinity is returned. If the argument is positive zero, then positive zero is returned. + If the argument is negative zero, then negative zero is returned. If the argument is + less than zero, but greater than or equal to -0.5, then negative zero is returned. In + the cases where positive zero or negative zero is returned, negative zero or positive + zero may be returned as [XML Schema Part 2: Datatypes Second Edition] does not + distinguish between the values positive zero and negative zero.
    For the last two cases, note that the result is not the same as fn:floor(x+0.5).

    @@ -2637,23 +3162,39 @@ -10
    - W3C Documentation reference + W3C Documentation reference
    fn:round-half-to-even() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:round-half-to-even()
    - The value returned is the nearest (that is, numerically closest) value to $arg that is a multiple of ten to the power of minus $precision. If two such values are equally near (e.g. if the fractional part in $arg is exactly .500...), the function returns the one whose least significant digit is even.
    + The value returned is the nearest (that is, numerically closest) value to $arg that is a + multiple of ten to the power of minus $precision. If two such values are equally near + (e.g. if the fractional part in $arg is exactly .500...), the function returns the one + whose least significant digit is even.
    - If the type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of $arg. If the type of $arg is a type derived from one of the numeric types, the result is an instance of the base numeric type.
    + If the type of $arg is one of the four numeric types xs:float, xs:double, xs:decimal or + xs:integer the type of the result is the same as the type of $arg. If the type of $arg + is a type derived from one of the numeric types, the result is an instance of the base + numeric type.
    - The first signature of this function produces the same result as the second signature with $precision=0.
    + The first signature of this function produces the same result as the second signature + with $precision=0.
    - For arguments of type xs:float and xs:double, if the argument is NaN, positive or negative zero, or positive or negative infinity, then the result is the same as the argument. In all other cases, the argument is cast to xs:decimal, the function is applied to this xs:decimal value, and the resulting xs:decimal is cast back to xs:float or xs:double as appropriate to form the function result. If the resulting xs:decimal value is zero, then positive or negative zero is returned according to the sign of the original argument.
    + For arguments of type xs:float and xs:double, if the argument is NaN, positive or + negative zero, or positive or negative infinity, then the result is the same as the + argument. In all other cases, the argument is cast to xs:decimal, the function is + applied to this xs:decimal value, and the resulting xs:decimal is cast back to xs:float + or xs:double as appropriate to form the function result. If the resulting xs:decimal + value is zero, then positive or negative zero is returned according to the sign of the + original argument.
    - Note that the process of casting to xs:decimal may result in an error [err:FOCA0001].
    + Note that the process of casting to xs:decimal may result in an error + [err:FOCA0001].
    - If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa computed with exponent = 0.
    + If $arg is of type xs:float or xs:double, rounding occurs on the value of the mantissa + computed with exponent = 0.

    Arguments: @@ -2695,30 +3236,35 @@
    3

    - W3C Documentation reference + W3C Documentation reference
    - +
    - +
    - + fn:data() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:data()
    fn:data takes a sequence of items and returns a sequence of atomic values.
    - The result of fn:data is the sequence of atomic values produced by applying the following rules to each item in $arg:
    + The result of fn:data is the sequence of atomic values produced by applying the + following rules to each item in $arg:
    • If the item is an atomic value, it is returned.
    • If the item is a node:
        -
      • If the node does not have a typed value an error is raised [err:FOTY0012].
      • -
      • Otherwise, fn:data() returns the typed value of the node as defined by the accessor function dm:typed-value in Section 5.15 typed-value AccessorDM.
      • +
      • If the node does not have a typed value an error is raised + [err:FOTY0012].
      • +
      • Otherwise, fn:data() returns the typed value of the node as defined by + the accessor function dm:typed-value in Section 5.15 typed-value + AccessorDM.
    @@ -2747,21 +3293,26 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:index-of() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:index-of()
    - Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.
    + Returns the root of the tree to which $arg belongs. This will usually, but not + necessarily, be a document node.
    If $arg is the empty sequence, the empty sequence is returned.
    If $arg is a document node, $arg is returned.
    - If the function is called without an argument, the context item (.) is used as the default argument. The behavior of the function if the argument is omitted is exactly the same as if the context item had been passed as the argument.
    + If the function is called without an argument, the context item (.) is used as the + default argument. The behavior of the function if the argument is omitted is exactly the + same as if the context item had been passed as the argument.
    - The following errors may be raised: if the context item is undefined [err:XPDY0002]; if the context item is not a node [err:XPTY0004].

    + The following errors may be raised: if the context item is undefined [err:XPDY0002]; if + the context item is not a node [err:XPTY0004].

    Arguments: @@ -2803,14 +3354,16 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:empty() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:empty()
    - If the value of $arg is the empty sequence, the function returns true; otherwise, the function returns false.

    + If the value of $arg is the empty sequence, the function returns true; otherwise, the + function returns false.

    Arguments: @@ -2836,14 +3389,16 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:exists() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:exists()
    - If the value of $arg is not the empty sequence, the function returns true; otherwise, the function returns false.

    + If the value of $arg is not the empty sequence, the function returns true; otherwise, + the function returns false.

    Arguments: @@ -2869,14 +3424,19 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:distinct-values() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:distinct-values()
    - Returns the sequence that results from removing from $arg all but one of a set of values that are eq to one other. Values of type xs:untypedAtomic are compared as if they were of type xs:string. Values that cannot be compared, i.e. the eq operator is not defined for their types, are considered to be distinct. The order in which the sequence of values is returned is ·implementation dependent·.

    + Returns the sequence that results from removing from $arg all but one of a set of values + that are eq to one other. Values of type xs:untypedAtomic are compared as if they were + of type xs:string. Values that cannot be compared, i.e. the eq operator is not defined + for their types, are considered to be distinct. The order in which the sequence of + values is returned is ·implementation dependent·.

    Arguments: @@ -2906,19 +3466,27 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:insert-before() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:insert-before()
    - Returns a new sequence constructed from the value of $target with the value of $inserts inserted at the position specified by the value of $position. (The value of $target is not affected by the sequence construction.)
    + Returns a new sequence constructed from the value of $target with the value of $inserts + inserted at the position specified by the value of $position. (The value of $target is + not affected by the sequence construction.)
    - If $target is the empty sequence, $inserts is returned. If $inserts is the empty sequence, $target is returned.
    + If $target is the empty sequence, $inserts is returned. If $inserts is the empty + sequence, $target is returned.
    - The value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $inserts, followed by the remaining elements of $target, in that sequence.
    + The value returned by the function consists of all items of $target whose index is less + than $position, followed by all items of $inserts, followed by the remaining elements of + $target, in that sequence.
    - If $position is less than one (1), the first position, the effective value of $position is one (1). If $position is greater than the number of items in $target, then the effective value of $position is equal to the number of items in $target plus 1.

    + If $position is less than one (1), the first position, the effective value of $position + is one (1). If $position is greater than the number of items in $target, then the + effective value of $position is equal to the number of items in $target plus 1.

    Arguments: @@ -2961,15 +3529,21 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:remove() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:remove()
    - Returns a new sequence constructed from the value of $target with the item at the position specified by the value of $position removed.
    + Returns a new sequence constructed from the value of $target with the item at the + position specified by the value of $position removed.
    - If $position is less than 1 or greater than the number of items in $target, $target is returned. Otherwise, the value returned by the function consists of all items of $target whose index is less than $position, followed by all items of $target whose index is greater than $position. If $target is the empty sequence, the empty sequence is returned.

    + If $position is less than 1 or greater than the number of items in $target, $target is + returned. Otherwise, the value returned by the function consists of all items of $target + whose index is less than $position, followed by all items of $target whose index is + greater than $position. If $target is the empty sequence, the empty sequence is + returned.

    Arguments: @@ -3008,14 +3582,16 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:reverse() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:reverse()
    - Reverses the order of items in a sequence. If $arg is the empty sequence, the empty sequence is returned.

    + Reverses the order of items in a sequence. If $arg is the empty sequence, the empty + sequence is returned.

    Arguments: @@ -3050,21 +3626,27 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:subsequence() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:subsequence()
    - Returns the contiguous sequence of items in the value of $sourceSeq beginning at the position indicated by the value of $startingLoc and continuing for the number of items indicated by the value of $length. + Returns the contiguous sequence of items in the value of $sourceSeq beginning at the + position indicated by the value of $startingLoc and continuing for the number of items + indicated by the value of $length. If $sourceSeq is the empty sequence, the empty sequence is returned.
    - If $startingLoc is zero or negative, the subsequence includes items from the beginning of the $sourceSeq.
    + If $startingLoc is zero or negative, the subsequence includes items from the beginning + of the $sourceSeq.
    - If $length is not specified, the subsequence includes items to the end of $sourceSeq.
    + If $length is not specified, the subsequence includes items to the end of + $sourceSeq.
    - If $length is greater than the number of items in the value of $sourceSeq following $startingLoc, the subsequence includes items to the end of $sourceSeq.
    + If $length is greater than the number of items in the value of $sourceSeq following + $startingLoc, the subsequence includes items to the end of $sourceSeq.
    The first item of a sequence is located at position 1, not position 0.

    @@ -3105,12 +3687,13 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:unordered() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:unordered()
    Returns the items of $sourceSeq in an implementation dependent order.

    @@ -3127,13 +3710,15 @@ Return type: item()*

    - W3C Documentation reference + W3C Documentation reference
    fn:zero-or-one() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:zero-or-one()
    - Returns $arg if it contains zero or one items. Otherwise, raises an error [err:FORG0003].

    + Returns $arg if it contains zero or one items. Otherwise, raises an error + [err:FORG0003].

    Arguments: @@ -3159,18 +3744,21 @@ - +
    zero-or-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:zero-or-one() ("a", "b") A sequence of more than one item is not allowed as the first argument of + fn:zero-or-one() ("a", "b")

    - W3C Documentation reference + W3C Documentation reference
    fn:one-or-more() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:one-or-more()
    - Returns $arg if it contains one or more items. Otherwise, raises an error [err:FORG0004].

    + Returns $arg if it contains one or more items. Otherwise, raises an error + [err:FORG0004].

    Arguments: @@ -3200,14 +3788,16 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:exactly-one() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:exactly-one()
    - Returns $arg if it contains exactly one item. Otherwise, raises an error [err:FORG0005].

    + Returns $arg if it contains exactly one item. Otherwise, raises an error + [err:FORG0005].

    Arguments: @@ -3233,25 +3823,36 @@ - +
    exactly-one(("a", "b"))A sequence of more than one item is not allowed as the first argument of fn:exactly-one() ("a", "b") A sequence of more than one item is not allowed as the first argument of + fn:exactly-one() ("a", "b")

    - W3C Documentation reference + W3C Documentation reference
    fn:deep-equal() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:deep-equal()
    - This function assesses whether two sequences are deep-equal to each other. To be deep-equal, they must contain items that are pairwise deep-equal; and for two items to be deep-equal, they must either be atomic values that compare equal, or nodes of the same kind, with the same name, whose children are deep-equal. This is defined in more detail below. The $collation argument identifies a collation which is used at all levels of recursion when strings are compared (but not when names are compared), according to the rules in 7.3.1 Collations.
    + This function assesses whether two sequences are deep-equal to each other. To be + deep-equal, they must contain items that are pairwise deep-equal; and for two items to + be deep-equal, they must either be atomic values that compare equal, or nodes of the + same kind, with the same name, whose children are deep-equal. This is defined in more + detail below. The $collation argument identifies a collation which is used at all levels + of recursion when strings are compared (but not when names are compared), according to + the rules in 7.3.1 Collations.
    If the two sequences are both empty, the function returns true.
    - + If the two sequences are of different lengths, the function returns false.
    - - If the two sequences are of the same length, the function returns true if and only if every item in the sequence $parameter1 is deep-equal to the item at the same position in the sequence $parameter2. The rules for deciding whether two items are deep-equal follow. - + + If the two sequences are of the same length, the function returns true if and only if + every item in the sequence $parameter1 is deep-equal to the item at the same position in + the sequence $parameter2. The rules for deciding whether two items are deep-equal + follow. + For more in-depth description look into W3C Documentation

    Arguments: @@ -3290,18 +3891,23 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:id() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:id()
    - Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg. + Returns the sequence of element nodes that have an ID value matching the value of one or + more of the IDREF values supplied in $arg.

    Note:

    - This function does not have the desired effect when searching a document in which elements of type xs:ID are used as identifiers. To preserve backwards compatibility, a new function fn:element-with-id is therefore being introduced; it behaves the same way as fn:id in the case of ID-valued attributes. + This function does not have the desired effect when searching a document in which + elements of type xs:ID are used as identifiers. To preserve backwards compatibility, a + new function fn:element-with-id is therefore being introduced; it behaves the same way + as fn:id in the case of ID-valued attributes.

    Arguments: @@ -3325,13 +3931,15 @@ Return type: element()*

    - W3C Documentation reference + W3C Documentation reference
    fn:idref() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:idref()
    - Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

    + Returns the sequence of element or attribute nodes with an IDREF value matching the + value of one or more of the ID values supplied in $arg.

    Arguments: @@ -3354,14 +3962,16 @@
    Return type: node()*

    - W3C Documentation reference + W3C Documentation reference
    fn:doc() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:doc()
    - Returns the sequence of element or attribute nodes with an IDREF value matching the value of one or more of the ID values supplied in $arg.

    + Returns the sequence of element or attribute nodes with an IDREF value matching the + value of one or more of the ID values supplied in $arg.

    Arguments: @@ -3387,20 +3997,24 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:doc-available() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:doc-available()
    - Retrieves a document using a URI supplied as an xs:string, and returns the corresponding document node.
    + Retrieves a document using a URI supplied as an xs:string, and returns the corresponding + document node.
    If $uri is the empty sequence, the result is an empty sequence.
    - + If $uri is not a valid URI, an error may be raised [err:FODC0005].
    - - If $uri is a relative URI reference, it is resolved relative to the value of the base URI property from the static context. The resulting absolute URI is promoted to an xs:string.

    + + If $uri is a relative URI reference, it is resolved relative to the value of the base + URI property from the static context. The resulting absolute URI is promoted to an + xs:string.

    Arguments: @@ -3426,15 +4040,24 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:collection() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:collection()
    - This function takes an xs:string as argument and returns a sequence of nodes obtained by interpreting $arg as an xs:anyURI and resolving it according to the mapping specified in Available collections described in Section C.2 Dynamic Context ComponentsXP. If Available collections provides a mapping from this string to a sequence of nodes, the function returns that sequence. If Available collections maps the string to an empty sequence, then the function returns an empty sequence. If Available collections provides no mapping for the string, an error is raised [err:FODC0004].
    - If $arg is not specified, the function returns the sequence of the nodes in the default collection in the dynamic context. See Section C.2 Dynamic Context ComponentsXP. If the value of the default collection is undefined an error is raised [err:FODC0002].

    + This function takes an xs:string as argument and returns a sequence of nodes obtained by + interpreting $arg as an xs:anyURI and resolving it according to the mapping specified in + Available collections described in Section C.2 Dynamic Context ComponentsXP. If + Available collections provides a mapping from this string to a sequence of nodes, the + function returns that sequence. If Available collections maps the string to an empty + sequence, then the function returns an empty sequence. If Available collections provides + no mapping for the string, an error is raised [err:FODC0004].
    + If $arg is not specified, the function returns the sequence of the nodes in the default + collection in the dynamic context. See Section C.2 Dynamic Context ComponentsXP. If the + value of the default collection is undefined an error is raised [err:FODC0002].

    Arguments: @@ -3460,13 +4083,15 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:element-with-id() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:element-with-id()
    - Returns the sequence of element nodes that have an ID value matching the value of one or more of the IDREF values supplied in $arg.

    + Returns the sequence of element nodes that have an ID value matching the value of one or + more of the IDREF values supplied in $arg.

    Arguments: @@ -3481,13 +4106,16 @@
    Return type: node()*

    - W3C Documentation reference + W3C Documentation reference
    fn:position() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:position()
    - Returns the context position from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

    + Returns the context position from the dynamic context. (See Section C.2 Dynamic Context + ComponentsXP.) If the context item is undefined, an error is raised: + [err:XPDY0002]XP.

    Return type: xs:integer

    Examples: @@ -3502,14 +4130,17 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:last() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:last()
    - Returns the context size from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) If the context item is undefined, an error is raised: [err:XPDY0002]XP.

    + Returns the context size from the dynamic context. (See Section C.2 Dynamic Context + ComponentsXP.) If the context item is undefined, an error is raised: + [err:XPDY0002]XP.

    Return type: xs:integer

    Examples: @@ -3524,27 +4155,30 @@
    - W3C Documentation reference + W3C Documentation reference
    -
    - +
    - + fn:years-from-duration()
    - Returns an xs:integer representing the years component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the years component as described in 10.3.1.3 Canonical representation.
    + Returns an xs:integer representing the years component in the value of $arg. The result + is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration + types) and then computing the years component as described in 10.3.1.3 Canonical + representation.
    The result may be negative.
    - + If $arg is an xs:dayTimeDuration returns 0.
    - + If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -3577,18 +4211,22 @@
    0

    - W3C Documentation reference + W3C Documentation reference
    fn:months-from-duration()
    - Returns an xs:integer representing the months component in the value of $arg. The result is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration types) and then computing the months component as described in 10.3.1.3 Canonical representation.
    + Returns an xs:integer representing the months component in the value of $arg. The result + is obtained by casting $arg to an xs:yearMonthDuration (see 17.1.4 Casting to duration + types) and then computing the months component as described in 10.3.1.3 Canonical + representation.
    The result may be negative.
    - + If $arg is an xs:dayTimeDuration returns 0.
    - + If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -3621,18 +4259,22 @@
    0

    - W3C Documentation reference + W3C Documentation reference
    fn:days-from-duration()
    - Returns an xs:integer representing the days component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the days component as described in 10.3.2.3 Canonical representation.
    + Returns an xs:integer representing the days component in the value of $arg. The result + is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration + types) and then computing the days component as described in 10.3.2.3 Canonical + representation.
    The result may be negative.
    - + If $arg is an xs:yearMonthDuration returns 0.
    - + If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -3665,18 +4307,22 @@
    0

    - W3C Documentation reference + W3C Documentation reference
    fn:hours-from-duration()
    - Returns an xs:integer representing the hours component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the hours component as described in 10.3.2.3 Canonical representation.
    + Returns an xs:integer representing the hours component in the value of $arg. The result + is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration + types) and then computing the hours component as described in 10.3.2.3 Canonical + representation.
    The result may be negative.
    - + If $arg is an xs:yearMonthDuration returns 0.
    - + If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -3709,14 +4355,18 @@
    0

    - W3C Documentation reference + W3C Documentation reference
    fn:minutes-from-duration()
    - Returns an xs:integer representing the minutes component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the minutes component as described in 10.3.2.3 Canonical representation. + Returns an xs:integer representing the minutes component in the value of $arg. The + result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to + duration types) and then computing the minutes component as described in 10.3.2.3 + Canonical representation. The result may be negative. @@ -3750,14 +4400,18 @@ -30
    - W3C Documentation reference + W3C Documentation reference
    - + fn:seconds-from-duration()
    - Returns an xs:decimal representing the seconds component in the value of $arg. The result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to duration types) and then computing the seconds component as described in 10.3.2.3 Canonical representation.
    + Returns an xs:decimal representing the seconds component in the value of $arg. The + result is obtained by casting $arg to an xs:dayTimeDuration (see 17.1.4 Casting to + duration types) and then computing the seconds component as described in 10.3.2.3 + Canonical representation.
    The result may be negative.
    @@ -3791,14 +4445,16 @@ -16.0
    - W3C Documentation reference + W3C Documentation reference
    fn:year-from-dateTime()
    - Returns an xs:integer representing the year component in the localized value of $arg. The result may be negative.
    + Returns an xs:integer representing the year component in the localized value of $arg. + The result may be negative.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -3832,14 +4488,16 @@ 2000
    - W3C Documentation reference + W3C Documentation reference
    fn:month-from-dateTime()
    - Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
    + Returns an xs:integer between 1 and 12, both inclusive, representing the month component + in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -3873,13 +4531,15 @@ 1
    - W3C Documentation reference + W3C Documentation reference
    fn:day-from-dateTime()
    - Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
    + Returns an xs:integer between 1 and 31, both inclusive, representing the day component + in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -3913,14 +4573,16 @@ 1
    - W3C Documentation reference + W3C Documentation reference
    fn:hours-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:hours-from-dateTime()
    - Returns an xs:integer between 0 and 23, both inclusive, representing the hours component in the localized value of $arg.
    + Returns an xs:integer between 0 and 23, both inclusive, representing the hours component + in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -3954,14 +4616,16 @@ 0
    - W3C Documentation reference + W3C Documentation reference
    fn:minutes-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:minutes-from-dateTime()
    - Returns an xs:integer value between 0 and 59, both inclusive, representing the minute component in the localized value of $arg.
    + Returns an xs:integer value between 0 and 59, both inclusive, representing the minute + component in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -3991,13 +4655,15 @@ 30
    - W3C Documentation reference + W3C Documentation reference
    fn:seconds-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:seconds-from-dateTime()
    - Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
    + Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -4023,13 +4689,15 @@ 0
    - W3C Documentation reference + W3C Documentation reference
    fn:timezone-from-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:timezone-from-dateTime()
    - Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
    + Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -4063,14 +4731,16 @@ ()
    - W3C Documentation reference + W3C Documentation reference
    fn:year-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:year-from-date()
    - Returns an xs:integer representing the year in the localized value of $arg. The value may be negative.
    + Returns an xs:integer representing the year in the localized value of $arg. The value + may be negative.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -4100,13 +4770,15 @@ 2000
    - W3C Documentation reference + W3C Documentation reference
    fn:month-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:month-from-date()
    - Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of $arg.
    + Returns an xs:integer between 1 and 12, both inclusive, representing the month component + in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -4136,13 +4808,15 @@ 1
    - W3C Documentation reference + W3C Documentation reference
    fn:day-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:day-from-date()
    - Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of $arg.
    + Returns an xs:integer between 1 and 31, both inclusive, representing the day component + in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -4172,14 +4846,18 @@ 1
    - W3C Documentation reference + W3C Documentation reference
    fn:timezone-from-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:timezone-from-date()
    - Returns the timezone component of $arg if any. If $arg has a timezone component, then the result is an xs:dayTimeDuration that indicates deviation from UTC; its value may range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty sequence.
    + Returns the timezone component of $arg if any. If $arg has a timezone component, then + the result is an xs:dayTimeDuration that indicates deviation from UTC; its value may + range from +14:00 to -14:00 hours, both inclusive. Otherwise, the result is the empty + sequence.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -4209,14 +4887,16 @@ PT0S
    - W3C Documentation reference + W3C Documentation reference
    fn:hours-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:hours-from-time()
    - Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
    + Returns an xs:integer between 0 and 23, both inclusive, representing the value of the + hours component in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -4246,14 +4926,16 @@ 0
    - W3C Documentation reference + W3C Documentation reference
    fn:minutes-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:minutes-from-time()
    - Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of $arg.
    + Returns an xs:integer between 0 and 23, both inclusive, representing the value of the + hours component in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -4283,13 +4965,15 @@ 0
    - W3C Documentation reference + W3C Documentation reference
    fn:seconds-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:seconds-from-time()
    - Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
    + Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -4316,14 +5000,16 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:timezone-from-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:timezone-from-time()
    - Returns an xs:decimal value greater than or equal to zero and less than 60, representing the seconds and fractional seconds in the localized value of $arg.
    + Returns an xs:decimal value greater than or equal to zero and less than 60, representing + the seconds and fractional seconds in the localized value of $arg.
    If $arg is the empty sequence, returns the empty sequence.

    Arguments and return type: @@ -4354,35 +5040,48 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:adjust-date-to-timezone() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:adjust-date-to-timezone()
    - Adjusts an xs:date value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:date without a timezone. Otherwise, returns an xs:date with a timezone. For purposes of timezone adjustment, an xs:date is treated as an xs:dateTime with time 00:00:00.
    + Adjusts an xs:date value to a specific timezone, or to no timezone at all. If $timezone + is the empty sequence, returns an xs:date without a timezone. Otherwise, returns an + xs:date with a timezone. For purposes of timezone adjustment, an xs:date is treated as + an xs:dateTime with time 00:00:00.
    + + If $timezone is not specified, then $timezone is the value of the implicit timezone in + the dynamic context.
    - If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
    - If $arg is the empty sequence, then the result is the empty sequence.
    - - A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
    - - If $arg does not have a timezone component and $timezone is the empty sequence, then the result is the value of $arg.
    - - If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
    - - If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
    - + + A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater + than PT14H or if does not contain an integral number of minutes.
    + + If $arg does not have a timezone component and $timezone is the empty sequence, then the + result is the value of $arg.
    + + If $arg does not have a timezone component and $timezone is not the empty sequence, then + the result is $arg with $timezone as the timezone component.
    + + If $arg has a timezone component and $timezone is the empty sequence, then the result is + the localized value of $arg without its timezone component.
    + If $arg has a timezone component and $timezone is not the empty sequence, then:
      -
    • Let $srcdt be an xs:dateTime value, with 00:00:00 for the time component and date and timezone components that are the same as the date and timezone components of $arg.
    • -
    • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
    • -
    • The result of this function will be a date value that has date and timezone components that are the same as the date and timezone components of $r.
    • +
    • Let $srcdt be an xs:dateTime value, with 00:00:00 for the time component and + date and timezone components that are the same as the date and timezone + components of $arg.
    • +
    • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, + $timezone)
    • +
    • The result of this function will be a date value that has date and timezone + components that are the same as the date and timezone components of $r.


    - + Arguments and return type: @@ -4410,39 +5109,52 @@ - +
    2002-03-07-05:00
    adjust-date-to-timezone(xs:date("2002-03-07"), xs:dayTimeDuration("-PT10H"))adjust-date-to-timezone(xs:date("2002-03-07"), xs:dayTimeDuration("-PT10H")) + 2002-03-07-10:00

    - W3C Documentation reference + W3C Documentation reference
    fn:adjust-time-to-timezone() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:adjust-time-to-timezone()
    - Adjusts an xs:time value to a specific timezone, or to no timezone at all. If $timezone is the empty sequence, returns an xs:time without a timezone. Otherwise, returns an xs:time with a timezone.
    + Adjusts an xs:time value to a specific timezone, or to no timezone at all. If $timezone + is the empty sequence, returns an xs:time without a timezone. Otherwise, returns an + xs:time with a timezone.
    - If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context.
    + If $timezone is not specified, then $timezone is the value of the implicit timezone in + the dynamic context.
    If $arg is the empty sequence, then the result is the empty sequence.
    - A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater than PT14H or if does not contain an integral number of minutes.
    + A dynamic error is raised [err:FODT0003] if $timezone is less than -PT14H or greater + than PT14H or if does not contain an integral number of minutes.
    - If $arg does not have a timezone component and $timezone is the empty sequence, then the result is $arg.
    + If $arg does not have a timezone component and $timezone is the empty sequence, then the + result is $arg.
    - If $arg does not have a timezone component and $timezone is not the empty sequence, then the result is $arg with $timezone as the timezone component.
    + If $arg does not have a timezone component and $timezone is not the empty sequence, then + the result is $arg with $timezone as the timezone component.
    - If $arg has a timezone component and $timezone is the empty sequence, then the result is the localized value of $arg without its timezone component.
    + If $arg has a timezone component and $timezone is the empty sequence, then the result is + the localized value of $arg without its timezone component.
    If $arg has a timezone component and $timezone is not the empty sequence, then:
      -
    • Let $srcdt be an xs:dateTime value, with an arbitrary date for the date component and time and timezone components that are the same as the time and timezone components of $arg.
    • -
    • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, $timezone)
    • -
    • The result of this function will be a time value that has time and timezone components that are the same as the time and timezone components of $r.
    • +
    • Let $srcdt be an xs:dateTime value, with an arbitrary date for the date + component and time and timezone components that are the same as the time and + timezone components of $arg.
    • +
    • Let $r be the result of evaluating fn:adjust-dateTime-to-timezone($srcdt, + $timezone)
    • +
    • The result of this function will be a time value that has time and timezone + components that are the same as the time and timezone components of $r.


    - + Arguments and return type: @@ -4470,19 +5182,26 @@ - +
    10:00:00-05:00
    adjust-time-to-timezone(xs:time("10:00:00"), xs:dayTimeDuration("-PT10H"))adjust-time-to-timezone(xs:time("10:00:00"), xs:dayTimeDuration("-PT10H")) + 10:00:00-10:00

    - W3C Documentation reference + W3C Documentation reference
    fn:current-dateTime() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:current-dateTime()
    - Returns the current dateTime (with timezone) from the dynamic context. (See Section C.2 Dynamic Context ComponentsXP.) This is an xs:dateTime that is current at some time during the evaluation of a query or transformation in which fn:current-dateTime() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-dateTime() is ·implementation dependent·.

    - + Returns the current dateTime (with timezone) from the dynamic context. (See Section C.2 + Dynamic Context ComponentsXP.) This is an xs:dateTime that is current at some time + during the evaluation of a query or transformation in which fn:current-dateTime() is + executed. This function is ·stable·. The precise instant during the query or + transformation represented by the value of fn:current-dateTime() is ·implementation + dependent·.

    + Return type: xs:dateTime

    Examples:
    @@ -4496,14 +5215,19 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:current-date() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:current-date()
    - Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

    - + Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is + current at some time during the evaluation of a query or transformation in which + fn:current-date() is executed. This function is ·stable·. The precise instant during the + query or transformation represented by the value of fn:current-date() is ·implementation + dependent·.

    + Return type: xs:date

    Examples:
    @@ -4517,15 +5241,20 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:current-time() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:current-time()
    - Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is current at some time during the evaluation of a query or transformation in which fn:current-date() is executed. This function is ·stable·. The precise instant during the query or transformation represented by the value of fn:current-date() is ·implementation dependent·.

    - + Returns xs:date(fn:current-dateTime()). This is an xs:date (with timezone) that is + current at some time during the evaluation of a query or transformation in which + fn:current-date() is executed. This function is ·stable·. The precise instant during the + query or transformation represented by the value of fn:current-date() is ·implementation + dependent·.

    + Return type: xs:time

    Examples:
    @@ -4539,14 +5268,17 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:implicit-timezone() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:implicit-timezone()
    - Returns the value of the implicit timezone property from the dynamic context. Components of the dynamic context are discussed in Section C.2 Dynamic Context ComponentsXP.

    - + Returns the value of the implicit timezone property from the dynamic context. Components + of the dynamic context are discussed in Section C.2 Dynamic Context + ComponentsXP.

    + Return type: xs:string

    Examples:
    @@ -4560,83 +5292,102 @@

    - W3C Documentation reference + W3C Documentation reference
    - +
    - fn:error() -
    - The fn:error function is a general function that may be invoked as above but may also be invoked from [XQuery 1.0: An XML Query Language] or [XML Path Language (XPath) 2.0] applications with, for example, an xs:QName argument. -
    - W3C Documentation reference -
    + fn:error() +
    + The fn:error function is a general function that may be invoked as above but may also be + invoked from [XQuery 1.0: An XML Query Language] or [XML Path Language (XPath) 2.0] + applications with, for example, an xs:QName argument. +
    + W3C Documentation reference +
    - fn:trace() -
    - Provides an execution trace intended to be used in debugging queries.
    + fn:trace() +
    + Provides an execution trace intended to be used in debugging queries.
    + + The input $value is returned, unchanged, as the result of the function. In addition, the + inputs $value, converted to an xs:string, and $label may be directed to a trace data + set. The destination of the trace output is ·implementation-defined·. The format of the + trace output is ·implementation dependent·. The ordering of output from invocations of + the fn:trace() function is ·implementation dependent·.
    + + Arguments: + + + + + + + + + + + + + +
    TypeDescription
    item*$value
    xs:string$label
    + Return type: item

    +
    + W3C Documentation reference +
    - The input $value is returned, unchanged, as the result of the function. In addition, the inputs $value, converted to an xs:string, and $label may be directed to a trace data set. The destination of the trace output is ·implementation-defined·. The format of the trace output is ·implementation dependent·. The ordering of output from invocations of the fn:trace() function is ·implementation dependent·.
    - Arguments: - - - - - - - - - - - - - -
    TypeDescription
    item*$value
    xs:string$label
    - Return type: item

    -
    - W3C Documentation reference -
    - -
    - +
    - fn:resolve-uri()
    This function enables a relative URI reference to be resolved against an absolute URI. - The first form of this function resolves $relative against the value of the base-uri property from the static context. If the base-uri property is not initialized in the static context an error is raised [err:FONS0005].
    - - If $relative is a relative URI reference, it is resolved against $base, or against the base-uri property from the static context, using an algorithm such as those described in [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned.
    + The first form of this function resolves $relative against the value of the base-uri + property from the static context. If the base-uri property is not initialized in the + static context an error is raised [err:FONS0005].
    + + If $relative is a relative URI reference, it is resolved against $base, or against the + base-uri property from the static context, using an algorithm such as those described in + [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned.
    If $relative is an absolute URI reference, it is returned unchanged.
    - + If $relative is the empty sequence, the empty sequence is returned.
    - - If $relative is not a valid URI according to the rules of the xs:anyURI data type, or if it is not a suitable relative reference to use as input to the chosen resolution algorithm, then an error is raised [err:FORG0002].
    - - If $base is not a valid URI according to the rules of the xs:anyURI data type, if it is not a suitable URI to use as input to the chosen resolution algorithm (for example, if it is a relative URI reference, if it is a non-hierarchic URI, or if it contains a fragment identifier), then an error is raised [err:FORG0002].
    - - If the chosen resolution algorithm fails for any other reason then an error is raised [err:FORG0009].
    - + + If $relative is not a valid URI according to the rules of the xs:anyURI data type, or if + it is not a suitable relative reference to use as input to the chosen resolution + algorithm, then an error is raised [err:FORG0002].
    + + If $base is not a valid URI according to the rules of the xs:anyURI data type, if it is + not a suitable URI to use as input to the chosen resolution algorithm (for example, if + it is a relative URI reference, if it is a non-hierarchic URI, or if it contains a + fragment identifier), then an error is raised [err:FORG0002].
    + + If the chosen resolution algorithm fails for any other reason then an error is raised + [err:FORG0009].
    +

    Note:

    - - Resolving a URI does not dereference it. This is merely a syntactic operation on two character strings. + + Resolving a URI does not dereference it. This is merely a syntactic operation on two + character strings.

    Arguments and return type: @@ -4655,25 +5406,37 @@
    Return type: xs:anyURI?


    - W3C Documentation reference + W3C Documentation reference
    - - fn:resolve-QName() -
    - Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string that has the lexical form of an xs:QName (a string in the form "prefix:local-name" or "local-name") and resolving it using the in-scope namespaces for a given element.
    - If $qname does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
    + fn:resolve-QName() +
    + Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string that has + the lexical form of an xs:QName (a string in the form "prefix:local-name" or + "local-name") and resolving it using the in-scope namespaces for a given element.
    + + If $qname does not have the correct lexical form for xs:QName an error is raised + [err:FOCA0002].
    If $qname is the empty sequence, returns the empty sequence.
    - More specifically, the function searches the namespace bindings of $element for a binding whose name matches the prefix of $qname, or the zero-length string if it has no prefix, and constructs an expanded-QName whose local name is taken from the supplied $qname, and whose namespace URI is taken from the string value of the namespace binding.
    + More specifically, the function searches the namespace bindings of $element for a + binding whose name matches the prefix of $qname, or the zero-length string if it has no + prefix, and constructs an expanded-QName whose local name is taken from the supplied + $qname, and whose namespace URI is taken from the string value of the namespace + binding.
    - If the $qname has a prefix and if there is no namespace binding for $element that matches this prefix, then an error is raised [err:FONS0004].
    + If the $qname has a prefix and if there is no namespace binding for $element that + matches this prefix, then an error is raised [err:FONS0004].
    - If the $qname has no prefix, and there is no namespace binding for $element corresponding to the default (unnamed) namespace, then the resulting expanded-QName has no namespace part.
    + If the $qname has no prefix, and there is no namespace binding for $element + corresponding to the default (unnamed) namespace, then the resulting expanded-QName has + no namespace part.
    - The prefix (or absence of a prefix) in the supplied $qname argument is retained in the returned expanded-QName, as discussed in Section 2.1 TerminologyDM.

    + The prefix (or absence of a prefix) in the supplied $qname argument is retained in the + returned expanded-QName, as discussed in Section 2.1 TerminologyDM.

    Arguments: @@ -4707,17 +5470,24 @@

    - W3C Documentation reference + W3C Documentation reference
    fn:QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:QName()
    - Returns an xs:QName with the namespace URI given in $paramURI. If $paramURI is the zero-length string or the empty sequence, it represents "no namespace"; in this case, if the value of $paramQName contains a colon (:), an error is raised [err:FOCA0002]. The prefix (or absence of a prefix) in $paramQName is retained in the returned xs:QName value. The local name in the result is taken from the local part of $paramQName.
    + Returns an xs:QName with the namespace URI given in $paramURI. If $paramURI is the + zero-length string or the empty sequence, it represents "no namespace"; in this case, if + the value of $paramQName contains a colon (:), an error is raised [err:FOCA0002]. The + prefix (or absence of a prefix) in $paramQName is retained in the returned xs:QName + value. The local name in the result is taken from the local part of $paramQName.
    - If $paramQName does not have the correct lexical form for xs:QName an error is raised [err:FOCA0002].
    - - Note that unlike xs:QName this function does not require a xs:string literal as the argument.

    + If $paramQName does not have the correct lexical form for xs:QName an error is raised + [err:FOCA0002].
    + + Note that unlike xs:QName this function does not require a xs:string literal as the + argument.

    Arguments: @@ -4747,13 +5517,15 @@
    For more extensive examples see W3C documentation below.
    - W3C Documentation reference + W3C Documentation reference
    fn:prefix-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:prefix-from-QName()
    - Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

    + Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if + $arg is the empty sequence or if the value of $arg contains no prefix.

    Arguments: @@ -4779,13 +5551,15 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:local-name-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:local-name-from-QName()
    - Returns an xs:NCName representing the local part of $arg. If $arg is the empty sequence, returns the empty sequence.

    + Returns an xs:NCName representing the local part of $arg. If $arg is the empty sequence, + returns the empty sequence.

    Arguments: @@ -4811,14 +5585,16 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:prefix-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:prefix-from-QName()
    - Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

    + Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if + $arg is the empty sequence or if the value of $arg contains no prefix.

    Arguments: @@ -4844,13 +5620,16 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:namespace-uri-from-QName() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:namespace-uri-from-QName()
    - Returns the namespace URI for $arg as an xs:anyURI. If $arg is the empty sequence, the empty sequence is returned. If $arg is in no namespace, the zero-length xs:anyURI is returned.

    + Returns the namespace URI for $arg as an xs:anyURI. If $arg is the empty sequence, the + empty sequence is returned. If $arg is in no namespace, the zero-length xs:anyURI is + returned.

    Arguments: @@ -4876,16 +5655,21 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:namespace-uri-for-prefix() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:namespace-uri-for-prefix()
    - Returns the namespace URI of one of the in-scope namespaces for $element, identified by its namespace prefix.
    + Returns the namespace URI of one of the in-scope namespaces for $element, identified by + its namespace prefix.
    - If $element has an in-scope namespace whose namespace prefix is equal to $prefix, it returns the namespace URI of that namespace. If $prefix is the zero-length string or the empty sequence, it returns the namespace URI of the default (unnamed) namespace. Otherwise, it returns the empty sequence.
    + If $element has an in-scope namespace whose namespace prefix is equal to $prefix, it + returns the namespace URI of that namespace. If $prefix is the zero-length string or the + empty sequence, it returns the namespace URI of the default (unnamed) namespace. + Otherwise, it returns the empty sequence.
    Prefixes are equal only if their Unicode code points match exactly.

    @@ -4917,14 +5701,17 @@ - W3C Documentation reference + W3C Documentation reference
    fn:in-scope-prefixes() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:in-scope-prefixes()
    - Returns the prefixes of the in-scope namespaces for $element. For namespaces that have a prefix, it returns the prefix as an xs:NCName. For the default namespace, which has no prefix, it returns the zero-length string.

    + Returns the prefixes of the in-scope namespaces for $element. For namespaces that have a + prefix, it returns the prefix as an xs:NCName. For the default namespace, which has no + prefix, it returns the zero-length string.

    Arguments: @@ -4950,14 +5737,17 @@
    - W3C Documentation reference + W3C Documentation reference
    fn:static-base-uri() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:static-base-uri()
    - Returns the value of the Base URI property from the static context. If the Base URI property is undefined, the empty sequence is returned. Components of the static context are discussed in Section C.1 Static Context ComponentsXP.

    - + Returns the value of the Base URI property from the static context. If the Base URI + property is undefined, the empty sequence is returned. Components of the static context + are discussed in Section C.1 Static Context ComponentsXP.

    + Return type: xs:anyURI?

    Examples:
    @@ -4971,31 +5761,404 @@

    - W3C Documentation reference + W3C Documentation reference
    - +
    -
    - - + fn:last() + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:outermost(node()*)
    - Returns the position of the last node in the context list
    -
    - W3C Documentation reference: Node-Set-Functions + 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(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(node()?) +
    + 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(node()?) +
    + 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(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(node()?) +
    + 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(node()?) +
    + 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()?) +
    + 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 +
    + + + + fn:document-uri(node?) +
    + Returns the document URI of the given node or the context item
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    node?Returns the document URI of the specified node or the context item (if no + argument is provided)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:document-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the document URI of the first + fiction:book element is "http://example.com/library.xml")
    fn:document-uri(/library)http://example.com/library.xml (assuming the document URI of the library + element is "http://example.com/library.xml")

    + W3C Documentation reference: Document-URI +
    + + + fn:base-uri(node?) +
    + Returns the base URI of the node or the context item
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    node?Returns the base URI of the specified node or the context item (if no + argument is provided)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:base-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the base URI of the first + fiction:book element is "http://example.com/library.xml")
    fn:base-uri(/library)http://example.com/library.xml (assuming the base URI of the library element + is "http://example.com/library.xml")

    + W3C Documentation reference: Base-URI +
    + + + fn:node-name(node?) +
    + + Returns the name of a node as an xs:QName
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    node?Returns the name of the specified node or the context item if the argument + is omitted
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:node-name(/library/*[1])fiction:book
    fn:node-name(/library/fiction:book[1]/title)title

    + W3C Documentation reference: Node-Name +
    +
    @@ -5003,48 +6166,159 @@
    - - + fn:boolean(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:not(item()*)
    - The boolean function converts its argument to a boolean as follows: -
      -
    • a number is true if and only if it is neither positive or negative zero nor NaN
    • -
    • a node-set is true if and only if it is non-empty
    • -
    • a string is true if and only if its length is non-zero
    • -
    • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type
    • -
    - - Arguments and return type: - - - - - - - - - -
    TypeDescription
    objectThe object to convert to a boolean
    Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    boolean("Release11")true
    boolean("")false

    - W3C Documentation reference: Boolean-Functions + Returns the negation of the effective boolean value of the argument
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    item()*Argument whose effective boolean value is to be negated
    + Examples:
    + + + + + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:not(1)false
    fn:not(0)true
    fn:not('')true
    fn:not('true')false

    + W3C Documentation reference: Not
    - - + + + fn:false() +
    + Returns the boolean value false
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    NoneReturns the boolean value false
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:false()false
    //item[fn:false()]Returns an empty node-set

    + W3C Documentation reference: False +
    + + + fn:true() +
    + Returns the boolean value true
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    NoneReturns the boolean value true
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:true()true
    //item[fn:true()]Returns all <item> elements

    + W3C Documentation reference: True +
    + + + fn:boolean(item()*) +
    + Converts the argument to a boolean value
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    item()*Argument to be converted to a boolean value
    + Examples:
    + + + + + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:boolean(1)true
    fn:boolean(0)false
    fn:boolean('')false
    fn:boolean('true')true

    + W3C Documentation reference: Boolean +
    + +
    @@ -5052,41 +6326,1199 @@
    - - + + fn:unparsed-text-available(xs:string?, xs:string?) +
    + 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(xs:string?, 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(xs:string?, 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(xs:string?) +
    + Escapes special characters in a URI to be used in HTML
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?URI to be escaped for use in HTML
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:escape-html-uri('https://example.com/search?q=test&lang=en')https://example.com/search?q=test&lang=en
    fn:escape-html-uri('https://example.com/page?id=1§ion=2')https://example.com/page?id=1&section=2

    + W3C Documentation reference: Escape-HTML-URI +
    + + + fn:iri-to-uri(xs:string?) +
    + Converts an IRI to a URI by escaping non-ASCII characters
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?IRI to be converted to a URI
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:iri-to-uri('https://example.com/ümlaut')https://example.com/%C3%BCmlaut
    fn:iri-to-uri('https://example.com/日本語')https://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E

    + W3C Documentation reference: IRI-to-URI +
    + + + fn:encode-for-uri(xs:string?) +
    + Encodes a string for use in a URI by escaping special characters
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?String to be encoded for use in a URI
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:encode-for-uri('hello world')hello%20world
    fn:encode-for-uri('example?query=value¶m=value2')example%3Fquery%3Dvalue%26param%3Dvalue2

    + W3C Documentation reference: Encode-for-URI +
    + + + fn:resolve-uri(xs:string?, xs:string?) +
    + Resolves a relative URI using a base URI
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Relative URI to resolve
    xs:string?Base URI to use for resolving (optional)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:resolve-uri('example.html', 'https://www.example.com/folder/')https://www.example.com/folder/example.html
    fn:resolve-uri('../images/pic.jpg', + 'https://www.example.com/folder/page.html')https://www.example.com/images/pic.jpg

    + W3C Documentation reference: Resolve-URI +
    + + fn:analyze-string(xs:string?, xs:string, xs:string?) +
    + Analyzes the input string and returns an XML fragment containing match and non-match + elements
    + Arguments and return type: + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to analyze
    xs:stringRegular expression pattern to match
    xs:string?Flags to control the regular expression matching (optional)
    + Examples:
    + + + + + + + + + +
    ExpressionResult
    fn:analyze-string('red,green,blue', ',') + <fn:analyze-string-result><fn:non-match>red</fn:non-match><fn:match>, + <fn:non-match>green</fn:non-match><fn:match>, + <fn:non-match>blue</fn:non-match></fn:analyze-string-result> +

    + W3C Documentation reference: Analyze-String +
    + + + fn:tokenize(xs:string?, xs:string, xs:string?) +
    + Splits the input string into a sequence of substrings using the pattern as a delimiter +
    + Arguments and return type: + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to tokenize
    xs:stringRegular expression pattern to use as delimiter
    xs:string?Flags to control the regular expression matching (optional)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:tokenize('XPath 3.0, XQuery 3.0, XSLT 3.0', ',\\s*')('XPath 3.0', 'XQuery 3.0', 'XSLT 3.0')
    fn:tokenize('apple,orange,banana', ',')('apple', 'orange', 'banana')

    + W3C Documentation reference: Tokenize +
    + + + fn:replace(xs:string?, xs:string, xs:string, xs:string?) +
    + Replaces occurrences of the pattern in the input string with the replacement string
    + Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to search within
    xs:stringRegular expression pattern to match
    xs:stringReplacement string
    xs:string?Flags to control the regular expression matching (optional)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:replace('XPath 3.0 is great', '3.0', '3.1')'XPath 3.1 is great'
    fn:replace('Hello, World!', 'World', 'XPath')'Hello, XPath!'

    + W3C Documentation reference: Replace +
    + + + fn:matches(xs:string?, xs:string, xs:string?) +
    + Returns true if the input string matches the regular expression pattern, otherwise false +
    + Arguments and return type: + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to search within
    xs:stringRegular expression pattern to match
    xs:string?Flags to control the regular expression matching (optional)
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:matches('XPath 3.0', '\\d\\.\\d')true
    fn:matches('Hello, World!', '[A-Z][a-z]*')true
    fn:matches('example123', '\\d+', 'q')false

    + W3C Documentation reference: Matches +
    + + + fn:substring-after(xs:string?, xs:string?) +
    + Returns the part of the first string that follows the first occurrence of the second + string
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to search within
    xs:string?Substring to search for
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:substring-after('Hello, World!', ',')' World!'
    fn:substring-after('XPath 3.0 is awesome!', '3.0')' is awesome!'

    + W3C Documentation reference: Substring-After +
    + + + fn:substring-before(xs:string?, xs:string?) +
    + Returns the part of the first string that precedes the first occurrence of the second + string
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to search within
    xs:string?Substring to search for
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:substring-before('Hello, World!', ',')'Hello'
    fn:substring-before('XPath 3.0 is awesome!', '3.0')'XPath '

    + W3C Documentation reference: Substring-Before +
    + + + fn:ends-with(xs:string?, xs:string?) +
    + Returns true if the first string ends with the second string, otherwise false
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to check
    xs:string?Substring to check for at the end of the first string
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:ends-with('Hello, World!', 'World!')true
    fn:ends-with('Hello, World!', 'Hello')false
    fn:ends-with('XPath 3.0', '3.0')true

    + W3C Documentation reference: Ends-With +
    + + + fn:starts-with(xs:string?, xs:string?) +
    + Returns true if the first string starts with the second string, otherwise false
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to check
    xs:string?Substring to check for at the beginning of the first string
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:starts-with('Hello, World!', 'Hello')true
    fn:starts-with('Hello, World!', 'World')false
    fn:starts-with('XPath 3.0', 'XPath')true

    + W3C Documentation reference: Starts-With +
    + + + fn:contains(xs:string?, xs:string?) +
    + Returns true if the first string contains the second string, otherwise false
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to search within
    xs:string?Substring to search for
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:contains('Hello, World!', 'World')true
    fn:contains('Hello, World!', 'world')false
    fn:contains('XPath 3.0', '3.0')true

    + W3C Documentation reference: Contains +
    + + + fn:translate(xs:string?, xs:string, xs:string) +
    + Returns the input string with specified characters replaced
    + Arguments and return type: + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to be translated
    xs:stringMap string with characters to replace
    xs:stringTranslate string with replacement characters
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:translate('apple', 'aeiou', '12345')'1ppl2'
    fn:translate('Hello, World!', 'HW', 'hw')'hello, world!'

    + W3C Documentation reference: Translate +
    + + + fn:lower-case(xs:string?) +
    + Returns the input string with all characters converted to lowercase
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?Input string to convert to lowercase
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:lower-case('HELLO, WORLD!')'hello, world!'
    fn:lower-case('XPath 3.0')'xpath 3.0'
    fn:lower-case('BANANA')'banana'

    + W3C Documentation reference: Lower-Case +
    + + + fn:upper-case(xs:string?) +
    + Returns the input string with all characters converted to uppercase
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?Input string to convert to uppercase
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:upper-case('Hello, World!')'HELLO, WORLD!'
    fn:upper-case('XPath 3.0')'XPATH 3.0'
    fn:upper-case('banana')'BANANA'

    + W3C Documentation reference: Upper-Case +
    + + + fn:normalize-unicode(xs:string?, xs:string) +
    + Returns the input string with Unicode normalization applied
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to normalize
    xs:stringNormalization form to apply (NFC, NFD, NFKC, NFKD)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:normalize-unicode('Café', 'NFC')'Café'
    fn:normalize-unicode('Café', 'NFD')'Café'

    + W3C Documentation reference: Normalize-Unicode +
    + + + fn:normalize-space(xs:string?) +
    + Returns the input string with whitespace normalized
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?Input string to normalize whitespace
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:normalize-space(' Hello, World! ')'Hello, World!'
    fn:normalize-space(' XPath 3.0 ')'XPath 3.0'
    fn:normalize-space('\tbanana\t')'banana'

    + W3C Documentation reference: Normalize-Space +
    + + + fn:string-length(xs:string?) +
    + Returns the length of the input string
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?Input string to calculate length
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:string-length('Hello, World!')13
    fn:string-length('XPath 3.0')8
    fn:string-length('banana')6

    + W3C Documentation reference: String-Length +
    + + + fn:substring(xs:string?, xs:double) +
    + Returns a substring of the source string, starting from a specific location
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input source string
    xs:doubleStarting location to extract the substring
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:substring('Hello, World!', 1, 5)'Hello'
    fn:substring('XPath 3.0', 7)'3.0'
    fn:substring('banana', 2, 3)'ana'

    + W3C Documentation reference: Substring +
    + + fn:string-join(xs:string*, xs:string) +
    + Joins a sequence of strings with a specified separator, returning a single string
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string*Input sequence of strings to join
    xs:stringSeparator string to insert between joined strings
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:string-join(('apple', 'banana', 'orange'), ', ')'apple, banana, orange'
    fn:string-join(('XPath', '3.0', 'Functions'), ' - ')'XPath - 3.0 - Functions'
    fn:string-join(('A', 'B', 'C'), '')'ABC'

    + W3C Documentation reference: String-Join +
    + + + fn:concat(xs:anyAtomicType?, xs:anyAtomicType?, ...) +
    + Concatenates two or more strings or atomic values, returning a single string
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:anyAtomicType?Input strings or atomic values to concatenate
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:concat('Hello', ' ', 'World')'Hello World'
    fn:concat('I have ', 3, ' apples')'I have 3 apples'
    fn:concat('XPath ', '3.0')'XPath 3.0'

    + W3C Documentation reference: Concat +
    + + + fn:codepoint-equal(xs:string?, xs:string?) +
    + Compares two strings on a codepoint-by-codepoint basis and returns true if they are + equal, false otherwise
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?First string to compare
    xs:string?Second string to compare
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:codepoint-equal('Hello', 'Hello')true
    fn:codepoint-equal('Hello', 'hello')false
    fn:codepoint-equal('apple', 'banana')false

    + W3C Documentation reference: Codepoint-Equal +
    + + + fn:compare(xs:string?, xs:string?) +
    + Compares two strings and returns -1, 0, or 1 if the first string is less than, equal to, + or greater than the second string, respectively
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?First string to compare
    xs:string?Second string to compare
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:compare('apple', 'banana')-1
    fn:compare('apple', 'apple')0
    fn:compare('banana', 'apple')1

    + W3C Documentation reference: Compare +
    + + + fn:string-to-codepoints(xs:string?) +
    + Returns a sequence of Unicode code points for a given string
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?Input string
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:string-to-codepoints('Hello')(72, 101, 108, 108, 111)
    fn:string-to-codepoints('( ͡° ͜ʖ ͡°)')(40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)
    fn:string-to-codepoints('😊')(128522)

    + W3C Documentation reference: String-To-Codepoints +
    + + + fn:codepoints-to-string(xs:integer*) +
    + Constructs a string from a sequence of Unicode code points
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:integer*Sequence of Unicode code points
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:codepoints-to-string((72, 101, 108, 108, 111))Hello
    codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)) + ( ͡° ͜ʖ ͡°)
    fn:codepoints-to-string((128522))😊

    + W3C Documentation reference: Codepoints-To-String +
    + + + fn:string(object)
    - Returns the string representation of the object argument
    - Arguments and return type: - - - - - - - - - -
    TypeDescription
    stringThe object to convert to a string
    Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    string((1<0))false
    string(.11)0.11

    - W3C Documentation reference: String-Functions + Returns the string representation of the object argument
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    stringThe object to convert to a string
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    string((1<0))false
    string(.11)0.11

    + W3C Documentation reference: String-Functions
    - - + +
    @@ -5094,49 +7526,1447 @@
    - - + + fn:number(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:format-number(numeric?, xs:string, $decimal-format-name)
    - The number function converts its argument to a number as follows: -
      -
    • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
    • -
    • boolean true is converted to 1; boolean false is converted to 0
    • -
    • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
    • -
    • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
    • -
    - - Arguments and return type: - - - - - - - - - -
    TypeDescription
    objectThe object to convert to a number
    - Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    boolean("Release11")true
    boolean("")false

    - W3C Documentation reference: Numeric-Functions + Formats a numeric value according to the supplied picture string and optional decimal + format name
    + Arguments and return type: + + + + + + + + + + + + + + + + + +
    TypeDescription
    numeric?Numeric value to be formatted
    xs:stringPicture string defining the format
    xs:string?Optional decimal format name
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:format-number(1234.567, '0.00')1,234.57
    fn:format-number(-1234.567, '0.00')-1,234.57
    fn:format-number(0.12345, '0.00%')12.35%

    + W3C Documentation reference: Format-Number
    - - + + + fn:format-integer(xs:integer?, xs:string) +
    + Formats an integer value according to the supplied picture string
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:integer?Integer value to be formatted
    xs:stringPicture string defining the format
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:format-integer(12345, '0,0')12,345
    fn:format-integer(-1234, '0,0')-1,234
    fn:format-integer(1234, '00-00-00')01-23-45

    + W3C Documentation reference: Format-Integer +
    + + + fn:round-half-to-even(numeric?) +
    + Returns the closest integer to the given numeric value, rounding half-way cases to the + nearest even integer (also known as "bankers' rounding")
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    numeric?Numeric value for which the rounded value will be calculated
    + Examples:
    + + + + + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:round-half-to-even(3.5)4
    fn:round-half-to-even(2.5)2
    fn:round-half-to-even(-1.5)-2
    fn:round-half-to-even(xs:decimal('1.25'), 1)1.2

    + W3C Documentation reference: Round-Half-To-Even +
    + + + fn:round(numeric?) +
    + Returns the closest integer to the given numeric value, rounding half-way cases away + from zero
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    numeric?Numeric value for which the rounded value will be calculated
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:round(3.14)3
    fn:round(-4.7)-5
    fn:round(xs:decimal('2.5'))3

    + W3C Documentation reference: Round +
    + + + fn:floor(numeric?) +
    + Returns the largest integer less than or equal to the given numeric value
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    numeric?Numeric value for which the floor value will be calculated
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:floor(3.14)3
    fn:floor(-4.7)-5
    fn:floor(xs:decimal('2.5'))2

    + W3C Documentation reference: Floor +
    + + + + fn:ceiling(numeric?) +
    + Returns the smallest integer greater than or equal to the given numeric value
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    numeric?Numeric value for which the ceiling value will be calculated
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:ceiling(3.14)4
    fn:ceiling(-4.7)-4
    fn:ceiling(xs:decimal('2.5'))3

    + W3C Documentation reference: Ceiling +
    + + + fn:abs(numeric?) +
    + Returns the absolute value of the given numeric value
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    numeric?Numeric value for which the absolute value will be calculated
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:abs(-42)42
    fn:abs(3.14)3.14
    fn:abs(xs:decimal('-5.5'))5.5

    + W3C Documentation reference: Abs +
    + + fn:number(item?) +
    + Converts the given value to a number
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    item?Returns the numeric value of the specified expression or the context item + (if no argument is provided)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:number(/library/fiction:book[1]/@id)1 (if the first fiction:book element's id attribute is "1")
    fn:number(/library/fiction:book[1]/price)19.99 (if the first fiction:book element's price element contains "19.99") +

    + W3C Documentation reference: Number +
    + + + + +
    +
    +
    + + + +
    + + fn:fold-right(item()*, item()*, function(item(), 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(item()*, item()*, function(item()*, 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() +
    + 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(xs:string?) +
    + 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(xs:anyAtomicType*, 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(xs:anyAtomicType*, xs:string) +
    + 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(xs:anyAtomicType*, xs:string) +
    + 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(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(item()*) +
    + 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(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(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(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(item()* , item()*) +
    + 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(xs:anyAtomicType*, xs:anyAtomicType) +
    + 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(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(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(item()*, xs:double, xs:double) +
    + 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(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(item()*, xs:integer) +
    + 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(item()*, xs:integer, 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(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(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(item()*) +
    + 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(item()*) +
    + 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:data(item*) +
    + Returns the simple value of an item or a sequence of items
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    item?Returns the simple value of the specified item or the context item (if no + argument is provided)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:data(/library/fiction:book[1]/title)The Catcher in the Rye
    fn:data(/library/fiction:book[2]/author)Harper Lee

    + W3C Documentation reference: Data +
    + +
    @@ -5144,46 +8974,1175 @@
    - - - fn:adjust-date-to-timezone(date,timezone) -
    - If the timezone argument is empty, it returns a date without a timezone. Otherwise, - it returns a date with a timezone
    - Arguments and return type: - - - - - - - - - - - - - -
    TypeDescription
    datedate to be adjusted
    timezonetimezone to be imposed into date
    Examples:
    - - - - - - - - - -
    ExpressionResult
    adjust-date-to-timezone(xs:date('2011-11-15'), - xs:dayTimeDuration("PT10H"))2011-11-15+10:00

    - W3C Documentation reference: #func-adjust-date-to-timezone -
    - - - - - + fn:implicit-timezone() +
    + 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() +
    + 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() +
    + 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() +
    + 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(xs:time?, xs:string, xs:string?, xs:string?, 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(xs:date?, xs:string, xs:string?, xs:string?, 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(xs:dateTime?, xs:string, xs:string?, xs:string?, 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(xs:time?, xs:dayTimeDuration?) +
    + 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(xs:date?, xs:dayTimeDuration?) +
    + 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(xs:dateTime?, xs:dayTimeDuration?) +
    + 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(xs:time?) +
    + 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(xs:time?) +
    + 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(xs:time?) +
    + 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(xs:time?) +
    + 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(xs:date?) +
    + 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(xs:date?) +
    + 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(xs:date?) +
    + 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(xs:date?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:date?, xs:time?) +
    + Constructs an xs:dateTime value from an xs:date and an xs:time value
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:date?Date value
    xs:time?Time value
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:dateTime(xs:date('2023-03-29'), xs:time('12:30:00'))2023-03-29T12:30:00
    fn:dateTime(xs:date('2023-03-29+05:00'), xs:time('12:30:00-08:00'))2023-03-29T12:30:00-08:00

    + W3C Documentation reference: DateTime +
    + + + fn:seconds-from-duration(xs:duration?) +
    + Returns the seconds component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the seconds component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:seconds-from-duration(xs:dayTimeDuration('PT1H30M15.5S'))15.5
    fn:seconds-from-duration(xs:dayTimeDuration('-PT2M10.3S'))-10.3

    + W3C Documentation reference: Seconds-From-Duration +
    + + + fn:minutes-from-duration(xs:duration?) +
    + Returns the minutes component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the minutes component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:minutes-from-duration(xs:dayTimeDuration('PT2H30M'))30
    fn:minutes-from-duration(xs:dayTimeDuration('-PT1H45M'))-45

    + W3C Documentation reference: Minutes-From-Duration +
    + + + fn:hours-from-duration(xs:duration?) +
    + Returns the hours component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the hours component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:hours-from-duration(xs:dayTimeDuration('PT36H'))36
    fn:hours-from-duration(xs:dayTimeDuration('-PT12H30M'))-12

    + W3C Documentation reference: Hours-From-Duration +
    + + + fn:days-from-duration(xs:duration?) +
    + Returns the days component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the days component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:days-from-duration(xs:dayTimeDuration('P5DT12H30M'))5
    fn:days-from-duration(xs:dayTimeDuration('-P2DT6H'))-2

    + W3C Documentation reference: Days-From-Duration +
    + + + + fn:months-from-duration(xs:duration?) +
    + Returns the months component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the months component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:months-from-duration(xs:duration('P2Y3M4DT5H6M7S'))3
    fn:months-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-3

    + W3C Documentation reference: Months-From-Duration +
    + + + fn:years-from-duration(xs:duration?) +
    + Returns the years component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the years component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:years-from-duration(xs:duration('P2Y3M4DT5H6M7S'))2
    fn:years-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-2

    + W3C Documentation reference: Years-From-Duration +
    @@ -5191,20 +10150,89 @@
    - - - fn:error() -
    - https://www.w3.org/TR/xpath-functions/#func-error
    -
    - W3C Documentation reference: #func-error -
    - - - - - + + fn:trace(item()*, xs:string) +
    + Outputs the provided label and value for diagnostic purposes and returns the value + unchanged
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    item()*Value to be traced
    xs:stringLabel to be output along with the value
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:trace(42, 'The value is:')Outputs "The value is: 42" for diagnostic purposes and returns 42
    fn:trace(/library/book/title, 'Book title:')Outputs "Book title: [book title]" for diagnostic purposes and returns + the book title

    + W3C Documentation reference: Trace +
    + + + fn:error(xs:QName?, xs:string?, $error-object) +
    + Raises an error with the specified error code, description, and error object
    + Arguments and return type: + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:QName?Error code (optional)
    xs:string?Description of the error (optional)
    item()*Error object (optional)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:error(xs:QName('err:FOER0000'))Raise error with the code err:FOER0000
    fn:error(xs:QName('err:FOER0000'), 'Invalid value')Raise error with the code err:FOER0000 and description "Invalid value" +

    + W3C Documentation reference: Error +
    +
    @@ -5212,44 +10240,6863 @@
    - - - fn:nilled(node) -
    - Returns a Boolean value indicating whether the argument node is nilled
    -
    - W3C Documentation reference: #func-nilled - -
    - - - - - + + fn:function-arity(function(*)) +
    + 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(*)) +
    + 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(xs:QName, xs:integer) +
    + 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() +
    + 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() +
    + 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(item()?, item()?) +
    + 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(xs:string?) +
    + 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(xs:string?) +
    + 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() +
    + 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(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(xs:string?) +
    + 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(xs:string?) +
    + 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(xs:string?) +
    + 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()?) +
    + 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(xs:string*) +
    + 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(xs:string*) +
    + 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(xs:string, node()?) +
    + 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()) +
    + 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(xs:string?, element()) +
    + 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(xs:QName?) +
    + 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(xs:QName?) +
    + 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(xs:QName?) +
    + 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(xs:string?, xs:string) +
    + 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(xs:string?, element()) +
    + 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) +
    + Returns a Boolean value indicating whether the argument node is nilled
    +
    + W3C Documentation reference: #func-nilled + +
    + + + + +
    -
    - - fn:for-each(sequence*, function) -
    - Applies function item to every element in sequence
    -
    - W3C Documentation reference: #func-for-each -
    - - - + + fn:for-each-pair(item()*, item()*, function(item(), item())) +
    + 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(item()*, function(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(item()*, function(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 +
    +
    + +
    + + + +
    + + fn:apply(function(item()*), array(*)) +
    + Applies a function to a sequence of arguments
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    function(item()*) as item()*The function to be applied
    SequenceSequence of arguments to pass to the function
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:apply(fn:concat#2, ('Hello', ' World'))'Hello World'
    fn:apply(fn:substring#2, ('Hello World', 7))'World'

    + W3C Documentation reference: Apply +
    + + + fn:outermost(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(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(node()?) +
    + 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(node()?) +
    + 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(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(node()?) +
    + 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(node()?) +
    + 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()?) +
    + 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 +
    + + + + fn:document-uri(node?) +
    + Returns the document URI of the given node or the context item
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    node?Returns the document URI of the specified node or the context item (if no + argument is provided)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:document-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the document URI of the first + fiction:book element is "http://example.com/library.xml")
    fn:document-uri(/library)http://example.com/library.xml (assuming the document URI of the library + element is "http://example.com/library.xml")

    + W3C Documentation reference: Document-URI +
    + + + fn:base-uri(node?) +
    + Returns the base URI of the node or the context item
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    node?Returns the base URI of the specified node or the context item (if no + argument is provided)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:base-uri(/library/fiction:book[1])http://example.com/library.xml (assuming the base URI of the first + fiction:book element is "http://example.com/library.xml")
    fn:base-uri(/library)http://example.com/library.xml (assuming the base URI of the library element + is "http://example.com/library.xml")

    + W3C Documentation reference: Base-URI +
    + + + fn:node-name(node?) +
    + + Returns the name of a node as an xs:QName
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    node?Returns the name of the specified node or the context item if the argument + is omitted
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:node-name(/library/*[1])fiction:book
    fn:node-name(/library/fiction:book[1]/title)title

    + W3C Documentation reference: Node-Name +
    + +
    +
    +
    + + + +
    + + fn:not(item()*) +
    + Returns the negation of the effective boolean value of the argument
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    item()*Argument whose effective boolean value is to be negated
    + Examples:
    + + + + + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:not(1)false
    fn:not(0)true
    fn:not('')true
    fn:not('true')false

    + W3C Documentation reference: Not +
    + + + fn:false() +
    + Returns the boolean value false
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    NoneReturns the boolean value false
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:false()false
    //item[fn:false()]Returns an empty node-set

    + W3C Documentation reference: False +
    + + + fn:true() +
    + Returns the boolean value true
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    NoneReturns the boolean value true
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:true()true
    //item[fn:true()]Returns all <item> elements

    + W3C Documentation reference: True +
    + + + fn:boolean(item()*) +
    + Converts the argument to a boolean value
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    item()*Argument to be converted to a boolean value
    + Examples:
    + + + + + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:boolean(1)true
    fn:boolean(0)false
    fn:boolean('')false
    fn:boolean('true')true

    + W3C Documentation reference: Boolean +
    + + +
    +
    +
    + + + +
    + + fn:unparsed-text-available(xs:string?, xs:string?) +
    + 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(xs:string?, 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(xs:string?, 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(xs:string?) +
    + Escapes special characters in a URI to be used in HTML
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?URI to be escaped for use in HTML
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:escape-html-uri('https://example.com/search?q=test&lang=en')https://example.com/search?q=test&lang=en
    fn:escape-html-uri('https://example.com/page?id=1§ion=2')https://example.com/page?id=1&section=2

    + W3C Documentation reference: Escape-HTML-URI +
    + + + fn:iri-to-uri(xs:string?) +
    + Converts an IRI to a URI by escaping non-ASCII characters
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?IRI to be converted to a URI
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:iri-to-uri('https://example.com/ümlaut')https://example.com/%C3%BCmlaut
    fn:iri-to-uri('https://example.com/日本語')https://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E

    + W3C Documentation reference: IRI-to-URI +
    + + + fn:encode-for-uri(xs:string?) +
    + Encodes a string for use in a URI by escaping special characters
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?String to be encoded for use in a URI
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:encode-for-uri('hello world')hello%20world
    fn:encode-for-uri('example?query=value¶m=value2')example%3Fquery%3Dvalue%26param%3Dvalue2

    + W3C Documentation reference: Encode-for-URI +
    + + + fn:resolve-uri(xs:string?, xs:string?) +
    + Resolves a relative URI using a base URI
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Relative URI to resolve
    xs:string?Base URI to use for resolving (optional)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:resolve-uri('example.html', 'https://www.example.com/folder/')https://www.example.com/folder/example.html
    fn:resolve-uri('../images/pic.jpg', + 'https://www.example.com/folder/page.html')https://www.example.com/images/pic.jpg

    + W3C Documentation reference: Resolve-URI +
    + + + + fn:analyze-string(xs:string?, xs:string, xs:string?) +
    + Analyzes the input string and returns an XML fragment containing match and non-match + elements
    + Arguments and return type: + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to analyze
    xs:stringRegular expression pattern to match
    xs:string?Flags to control the regular expression matching (optional)
    + Examples:
    + + + + + + + + + +
    ExpressionResult
    fn:analyze-string('red,green,blue', ',') + <fn:analyze-string-result><fn:non-match>red</fn:non-match><fn:match>, + <fn:non-match>green</fn:non-match><fn:match>, + <fn:non-match>blue</fn:non-match></fn:analyze-string-result> +

    + W3C Documentation reference: Analyze-String +
    + + + fn:tokenize(xs:string?, xs:string, xs:string?) +
    + Splits the input string into a sequence of substrings using the pattern as a delimiter +
    + Arguments and return type: + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to tokenize
    xs:stringRegular expression pattern to use as delimiter
    xs:string?Flags to control the regular expression matching (optional)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:tokenize('XPath 3.0, XQuery 3.0, XSLT 3.0', ',\\s*')('XPath 3.0', 'XQuery 3.0', 'XSLT 3.0')
    fn:tokenize('apple,orange,banana', ',')('apple', 'orange', 'banana')

    + W3C Documentation reference: Tokenize +
    + + + fn:replace(xs:string?, xs:string, xs:string, xs:string?) +
    + Replaces occurrences of the pattern in the input string with the replacement string
    + Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to search within
    xs:stringRegular expression pattern to match
    xs:stringReplacement string
    xs:string?Flags to control the regular expression matching (optional)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:replace('XPath 3.0 is great', '3.0', '3.1')'XPath 3.1 is great'
    fn:replace('Hello, World!', 'World', 'XPath')'Hello, XPath!'

    + W3C Documentation reference: Replace +
    + + + fn:matches(xs:string?, xs:string, xs:string?) +
    + Returns true if the input string matches the regular expression pattern, otherwise false +
    + Arguments and return type: + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to search within
    xs:stringRegular expression pattern to match
    xs:string?Flags to control the regular expression matching (optional)
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:matches('XPath 3.0', '\\d\\.\\d')true
    fn:matches('Hello, World!', '[A-Z][a-z]*')true
    fn:matches('example123', '\\d+', 'q')false

    + W3C Documentation reference: Matches +
    + + + fn:substring-after(xs:string?, xs:string?) +
    + Returns the part of the first string that follows the first occurrence of the second + string
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to search within
    xs:string?Substring to search for
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:substring-after('Hello, World!', ',')' World!'
    fn:substring-after('XPath 3.0 is awesome!', '3.0')' is awesome!'

    + W3C Documentation reference: Substring-After +
    + + + fn:substring-before(xs:string?, xs:string?) +
    + Returns the part of the first string that precedes the first occurrence of the second + string
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to search within
    xs:string?Substring to search for
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:substring-before('Hello, World!', ',')'Hello'
    fn:substring-before('XPath 3.0 is awesome!', '3.0')'XPath '

    + W3C Documentation reference: Substring-Before +
    + + + fn:ends-with(xs:string?, xs:string?) +
    + Returns true if the first string ends with the second string, otherwise false
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to check
    xs:string?Substring to check for at the end of the first string
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:ends-with('Hello, World!', 'World!')true
    fn:ends-with('Hello, World!', 'Hello')false
    fn:ends-with('XPath 3.0', '3.0')true

    + W3C Documentation reference: Ends-With +
    + + + fn:starts-with(xs:string?, xs:string?) +
    + Returns true if the first string starts with the second string, otherwise false
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to check
    xs:string?Substring to check for at the beginning of the first string
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:starts-with('Hello, World!', 'Hello')true
    fn:starts-with('Hello, World!', 'World')false
    fn:starts-with('XPath 3.0', 'XPath')true

    + W3C Documentation reference: Starts-With +
    + + + fn:contains(xs:string?, xs:string?) +
    + Returns true if the first string contains the second string, otherwise false
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to search within
    xs:string?Substring to search for
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:contains('Hello, World!', 'World')true
    fn:contains('Hello, World!', 'world')false
    fn:contains('XPath 3.0', '3.0')true

    + W3C Documentation reference: Contains +
    + + + fn:translate(xs:string?, xs:string, xs:string) +
    + Returns the input string with specified characters replaced
    + Arguments and return type: + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to be translated
    xs:stringMap string with characters to replace
    xs:stringTranslate string with replacement characters
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:translate('apple', 'aeiou', '12345')'1ppl2'
    fn:translate('Hello, World!', 'HW', 'hw')'hello, world!'

    + W3C Documentation reference: Translate +
    + + + fn:lower-case(xs:string?) +
    + Returns the input string with all characters converted to lowercase
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?Input string to convert to lowercase
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:lower-case('HELLO, WORLD!')'hello, world!'
    fn:lower-case('XPath 3.0')'xpath 3.0'
    fn:lower-case('BANANA')'banana'

    + W3C Documentation reference: Lower-Case +
    + + + fn:upper-case(xs:string?) +
    + Returns the input string with all characters converted to uppercase
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?Input string to convert to uppercase
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:upper-case('Hello, World!')'HELLO, WORLD!'
    fn:upper-case('XPath 3.0')'XPATH 3.0'
    fn:upper-case('banana')'BANANA'

    + W3C Documentation reference: Upper-Case +
    + + + fn:normalize-unicode(xs:string?, xs:string) +
    + Returns the input string with Unicode normalization applied
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input string to normalize
    xs:stringNormalization form to apply (NFC, NFD, NFKC, NFKD)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:normalize-unicode('Café', 'NFC')'Café'
    fn:normalize-unicode('Café', 'NFD')'Café'

    + W3C Documentation reference: Normalize-Unicode +
    + + + fn:normalize-space(xs:string?) +
    + Returns the input string with whitespace normalized
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?Input string to normalize whitespace
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:normalize-space(' Hello, World! ')'Hello, World!'
    fn:normalize-space(' XPath 3.0 ')'XPath 3.0'
    fn:normalize-space('\tbanana\t')'banana'

    + W3C Documentation reference: Normalize-Space +
    + + + fn:string-length(xs:string?) +
    + Returns the length of the input string
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?Input string to calculate length
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:string-length('Hello, World!')13
    fn:string-length('XPath 3.0')8
    fn:string-length('banana')6

    + W3C Documentation reference: String-Length +
    + + + fn:substring(xs:string?, xs:double) +
    + Returns a substring of the source string, starting from a specific location
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?Input source string
    xs:doubleStarting location to extract the substring
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:substring('Hello, World!', 1, 5)'Hello'
    fn:substring('XPath 3.0', 7)'3.0'
    fn:substring('banana', 2, 3)'ana'

    + W3C Documentation reference: Substring +
    + + fn:string-join(xs:string*, xs:string) +
    + Joins a sequence of strings with a specified separator, returning a single string
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string*Input sequence of strings to join
    xs:stringSeparator string to insert between joined strings
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:string-join(('apple', 'banana', 'orange'), ', ')'apple, banana, orange'
    fn:string-join(('XPath', '3.0', 'Functions'), ' - ')'XPath - 3.0 - Functions'
    fn:string-join(('A', 'B', 'C'), '')'ABC'

    + W3C Documentation reference: String-Join +
    + + + fn:concat(xs:anyAtomicType?, xs:anyAtomicType?, ...) +
    + Concatenates two or more strings or atomic values, returning a single string
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:anyAtomicType?Input strings or atomic values to concatenate
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:concat('Hello', ' ', 'World')'Hello World'
    fn:concat('I have ', 3, ' apples')'I have 3 apples'
    fn:concat('XPath ', '3.0')'XPath 3.0'

    + W3C Documentation reference: Concat +
    + + + fn:codepoint-equal(xs:string?, xs:string?) +
    + Compares two strings on a codepoint-by-codepoint basis and returns true if they are + equal, false otherwise
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?First string to compare
    xs:string?Second string to compare
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:codepoint-equal('Hello', 'Hello')true
    fn:codepoint-equal('Hello', 'hello')false
    fn:codepoint-equal('apple', 'banana')false

    + W3C Documentation reference: Codepoint-Equal +
    + + + fn:compare(xs:string?, xs:string?) +
    + Compares two strings and returns -1, 0, or 1 if the first string is less than, equal to, + or greater than the second string, respectively
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?First string to compare
    xs:string?Second string to compare
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:compare('apple', 'banana')-1
    fn:compare('apple', 'apple')0
    fn:compare('banana', 'apple')1

    + W3C Documentation reference: Compare +
    + + + fn:string-to-codepoints(xs:string?) +
    + Returns a sequence of Unicode code points for a given string
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?Input string
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:string-to-codepoints('Hello')(72, 101, 108, 108, 111)
    fn:string-to-codepoints('( ͡° ͜ʖ ͡°)')(40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)
    fn:string-to-codepoints('😊')(128522)

    + W3C Documentation reference: String-To-Codepoints +
    + + + fn:codepoints-to-string(xs:integer*) +
    + Constructs a string from a sequence of Unicode code points
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:integer*Sequence of Unicode code points
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:codepoints-to-string((72, 101, 108, 108, 111))Hello
    codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41)) + ( ͡° ͜ʖ ͡°)
    fn:codepoints-to-string((128522))😊

    + W3C Documentation reference: Codepoints-To-String +
    + + + + fn:string(object) +
    + Returns the string representation of the object argument
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    stringThe object to convert to a string
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    string((1<0))false
    string(.11)0.11

    + W3C Documentation reference: String-Functions +
    + + +
    +
    +
    + + + +
    + + + fn:format-number(numeric?, xs:string, item()?) +
    + Returns a string that represents a formatted version of a number using a formatting + pattern and an optional + set of properties
    + Arguments and return type: + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    numeric?The number to format
    xs:stringThe formatting pattern
    item()?Optional: the set of properties for formatting the number
    xs:stringThe formatted number as a string
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    format-number(12345.678, "#,##0.00")Returns the formatted number: "12,345.68"
    format-number(12345.678, "#,##0")Returns the formatted number: "12,346"
    format-number(12345.678, "0.000")Returns the formatted number: "12345.678"

    + W3C Documentation reference: format-number +
    + + + + fn:format-integer(xs:integer?, xs:string) +
    + Formats an integer value according to the supplied picture string
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:integer?Integer value to be formatted
    xs:stringPicture string defining the format
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:format-integer(12345, '0,0')12,345
    fn:format-integer(-1234, '0,0')-1,234
    fn:format-integer(1234, '00-00-00')01-23-45

    + W3C Documentation reference: Format-Integer +
    + + + fn:round-half-to-even(numeric?) +
    + Returns the closest integer to the given numeric value, rounding half-way cases to the + nearest even integer (also known as "bankers' rounding")
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    numeric?Numeric value for which the rounded value will be calculated
    + Examples:
    + + + + + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:round-half-to-even(3.5)4
    fn:round-half-to-even(2.5)2
    fn:round-half-to-even(-1.5)-2
    fn:round-half-to-even(xs:decimal('1.25'), 1)1.2

    + W3C Documentation reference: Round-Half-To-Even +
    + + + fn:round(numeric?) +
    + Returns the closest integer to the given numeric value, rounding half-way cases away + from zero
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    numeric?Numeric value for which the rounded value will be calculated
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:round(3.14)3
    fn:round(-4.7)-5
    fn:round(xs:decimal('2.5'))3

    + W3C Documentation reference: Round +
    + + + fn:floor(numeric?) +
    + Returns the largest integer less than or equal to the given numeric value
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    numeric?Numeric value for which the floor value will be calculated
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:floor(3.14)3
    fn:floor(-4.7)-5
    fn:floor(xs:decimal('2.5'))2

    + W3C Documentation reference: Floor +
    + + + + fn:ceiling(numeric?) +
    + Returns the smallest integer greater than or equal to the given numeric value
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    numeric?Numeric value for which the ceiling value will be calculated
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:ceiling(3.14)4
    fn:ceiling(-4.7)-4
    fn:ceiling(xs:decimal('2.5'))3

    + W3C Documentation reference: Ceiling +
    + + + fn:abs(numeric?) +
    + Returns the absolute value of the given numeric value
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    numeric?Numeric value for which the absolute value will be calculated
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    fn:abs(-42)42
    fn:abs(3.14)3.14
    fn:abs(xs:decimal('-5.5'))5.5

    + W3C Documentation reference: Abs +
    + + fn:number(item?) +
    + Converts the given value to a number
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    item?Returns the numeric value of the specified expression or the context item + (if no argument is provided)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:number(/library/fiction:book[1]/@id)1 (if the first fiction:book element's id attribute is "1")
    fn:number(/library/fiction:book[1]/price)19.99 (if the first fiction:book element's price element contains "19.99") +

    + W3C Documentation reference: Number +
    + + + + +
    +
    +
    + + + +
    + + fn:sort(item()*) +
    + Sorts an array of items based on their atomic values
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    ArrayThe array of items to be sorted
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:sort([10, 5, 20])[5, 10, 20]
    fn:sort(['banana', 'apple', 'cherry'])['apple', 'banana', 'cherry']

    + W3C Documentation reference: Sort +
    + + + fn:fold-right(item()*, item()*, function(item(), 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(item()*, item()*, function(item()*, 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() +
    + 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(xs:string?) +
    + Returns a sequence of document nodes obtained from the collection identified by the + argument URI, or the + default collection if no argument is supplied.
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:string?The URI of the collection to retrieve (Optional)
    document-node()*A sequence of document nodes obtained from the collection
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    collection()Returns the sequence of document nodes from the default collection
    collection("http://example.com/collection")Returns the sequence of document nodes from the collection identified by the + specified URI
    count(collection())Returns the number of document nodes in the default collection

    + W3C Documentation reference: collection +
    + + + fn:sum(xs:anyAtomicType*, 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(xs:anyAtomicType*) +
    + Returns the minimum value of a sequence of atomic values, according to the ordering + rules for the value's + type
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:anyAtomicType*The input sequence of atomic values
    xs:anyAtomicType?The minimum value of the input sequence, or the empty sequence if the input + sequence is empty +
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    min((5, 1, 9, 3))Returns the minimum value: 1
    min(())Returns the empty sequence: ()
    min(("apple", "banana", "cherry"))Returns the minimum value (alphabetical order): "apple"

    + W3C Documentation reference: min +
    + + + fn:max(xs:anyAtomicType*) +
    + Returns the maximum value of a sequence of atomic values, according to the ordering + rules for the value's + type
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:anyAtomicType*The input sequence of atomic values
    xs:anyAtomicType?The maximum value of the input sequence, or the empty sequence if the input + sequence is empty +
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    max((5, 1, 9, 3))Returns the maximum value: 9
    max(())Returns the empty sequence: ()
    max(("apple", "banana", "cherry"))Returns the maximum value (alphabetical order): "cherry"

    + W3C Documentation reference: max +
    + + + + fn:avg(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(item()*) +
    + 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(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(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(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(item()* , item()*) +
    + 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(xs:anyAtomicType*, xs:anyAtomicType) +
    + 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(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(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(item()*, xs:double, xs:double) +
    + 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(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(item()*, xs:integer) +
    + 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(item()*, xs:integer, 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(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(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(item()*) +
    + 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(item()*) +
    + 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:data(item*) +
    + Returns the simple value of an item or a sequence of items
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    item?Returns the simple value of the specified item or the context item (if no + argument is provided)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:data(/library/fiction:book[1]/title)The Catcher in the Rye
    fn:data(/library/fiction:book[2]/author)Harper Lee

    + W3C Documentation reference: Data +
    + + +
    +
    +
    + + + +
    + + + + fn:implicit-timezone() +
    + 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() +
    + 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() +
    + 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() +
    + 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(xs:time?, xs:string, xs:string?, xs:string?, xs:string?) +
    + Formats a time value according to a formatting picture string, with optional language, + calendar, and + country parameters.
    + Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:time?The time value to be formatted (Optional)
    xs:stringThe formatting picture string
    xs:string?The language for formatting (Optional)
    xs:string?The calendar for formatting (Optional)
    xs:string?The country for formatting (Optional)
    xs:stringThe formatted time value as a string
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    format-time(xs:time("14:30:00"), "[H]:[m]")"14:30"
    format-time(xs:time("14:30:00"), "[H]:[m]:[s]")"14:30:00"
    format-time(xs:time("14:30:00.456"), "[H]:[m]:[s].[f]")"14:30:00.456"

    + W3C Documentation reference: format-time +
    + + + + fn:format-date(xs:date?, xs:string, xs:string?, xs:string?, 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(xs:dateTime?, xs:string, xs:string?, xs:string?, xs:string?) +
    + Formats a dateTime value according to a formatting picture string, with optional + language, calendar, and + country parameters.
    + Arguments and return type: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:dateTime?The dateTime value to be formatted (Optional)
    xs:stringThe formatting picture string
    xs:string?The language for formatting (Optional)
    xs:string?The calendar for formatting (Optional)
    xs:string?The country for formatting (Optional)
    xs:stringThe formatted dateTime value as a string
    + Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    format-dateTime(xs:dateTime("2023-04-12T14:30:00"), "[Y]-[M]-[D]T[H]:[m]") + "2023-04-12T14:30"
    format-dateTime(xs:dateTime("2023-04-12T14:30:00"), "[FNn, Nn] [D] [MNn] + [Y]")"Wednesday, 12 April 2023"
    format-dateTime(xs:dateTime("2023-04-12T14:30:00.123"), + "[Y]-[M]-[D]T[H]:[m]:[s].[f]")"2023-04-12T14:30:00.123"

    + W3C Documentation reference: format-dateTime +
    + + + + fn:adjust-time-to-timezone(xs:time?, xs:dayTimeDuration?) +
    + 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(xs:date?, xs:dayTimeDuration?) +
    + 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(xs:dateTime?, xs:dayTimeDuration?) +
    + 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(xs:time?) +
    + 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(xs:time?) +
    + 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(xs:time?) +
    + 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(xs:time?) +
    + 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(xs:date?) +
    + 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(xs:date?) +
    + 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(xs:date?) +
    + 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(xs:date?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:dateTime?) +
    + 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(xs:date?, xs:time?) +
    + Constructs an xs:dateTime value from an xs:date and an xs:time value
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    xs:date?Date value
    xs:time?Time value
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:dateTime(xs:date('2023-03-29'), xs:time('12:30:00'))2023-03-29T12:30:00
    fn:dateTime(xs:date('2023-03-29+05:00'), xs:time('12:30:00-08:00'))2023-03-29T12:30:00-08:00

    + W3C Documentation reference: DateTime +
    + + + fn:seconds-from-duration(xs:duration?) +
    + Returns the seconds component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the seconds component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:seconds-from-duration(xs:dayTimeDuration('PT1H30M15.5S'))15.5
    fn:seconds-from-duration(xs:dayTimeDuration('-PT2M10.3S'))-10.3

    + W3C Documentation reference: Seconds-From-Duration +
    + + + fn:minutes-from-duration(xs:duration?) +
    + Returns the minutes component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the minutes component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:minutes-from-duration(xs:dayTimeDuration('PT2H30M'))30
    fn:minutes-from-duration(xs:dayTimeDuration('-PT1H45M'))-45

    + W3C Documentation reference: Minutes-From-Duration +
    + + + fn:hours-from-duration(xs:duration?) +
    + Returns the hours component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the hours component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:hours-from-duration(xs:dayTimeDuration('PT36H'))36
    fn:hours-from-duration(xs:dayTimeDuration('-PT12H30M'))-12

    + W3C Documentation reference: Hours-From-Duration +
    + + + fn:days-from-duration(xs:duration?) +
    + Returns the days component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the days component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:days-from-duration(xs:dayTimeDuration('P5DT12H30M'))5
    fn:days-from-duration(xs:dayTimeDuration('-P2DT6H'))-2

    + W3C Documentation reference: Days-From-Duration +
    + + + + fn:months-from-duration(xs:duration?) +
    + Returns the months component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the months component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:months-from-duration(xs:duration('P2Y3M4DT5H6M7S'))3
    fn:months-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-3

    + W3C Documentation reference: Months-From-Duration +
    + + + fn:years-from-duration(xs:duration?) +
    + Returns the years component of the duration
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:duration?Duration from which to extract the years component
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:years-from-duration(xs:duration('P2Y3M4DT5H6M7S'))2
    fn:years-from-duration(xs:duration('-P2Y3M4DT5H6M7S'))-2

    + W3C Documentation reference: Years-From-Duration +
    +
    +
    +
    + + + +
    + + fn:trace(item()*, xs:string) +
    + Outputs the provided label and value for diagnostic purposes and returns the value + unchanged
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    item()*Value to be traced
    xs:stringLabel to be output along with the value
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:trace(42, 'The value is:')Outputs "The value is: 42" for diagnostic purposes and returns 42
    fn:trace(/library/book/title, 'Book title:')Outputs "Book title: [book title]" for diagnostic purposes and returns + the book title

    + W3C Documentation reference: Trace +
    + + + fn:error(xs:QName?, xs:string?, $error-object) +
    + Raises an error with the specified error code, description, and error object
    + Arguments and return type: + + + + + + + + + + + + + + + + + +
    TypeDescription
    xs:QName?Error code (optional)
    xs:string?Description of the error (optional)
    item()*Error object (optional)
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:error(xs:QName('err:FOER0000'))Raise error with the code err:FOER0000
    fn:error(xs:QName('err:FOER0000'), 'Invalid value')Raise error with the code err:FOER0000 and description "Invalid value" +

    + W3C Documentation reference: Error +
    + +
    +
    +
    + + + +
    + + fn:xml-to-json(node(), map(*)) +
    + Converts an XML representation of a JSON value to its JSON serialization
    + Arguments and return type: + + + + + + + + + + + + + +
    TypeDescription
    node()XML representation of a JSON value
    map(*)Options for the JSON serialization
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:xml-to-json('<map><string + key="name">John</string><number + key="age">30</number></map>')'{"name": "John", "age": 30}'
    fn:xml-to-json('<array><number>1</number><number>2</number><number>3</number></array>') + '[1, 2, 3]'

    + W3C Documentation reference: XML-to-JSON +
    + + + fn:json-to-xml(item()) +
    + Converts a JSON value to its XML representation
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    item()JSON value to be converted
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:json-to-xml(map{"name": "John", "age": 30}) + <map> + <string key="name">John</string> + <number key="age">30</number> + </map> +
    fn:json-to-xml([1, 2, 3]) + <array> + <number>1</number> + <number>2</number> + <number>3</number> + </array> +

    + W3C Documentation reference: JSON-to-XML +
    + + + fn:json-doc(xs:string) +
    + Parses a JSON document from a URI and returns the corresponding value
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:stringURI of the JSON document to be parsed
    + Examples:
    + + + + + + + + + +
    ExpressionResult
    fn:json-doc('https://example.com/data.json')Parsed JSON value from the specified URI

    + W3C Documentation reference: JSON-Doc +
    + + + fn:parse-json(xs:string?) +
    + Parses a JSON string and returns the corresponding value
    + Arguments and return type: + + + + + + + + + +
    TypeDescription
    xs:string?JSON string to be parsed
    + Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    fn:parse-json('{"name": "John", "age": 30}')map{"name": "John", "age": 30}
    fn:parse-json('[1, 2, 3]')[1, 2, 3]

    + W3C Documentation reference: Parse-JSON +
    + + + fn:function-arity(function(*)) +
    + 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(*)) +
    + 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(xs:QName, xs:integer) +
    + 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() +
    + 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() +
    + 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(item()?, item()?) +
    + 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(xs:string?) +
    + 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(xs:string?) +
    + 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() +
    + 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(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(xs:string?) +
    + 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(xs:string?) +
    + 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(xs:string?) +
    + 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()?) +
    + 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(xs:string*) +
    + 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(xs:string*) +
    + 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(xs:string, node()?) +
    + 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()) +
    + 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(xs:string?, element()) +
    + 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(xs:QName?) +
    + 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(xs:QName?) +
    + 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(xs:QName?) +
    + 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(xs:string?, xs:string) +
    + 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(xs:string?, element()) +
    + 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) +
    + Returns a Boolean value indicating whether the argument node is nilled
    +
    + W3C Documentation reference: #func-nilled + +
    + + + + + +
    +
    +
    + + + +
    + + fn:for-each-pair(item()*, item()*, function(item(), item())) +
    + 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(item()*, function(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(item()*, function(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 +
    + +
    +
    +
    +
    From db055ef58baa94abde130cbb641cc8069683aee7 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 19 Apr 2023 13:26:10 +0200 Subject: [PATCH 15/59] Resolved another conflict --- Frontend/tools/xpath.html | 194 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 383888b..106f557 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -906,6 +906,200 @@ + +
    + + + +
    + + + fn:number() +
    + The number function converts its argument to a number as follows: +
      +
    • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
    • +
    • boolean true is converted to 1; boolean false is converted to 0
    • +
    • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
    • +
    • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
    • +
    + + Arguments: + + + + + + + + + +
    TypeDescription
    objectThe object to convert to a number
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    number(10)10
    number("")NaN

    + W3C Documentation reference +
    + + fn:sum() +
    + The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
    + + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + +
    ExpressionResult
    sum(/l:library/l:readerList/p:person/p:readerID)12444

    + W3C Documentation reference +
    + + fn:floor() +
    + The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
    + + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    floor(3.1)4
    floor(3.9)4
    floor(3.5)4

    + W3C Documentation reference +
    + + fn:ceiling() +
    + The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
    + + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    floor(3.1)3
    floor(3.9)3
    floor(3.5)3

    + W3C Documentation reference +
    + + + fn:round() +
    + The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. + +

    NOTE

    + For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
    + + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    floor(3.1)3
    floor(3.9)4
    floor(3.5)3

    + W3C Documentation reference +
    + +
    +
    +
    From 5c39b7cfe08fe3002e74fcd1d38e20d382dd945a Mon Sep 17 00:00:00 2001 From: Dariusz Augustyniak Date: Fri, 14 Apr 2023 10:42:47 +0200 Subject: [PATCH 16/59] Fixed error codes and added logging (#138) fixed error codes (400 not 500) and added logging for json Co-authored-by: augustyd Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/138 Co-authored-by: Dariusz Augustyniak Co-committed-by: Dariusz Augustyniak --- .../java/com/r11/tools/SparkApplication.java | 6 +++- .../r11/tools/controller/JsonController.java | 33 ++++++++++++------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java b/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java index affcebb..cee98f2 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java @@ -32,12 +32,16 @@ public class SparkApplication { .setPrettyPrinting() .create(); + Gson jsongson = new GsonBuilder() + .disableHtmlEscaping() + .create(); + RestControllerRegistry registry = new RestControllerRegistry(); registry.registerController(new ProcessorInfoController(logger)); registry.registerController(new XsdController(gson, logger)); registry.registerController(new XPathController(gson, logger)); registry.registerController(new XsltController(gson, logger)); - registry.registerController(new JsonController()); + registry.registerController(new JsonController(gson, jsongson, logger)); registry.register(); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java index 1d465fd..8574c3b 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java @@ -1,7 +1,7 @@ package com.r11.tools.controller; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +//import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.r11.tools.controller.internal.GlobalControllerManifest; import com.r11.tools.controller.internal.HandlerType; @@ -9,18 +9,22 @@ import com.r11.tools.controller.internal.RestController; import com.r11.tools.controller.internal.ScopedControllerManifest; import spark.Request; import spark.Response; +import org.apache.logging.log4j.Logger; @GlobalControllerManifest(path = "/json") public class JsonController implements RestController { - private final Gson prettyGson = new GsonBuilder() - .disableHtmlEscaping() - .setPrettyPrinting() - .create(); + private final Logger logger; - private final Gson gson = new GsonBuilder() - .disableHtmlEscaping() - .create(); + private final Gson prettyGson; + + private final Gson gson; + + public JsonController(Gson prettyGson, Gson jsongson,Logger logger) { + this.logger = logger; + this.prettyGson = prettyGson; + this.gson = jsongson; + } @ScopedControllerManifest(method = HandlerType.POST, path = "/formatting") public void formatting(Request request, Response response) { @@ -35,17 +39,20 @@ public class JsonController implements RestController { responseJson.addProperty("data", this.prettyGson.toJson(requestJson)); responseJson.addProperty("time", System.currentTimeMillis() - startProcess); - response.body(this.prettyGson.toJson(responseJson)); + } catch (Exception e) { + this.logger.error("Error on formatting Json " + e); Throwable cause = e.getCause(); - response.status(500); + response.status(400); responseJson.addProperty("data", cause == null ? e.getMessage() : cause.getMessage()); responseJson.addProperty("time", System.currentTimeMillis() - startProcess); + + } + this.logger.info("Json processed in " + responseJson.get("time").toString() + " ms."); response.body(this.prettyGson.toJson(responseJson)); - } } @ScopedControllerManifest(method = HandlerType.POST, path = "/minimize") @@ -63,14 +70,16 @@ public class JsonController implements RestController { response.body(this.gson.toJson(responseJson)); } catch (Exception e) { + this.logger.error("Error on minimizeing Json " + e); Throwable cause = e.getCause(); - response.status(500); + response.status(400); responseJson.addProperty("data", cause == null ? e.getMessage() : cause.getMessage()); responseJson.addProperty("time", System.currentTimeMillis() - startProcess); response.body(this.prettyGson.toJson(responseJson)); } + this.logger.info("Json processed in " + responseJson.get("time").toString() + " ms."); } } From 2f0541fe3dadee8017dd015eb7a3334e2838a023 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 19 Apr 2023 13:27:06 +0200 Subject: [PATCH 17/59] Resolved another conflict --- Frontend/assets/css/tools/r11form.css | 3 +- Frontend/tools/xpath.html | 629 ++++++++++++++------------ 2 files changed, 335 insertions(+), 297 deletions(-) diff --git a/Frontend/assets/css/tools/r11form.css b/Frontend/assets/css/tools/r11form.css index 2c70e8c..4430b85 100644 --- a/Frontend/assets/css/tools/r11form.css +++ b/Frontend/assets/css/tools/r11form.css @@ -440,12 +440,11 @@ body { .content { padding: 0px 15px 0px 15px ; - text-align: justify; + text-align: left; overflow: hidden; transition: max-height .2s ease-out; max-height: 0px; border-left: #c0c2c3 2px solid; - } .collapsibleMini::before{ diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 106f557..ce5321a 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -29,7 +29,7 @@

    What is XPath?

    -

    XPath is a query language used for selecting nodes from XML and processing them.
    - It may perform operations on strings, numbers and boolean values.

    +

    + XPath is a query language used for selecting nodes from XML and processing them.
    + It may perform operations on strings, numbers and boolean values.
    +

    +

    +

    Semantics legend:

    +

    + "+" - 1 or more elements +

    +

    + "*" - 0 or more elements +

    +

    + "?" - optional element +

    +

    - +

    XPath 2.0 introduced many new features XQuery-cośtam:
    @@ -136,33 +151,33 @@ fn:count()

    - Returns the number of nodes in the node-set
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode-set to count nodes in
    Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    count(//b:book)5
    count(//person[@id>5])17

    - W3C Documentation reference: Node-Set-Functions + Returns the number of nodes in the node-set
    + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode-set to count nodes in
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    count(//b:book)5
    count(//person[@id>5])17

    + W3C Documentation reference: Node-Set-Functions
    @@ -180,97 +195,97 @@ fn:local-name()
    - Returns the local-name for the first node in the node-set
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-setExtract first node and return its local name
    Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    local-name(//b:books)b:book
    local-name(//b:book)b:title

    - W3C Documentation reference: Node-Set-Functions + Returns the local-name for the first node in the node-set
    + Arguments: + + + + + + + + + +
    TypeDescription
    node-setExtract first node and return its local name
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    local-name(//b:books)b:book
    local-name(//b:book)b:title

    + W3C Documentation reference: Node-Set-Functions
    fn:namespace-uri()
    - Returns the namespace-uri for the first node in the node-set
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-setExtract first node and return the namespace URI
    Examples:
    - - - - - - - - - -
    ExpressionResult
    namespace-uri(//b:book)http://www.book.com

    - W3C Documentation reference: Node-Set-Functions + Returns the namespace-uri for the first node in the node-set
    + Arguments: + + + + + + + + + +
    TypeDescription
    node-setExtract first node and return the namespace URI
    Examples:
    + + + + + + + + + +
    ExpressionResult
    namespace-uri(//b:book)http://www.book.com

    + W3C Documentation reference: Node-Set-Functions
    fn:name()
    - Returns the name for the first node in the node-set
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-set (Optional)Extract first node and return QName
    Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    name(//b:books/*)b:book
    name(//b:book/*)b:title

    - W3C Documentation reference: Node-Set-Functions + Returns the name for the first node in the node-set
    + Arguments: + + + + + + + + + +
    TypeDescription
    node-set (Optional)Extract first node and return QName
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    name(//b:books/*)b:book
    name(//b:book/*)b:title

    + W3C Documentation reference: Node-Set-Functions
    - +
    @@ -322,46 +337,55 @@ fn:not()
    - The not function returns true if its argument is false, and false otherwise.
    -
    - W3C Documentation reference: Boolean-Functions + The not function returns true if its argument is false, and false otherwise.
    +
    + W3C Documentation reference: Boolean-Functions
    fn:true()
    - The true function returns true.
    -
    - W3C Documentation reference: Boolean-Functions + The true function returns true.
    +
    + W3C Documentation reference: Boolean-Functions
    fn:false()
    - The true function returns false.
    -
    - W3C Documentation reference: Boolean-Functions + The true function returns false.
    +
    + W3C Documentation reference: Boolean-Functions
    fn:lang()
    - The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
    - Arguments: - - - - - - - - - -
    TypeDescription
    stringLanguage that will be looked for in context node
    Examples: Look W3C documentation
    + The lang function returns true or false depending on whether the language of the context + node as specified by xml:lang attributes is the same as or is a sublanguage of the + language specified by the argument string. The language of the context node is + determined by the value of the xml:lang attribute on the context node, or, if the + context node has no xml:lang attribute, by the value of the xml:lang attribute on the + nearest ancestor of the context node that has an xml:lang attribute. If there is no such + attribute, then lang returns false. If there is such an attribute, then lang returns + true if the attribute value is equal to the argument ignoring case, or if there is some + suffix starting with - such that the attribute value is equal to the argument ignoring + that suffix of the attribute value and ignoring case.
    + Arguments: + + + + + + + + + +
    TypeDescription
    stringLanguage that will be looked for in context node
    Examples: Look W3C documentation

    - W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions
    @@ -906,7 +930,6 @@
    -
    @@ -917,189 +940,205 @@ fn:number()
    - The number function converts its argument to a number as follows: -
      -
    • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
    • -
    • boolean true is converted to 1; boolean false is converted to 0
    • -
    • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
    • -
    • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
    • -
    + The number function converts its argument to a number as follows: +
      +
    • a string that consists of optional whitespace followed by an optional minus sign + followed by a Number followed by whitespace is converted to the IEEE 754 number + that is nearest (according to the IEEE 754 round-to-nearest rule) to the + mathematical value represented by the string; any other string is converted to + NaN
    • +
    • boolean true is converted to 1; boolean false is converted to 0
    • +
    • a node-set is first converted to a string as if by a call to the string function + and then converted in the same way as a string argument
    • +
    • an object of a type other than the four basic types is converted to a number in + a way that is dependent on that type
    • +
    - Arguments: - - - - - - - - - -
    TypeDescription
    objectThe object to convert to a number
    Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    number(10)10
    number("")NaN

    - W3C Documentation reference + Arguments: + + + + + + + + + +
    TypeDescription
    objectThe object to convert to a number
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    number(10)10
    number("")NaN

    + W3C Documentation reference
    fn:sum()
    - The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
    + The sum function returns the sum, for each node in the argument node-set, of the result + of converting the string-values of the node to a number.
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - -
    ExpressionResult
    sum(/l:library/l:readerList/p:person/p:readerID)12444

    - W3C Documentation reference + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + +
    ExpressionResult
    sum(/l:library/l:readerList/p:person/p:readerID)12444

    + W3C Documentation reference
    fn:floor()
    - The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
    + The floor function returns the largest (closest to positive infinity) number that is not + greater than the argument and that is an integer.
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - - - - - - - - - -
    ExpressionResult
    floor(3.1)4
    floor(3.9)4
    floor(3.5)4

    - W3C Documentation reference + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    floor(3.1)4
    floor(3.9)4
    floor(3.5)4

    + W3C Documentation reference
    fn:ceiling()
    - The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
    + The ceiling function returns the smallest (closest to negative infinity) number that is + not less than the argument and that is an integer.
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - - - - - - - - - -
    ExpressionResult
    floor(3.1)3
    floor(3.9)3
    floor(3.5)3

    - W3C Documentation reference + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    floor(3.1)3
    floor(3.9)3
    floor(3.5)3

    + W3C Documentation reference
    fn:round()
    - The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. + The round function returns the number that is closest to the argument and that is an + integer. If there are two such numbers, then the one that is closest to positive + infinity is returned. If the argument is NaN, then NaN is returned. If the argument is + positive infinity, then positive infinity is returned. If the argument is negative + infinity, then negative infinity is returned. If the argument is positive zero, then + positive zero is returned. If the argument is negative zero, then negative zero is + returned. If the argument is less than zero, but greater than or equal to -0.5, then + negative zero is returned. -

    NOTE

    - For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
    +

    NOTE

    + For these last two cases, the result of calling the round function is not the same as + the result of adding 0.5 and then calling the floor function.
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - - - - - - - - - -
    ExpressionResult
    floor(3.1)3
    floor(3.9)4
    floor(3.5)3

    - W3C Documentation reference + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    floor(3.1)3
    floor(3.9)4
    floor(3.5)3

    + W3C Documentation reference
    -
    @@ -17336,14 +17375,14 @@ hideList(document.getElementsByName("collapse20")); showList(document.getElementsByName("collapse30")); hideList(document.getElementsByName("collapse31")); - + } else if (filter == "collapse3.1") { document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.1 functions"; hideList(document.getElementsByName("collapse10")); hideList(document.getElementsByName("collapse20")); hideList(document.getElementsByName("collapse30")); showList(document.getElementsByName("collapse31")); - } else if (filter == "collapse2.0"){ + } else if (filter == "collapse2.0") { document.getElementById("tooltipFunctionInfo").innerText = "XPath 2.0 functions"; hideList(document.getElementsByName("collapse10")); showList(document.getElementsByName("collapse20")); @@ -17361,7 +17400,7 @@ var triggerList = document.getElementsByClassName("collapseTrigger"); for (i = 0; i < triggerList.length; i++) { - + triggerList[i].addEventListener("click", function () { var collapsible = this.parentElement; if (this.tagName == "A") { @@ -17371,7 +17410,7 @@ } - + if (collapsibleData.style.maxHeight > "0px") { collapsibleData.style.maxHeight = "0px"; @@ -17406,7 +17445,7 @@ //Handle clicks in whole form and set info in tooltip setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); setDefaultContent(document.getElementById("transformArea"), 'Insert XPath expression here'); - + processVersionSelector(); processTooltip(); tool.addEventListener('change', event => { @@ -17445,4 +17484,4 @@ - + \ No newline at end of file From 1fc1ab76ec33a3cb79940b8615f8141ab1050cbe Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 19 Apr 2023 13:27:49 +0200 Subject: [PATCH 18/59] Resolved another conflict --- Frontend/tools/xpath.html | 610 ++++++++++++++++++-------------------- 1 file changed, 292 insertions(+), 318 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index ce5321a..08d65f6 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -151,33 +151,33 @@ fn:count()
    - Returns the number of nodes in the node-set
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode-set to count nodes in
    Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    count(//b:book)5
    count(//person[@id>5])17

    - W3C Documentation reference: Node-Set-Functions + Returns the number of nodes in the node-set
    + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode-set to count nodes in
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    count(//b:book)5
    count(//person[@id>5])17

    + W3C Documentation reference: Node-Set-Functions
    @@ -195,97 +195,97 @@ fn:local-name()
    - Returns the local-name for the first node in the node-set
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-setExtract first node and return its local name
    Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    local-name(//b:books)b:book
    local-name(//b:book)b:title

    - W3C Documentation reference: Node-Set-Functions + Returns the local-name for the first node in the node-set
    + Arguments: + + + + + + + + + +
    TypeDescription
    node-setExtract first node and return its local name
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    local-name(//b:books)b:book
    local-name(//b:book)b:title

    + W3C Documentation reference: Node-Set-Functions
    fn:namespace-uri()
    - Returns the namespace-uri for the first node in the node-set
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-setExtract first node and return the namespace URI
    Examples:
    - - - - - - - - - -
    ExpressionResult
    namespace-uri(//b:book)http://www.book.com

    - W3C Documentation reference: Node-Set-Functions + Returns the namespace-uri for the first node in the node-set
    + Arguments: + + + + + + + + + +
    TypeDescription
    node-setExtract first node and return the namespace URI
    Examples:
    + + + + + + + + + +
    ExpressionResult
    namespace-uri(//b:book)http://www.book.com

    + W3C Documentation reference: Node-Set-Functions
    fn:name()
    - Returns the name for the first node in the node-set
    - Arguments: - - - - - - - - - -
    TypeDescription
    node-set (Optional)Extract first node and return QName
    Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    name(//b:books/*)b:book
    name(//b:book/*)b:title

    - W3C Documentation reference: Node-Set-Functions + Returns the name for the first node in the node-set
    + Arguments: + + + + + + + + + +
    TypeDescription
    node-set (Optional)Extract first node and return QName
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    name(//b:books/*)b:book
    name(//b:book/*)b:title

    + W3C Documentation reference: Node-Set-Functions
    - +
    @@ -337,55 +337,46 @@ fn:not()
    - The not function returns true if its argument is false, and false otherwise.
    -
    - W3C Documentation reference: Boolean-Functions + The not function returns true if its argument is false, and false otherwise.
    +
    + W3C Documentation reference: Boolean-Functions
    fn:true()
    - The true function returns true.
    -
    - W3C Documentation reference: Boolean-Functions + The true function returns true.
    +
    + W3C Documentation reference: Boolean-Functions
    fn:false()
    - The true function returns false.
    -
    - W3C Documentation reference: Boolean-Functions + The true function returns false.
    +
    + W3C Documentation reference: Boolean-Functions
    fn:lang()
    - The lang function returns true or false depending on whether the language of the context - node as specified by xml:lang attributes is the same as or is a sublanguage of the - language specified by the argument string. The language of the context node is - determined by the value of the xml:lang attribute on the context node, or, if the - context node has no xml:lang attribute, by the value of the xml:lang attribute on the - nearest ancestor of the context node that has an xml:lang attribute. If there is no such - attribute, then lang returns false. If there is such an attribute, then lang returns - true if the attribute value is equal to the argument ignoring case, or if there is some - suffix starting with - such that the attribute value is equal to the argument ignoring - that suffix of the attribute value and ignoring case.
    - Arguments: - - - - - - - - - -
    TypeDescription
    stringLanguage that will be looked for in context node
    Examples: Look W3C documentation
    + The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang returns false. If there is such an attribute, then lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case.
    + Arguments: + + + + + + + + + +
    TypeDescription
    stringLanguage that will be looked for in context node
    Examples: Look W3C documentation

    - W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions
    @@ -935,208 +926,191 @@
    - - + + fn:number()
    - The number function converts its argument to a number as follows: -
      -
    • a string that consists of optional whitespace followed by an optional minus sign - followed by a Number followed by whitespace is converted to the IEEE 754 number - that is nearest (according to the IEEE 754 round-to-nearest rule) to the - mathematical value represented by the string; any other string is converted to - NaN
    • -
    • boolean true is converted to 1; boolean false is converted to 0
    • -
    • a node-set is first converted to a string as if by a call to the string function - and then converted in the same way as a string argument
    • -
    • an object of a type other than the four basic types is converted to a number in - a way that is dependent on that type
    • -
    - - Arguments: - - - - - - - - - -
    TypeDescription
    objectThe object to convert to a number
    Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    number(10)10
    number("")NaN

    - W3C Documentation reference + The number function converts its argument to a number as follows: +
      +
    • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
    • +
    • boolean true is converted to 1; boolean false is converted to 0
    • +
    • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
    • +
    • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
    • +
    + + Arguments: + + + + + + + + + +
    TypeDescription
    objectThe object to convert to a number
    Examples:
    + + + + + + + + + + + + + +
    ExpressionResult
    number(10)10
    number("")NaN

    + W3C Documentation reference
    - + fn:sum()
    - The sum function returns the sum, for each node in the argument node-set, of the result - of converting the string-values of the node to a number.
    - - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - -
    ExpressionResult
    sum(/l:library/l:readerList/p:person/p:readerID)12444

    - W3C Documentation reference + The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
    + + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + +
    ExpressionResult
    sum(/l:library/l:readerList/p:person/p:readerID)12444

    + W3C Documentation reference
    - + fn:floor()
    - The floor function returns the largest (closest to positive infinity) number that is not - greater than the argument and that is an integer.
    - - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - - - - - - - - - -
    ExpressionResult
    floor(3.1)4
    floor(3.9)4
    floor(3.5)4

    - W3C Documentation reference + The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
    + + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    floor(3.1)4
    floor(3.9)4
    floor(3.5)4

    + W3C Documentation reference
    - + fn:ceiling()
    - The ceiling function returns the smallest (closest to negative infinity) number that is - not less than the argument and that is an integer.
    - - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - - - - - - - - - -
    ExpressionResult
    floor(3.1)3
    floor(3.9)3
    floor(3.5)3

    - W3C Documentation reference + The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
    + + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    floor(3.1)3
    floor(3.9)3
    floor(3.5)3

    + W3C Documentation reference
    - - + + fn:round()
    - The round function returns the number that is closest to the argument and that is an - integer. If there are two such numbers, then the one that is closest to positive - infinity is returned. If the argument is NaN, then NaN is returned. If the argument is - positive infinity, then positive infinity is returned. If the argument is negative - infinity, then negative infinity is returned. If the argument is positive zero, then - positive zero is returned. If the argument is negative zero, then negative zero is - returned. If the argument is less than zero, but greater than or equal to -0.5, then - negative zero is returned. - -

    NOTE

    - For these last two cases, the result of calling the round function is not the same as - the result of adding 0.5 and then calling the floor function.
    - - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - - - - - - - - - -
    ExpressionResult
    floor(3.1)3
    floor(3.9)4
    floor(3.5)3

    - W3C Documentation reference + The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. + +

    NOTE

    + For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
    + + Arguments: + + + + + + + + + +
    TypeDescription
    node-setNode set to sum
    Examples:
    + + + + + + + + + + + + + + + + + +
    ExpressionResult
    floor(3.1)3
    floor(3.9)4
    floor(3.5)3

    + W3C Documentation reference
    - +
    From 38c121588997971a3d841e644b604da1b3e145d8 Mon Sep 17 00:00:00 2001 From: Mikolaj Widla Date: Wed, 19 Apr 2023 10:28:04 +0200 Subject: [PATCH 19/59] Disabled caching for frontend (#146) Disable caching for frontend Co-authored-by: widlam Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/146 Reviewed-by: Adam Bem Co-authored-by: Mikolaj Widla Co-committed-by: Mikolaj Widla --- Frontend/Dockerfile | 1 + Frontend/nginx.conf | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Frontend/nginx.conf diff --git a/Frontend/Dockerfile b/Frontend/Dockerfile index c776286..58fdcd5 100644 --- a/Frontend/Dockerfile +++ b/Frontend/Dockerfile @@ -4,6 +4,7 @@ COPY ./tools/ /usr/share/nginx/html/tools/ COPY ./lawful/ /usr/share/nginx/html/lawful/ COPY ./assets/ /usr/share/nginx/html/assets/ COPY ./index.html /usr/share/nginx/html +COPY ./nginx.conf /etc/nginx/conf.d/default.conf RUN mkdir -p /scripts COPY insert_version.sh /scripts/ diff --git a/Frontend/nginx.conf b/Frontend/nginx.conf new file mode 100644 index 0000000..e52fbb2 --- /dev/null +++ b/Frontend/nginx.conf @@ -0,0 +1,24 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + expires -1; + add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + +} \ No newline at end of file From 8a852b7a832a508f1f8cc80a0bfd90d50ed160ee Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 19 Apr 2023 13:30:14 +0200 Subject: [PATCH 20/59] Fixed doubled category --- Frontend/tools/xpath.html | 192 -------------------------------------- 1 file changed, 192 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 08d65f6..36f0558 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -879,198 +879,6 @@ - fn:round() -
    - The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. - -

    NOTE

    - For these last two cases, the result of calling the round function is not the same as the result of adding 0.5 and then calling the floor function.
    - - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - - - - - - - - - -
    ExpressionResult
    floor(3.1)3
    floor(3.9)4
    floor(3.5)3

    - W3C Documentation reference -
    - - - -
    - - - -
    - - - fn:number() -
    - The number function converts its argument to a number as follows: -
      -
    • a string that consists of optional whitespace followed by an optional minus sign followed by a Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN
    • -
    • boolean true is converted to 1; boolean false is converted to 0
    • -
    • a node-set is first converted to a string as if by a call to the string function and then converted in the same way as a string argument
    • -
    • an object of a type other than the four basic types is converted to a number in a way that is dependent on that type
    • -
    - - Arguments: - - - - - - - - - -
    TypeDescription
    objectThe object to convert to a number
    Examples:
    - - - - - - - - - - - - - -
    ExpressionResult
    number(10)10
    number("")NaN

    - W3C Documentation reference -
    - - fn:sum() -
    - The sum function returns the sum, for each node in the argument node-set, of the result of converting the string-values of the node to a number.
    - - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - -
    ExpressionResult
    sum(/l:library/l:readerList/p:person/p:readerID)12444

    - W3C Documentation reference -
    - - fn:floor() -
    - The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.
    - - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - - - - - - - - - -
    ExpressionResult
    floor(3.1)4
    floor(3.9)4
    floor(3.5)4

    - W3C Documentation reference -
    - - fn:ceiling() -
    - The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.
    - - Arguments: - - - - - - - - - -
    TypeDescription
    node-setNode set to sum
    Examples:
    - - - - - - - - - - - - - - - - - -
    ExpressionResult
    floor(3.1)3
    floor(3.9)3
    floor(3.5)3

    - W3C Documentation reference -
    - - fn:round()
    From 2b8a9c30089ed964007906fede19e466f739608d Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 19 Apr 2023 13:33:39 +0200 Subject: [PATCH 21/59] Implemented showing returned type (#112) (#148) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/148 Reviewed-by: Mikolaj Widla --- Backend-libXML/Parser.py | 4 ++-- Backend-libXML/main.py | 2 +- .../r11/tools/controller/XPathController.java | 12 +++++----- .../controller/internal/XPathQueryResult.java | 22 +++++++++++++++++++ .../main/java/com/r11/tools/xml/Saxon.java | 5 +++-- .../main/java/com/r11/tools/xml/Xalan.java | 16 ++++++++------ Frontend/assets/scripts/tools/scripts.js | 7 ++++-- 7 files changed, 47 insertions(+), 21 deletions(-) create mode 100644 Backend/tools-services/src/main/java/com/r11/tools/controller/internal/XPathQueryResult.java diff --git a/Backend-libXML/Parser.py b/Backend-libXML/Parser.py index 7dcb211..687fb74 100644 --- a/Backend-libXML/Parser.py +++ b/Backend-libXML/Parser.py @@ -54,12 +54,12 @@ def xpath(source: str, xpath: str) -> str: # root.xpath can return 4 types: float, string, bool and list. # List is the only one that can't be simply converted to str if type(result) is not list: - return str(result) + return str(result), type(result).__name__ else: result_string = "" for e in result: result_string += etree.tostring(e, pretty_print=True).decode() + "\n" - return result_string + return result_string, "node" diff --git a/Backend-libXML/main.py b/Backend-libXML/main.py index c0a962b..4445cab 100644 --- a/Backend-libXML/main.py +++ b/Backend-libXML/main.py @@ -35,7 +35,7 @@ def process_xml(request: request, type: str) -> str: elif (type == "xslt"): response_json['result'] = Parser.xslt(data, process) elif (type == "xpath"): - response_json['result'] = Parser.xpath(data, process) + response_json['result'], response_json['type'] = Parser.xpath(data, process) elif (type == "prettify"): response_json['result'] = Parser.formatXML(data, True) elif (type == "minimize"): diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java index cc68603..a3d0ca2 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java @@ -2,10 +2,7 @@ package com.r11.tools.controller; import com.google.gson.Gson; import com.google.gson.JsonObject; -import com.r11.tools.controller.internal.GlobalControllerManifest; -import com.r11.tools.controller.internal.HandlerType; -import com.r11.tools.controller.internal.RestController; -import com.r11.tools.controller.internal.ScopedControllerManifest; +import com.r11.tools.controller.internal.*; import com.r11.tools.xml.Saxon; import com.r11.tools.xml.Xalan; import org.apache.logging.log4j.Logger; @@ -63,7 +60,7 @@ public class XPathController implements RestController { timeStart = System.currentTimeMillis(); try { - tmp = Saxon.processXPath(data, query, version).trim(); + tmp = Saxon.processXPath(data, query, version).getData().trim(); response.status(200); @@ -92,12 +89,13 @@ public class XPathController implements RestController { timeStart = System.currentTimeMillis(); try { - tmp = Xalan.processXPath(data, query).trim(); + XPathQueryResult xPathQueryResult = Xalan.processXPath(data, query); response.status(200); - responseJson.addProperty("result", tmp); + responseJson.addProperty("result", xPathQueryResult.getData().trim()); responseJson.addProperty("status", "OK"); + responseJson.addProperty("type", xPathQueryResult.getType()); } catch (Exception ex) { this.logger.error("Error on processing XPath using Xalan. " + ex); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/internal/XPathQueryResult.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/internal/XPathQueryResult.java new file mode 100644 index 0000000..8bb8a00 --- /dev/null +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/internal/XPathQueryResult.java @@ -0,0 +1,22 @@ +package com.r11.tools.controller.internal; + +/** + * Class used to store data received from parser and type of that data (node, string, etc.) + */ +public class XPathQueryResult { + private String data; + private String type; + + public XPathQueryResult(String data, String type) { + this.data = data; + this.type = type; + } + + public String getData() { + return data; + } + + public String getType() { + return type; + } +} diff --git a/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java b/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java index 567c889..4cb2835 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java @@ -1,5 +1,6 @@ package com.r11.tools.xml; +import com.r11.tools.controller.internal.XPathQueryResult; import net.sf.saxon.s9api.*; import javax.xml.transform.stream.StreamSource; @@ -41,7 +42,7 @@ public class Saxon { * @return string xml representation of the node * @throws Exception thrown on node building errors or invalid xpath */ - public static String processXPath(String data, String query, String version) throws Exception { + public static XPathQueryResult processXPath(String data, String query, String version) throws Exception { Processor p = new Processor(false); XPathCompiler compiler = p.newXPathCompiler(); DocumentBuilder builder = p.newDocumentBuilder(); @@ -61,7 +62,7 @@ public class Saxon { sb.append(xdmItem); sb.append('\n'); } - return sb.toString(); + return new XPathQueryResult(sb.toString(), "N/A"); } diff --git a/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java b/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java index 829b62b..1caad08 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java @@ -1,5 +1,6 @@ package com.r11.tools.xml; +import com.r11.tools.controller.internal.XPathQueryResult; import org.apache.xpath.XPathAPI; import org.apache.xpath.objects.XObject; import org.w3c.dom.Document; @@ -64,7 +65,7 @@ public class Xalan { * @return xml processed using given xpath * @throws Exception thrown on node building errors or invalid xpath */ - public static String processXPath(String data, String transform) throws Exception { + public static XPathQueryResult processXPath(String data, String transform) throws Exception { // Set up a DOM tree to query. InputSource in = new InputSource(new StringReader(data)); @@ -81,7 +82,7 @@ public class Xalan { NodeIterator nl = XPathAPI.selectNodeIterator(doc, transform); // Serialize the found nodes to result object. - StringBuilder result = new StringBuilder(); + StringBuilder resultString = new StringBuilder(); Node n; while ((n = nl.nextNode())!= null) { StringBuilder sb; @@ -90,18 +91,19 @@ public class Xalan { // single XPath text node. Coalesce all contiguous text nodes // at this level for (Node nn = n.getNextSibling(); isTextNode(nn); nn = nn.getNextSibling()) { - result.append(nn.getNodeValue()); + resultString.append(nn.getNodeValue()); } } else { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); serializer.transform(new DOMSource(n), new StreamResult(new OutputStreamWriter(outputStream))); - result.append(outputStream); + resultString.append(outputStream); } - result.append("\n"); + resultString.append("\n"); } - return result.toString(); + return new XPathQueryResult(resultString.toString(), "node"); } catch (TransformerException e) { - return XPathAPI.eval(doc, transform).toString(); + String returnData = XPathAPI.eval(doc, transform).toString(); + return new XPathQueryResult(data, "string"); } } diff --git a/Frontend/assets/scripts/tools/scripts.js b/Frontend/assets/scripts/tools/scripts.js index db2c22c..ab7f46c 100644 --- a/Frontend/assets/scripts/tools/scripts.js +++ b/Frontend/assets/scripts/tools/scripts.js @@ -244,9 +244,12 @@ function performRequest(endpoint, checkXML, checkTransform) { if (!empty) { restRequest(port, endpoint, xmlData, transformData).then(function (result) { document.getElementById("resultArea").value = result.result; - document.getElementById("procinfo").innerText = ' Computed using '.concat(" ", result.processor); + document.getElementById("procinfo").innerText = ' Computed using ' + result.processor + if (result.type) + document.getElementById("procinfo").innerText += ". Returned: " + result.type; + if (result.status = "OK") { - document.getElementById("procinfo").innerText = document.getElementById("procinfo").innerText.concat(" in ", result.time, "ms"); + document.getElementById("procinfo").innerText += " in " + result.time + "ms"; procinfo.style.color = "#30aa58"; } else { procinfo.style.color = "#aa3030"; From 093c8756b10e93ac70a7bbdc34b46e8c2913b7bb Mon Sep 17 00:00:00 2001 From: Mikolaj Widla Date: Wed, 19 Apr 2023 13:35:40 +0200 Subject: [PATCH 22/59] Added XSLTTemplate, functions that add it to transform area and documentation for that function (#144) Co-authored-by: widlam Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/144 Reviewed-by: Adam Bem Co-authored-by: Mikolaj Widla Co-committed-by: Mikolaj Widla --- Frontend/assets/samples/XSLTTemplate.xslt | 14 ++++++++++++++ Frontend/assets/scripts/tools/scripts.js | 18 ++++++++++++++++++ Frontend/tools/xslt.html | 19 +++++++++++++------ 3 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 Frontend/assets/samples/XSLTTemplate.xslt diff --git a/Frontend/assets/samples/XSLTTemplate.xslt b/Frontend/assets/samples/XSLTTemplate.xslt new file mode 100644 index 0000000..3ce05e2 --- /dev/null +++ b/Frontend/assets/samples/XSLTTemplate.xslt @@ -0,0 +1,14 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/scripts.js b/Frontend/assets/scripts/tools/scripts.js index ab7f46c..968749a 100644 --- a/Frontend/assets/scripts/tools/scripts.js +++ b/Frontend/assets/scripts/tools/scripts.js @@ -84,6 +84,24 @@ function fillDefaultXML(element) { } } + +/** + * The `fillDefaultXSLT()` function fetches a default XSLT template from the server and sets the value of the element with id "transformArea" to the fetched template. + * + * @function + * @name fillDefaultXSLT + * @kind function + * @returns {void} + */ +function fillDefaultXSLT() { + const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; + fetch(serverAddress + "/assets/samples/XSLTTemplate.xslt") + .then( response => response.text() ) + .then( (XSTLTemplate) => { + document.getElementById('transformArea').value = XSTLTemplate; + } ) +} + /** * It sets default content for the element an changes it's color to grey * diff --git a/Frontend/tools/xslt.html b/Frontend/tools/xslt.html index 674a7cc..50d3d94 100644 --- a/Frontend/tools/xslt.html +++ b/Frontend/tools/xslt.html @@ -25,7 +25,7 @@ +


    @@ -70,7 +72,7 @@ } function init() { - setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); + configurePastingInElement("xmlArea"); } diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 4c7962a..b7726d4 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -2,10 +2,13 @@ - - - + + + + + + @@ -46,24 +49,17 @@

    - -

    +
    +
    - +

    -

    +
    - +
    @@ -17223,6 +17219,10 @@ } function init() { + // Make sure that only plain text is pasted + configurePastingInElement("xmlArea"); + configurePastingInElement("transformArea"); + //Handle clicks in whole form and set info in tooltip setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); setDefaultContent(document.getElementById("transformArea"), 'Insert XPath expression here'); @@ -17261,6 +17261,8 @@ }) } + + diff --git a/Frontend/tools/xsd.html b/Frontend/tools/xsd.html index e25e7a6..100756b 100644 --- a/Frontend/tools/xsd.html +++ b/Frontend/tools/xsd.html @@ -4,7 +4,11 @@ + + + + @@ -43,25 +47,18 @@ - -

    +
    +
    - +

    -

    +
    - +
    @@ -84,6 +81,10 @@ + + + + @@ -45,11 +51,8 @@
    - -

    +
    +
    @@ -59,19 +62,14 @@
    - +

    -

    +
    - +
    @@ -1201,6 +1199,10 @@ } function init() { + // Make sure that only plain text is pasted + configurePastingInElement("xmlArea"); + configurePastingInElement("transformArea"); + //Handle clicks in whole form and set info in tooltip setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); setDefaultContent(document.getElementById("transformArea"), 'Insert XSLT here'); @@ -1225,8 +1227,11 @@ } processTooltip(); + }) + } + diff --git a/Samples/xslt/sampleXSLT.xslt b/Samples/xslt/sampleXSLT.xslt index 178e5a0..00f662d 100644 --- a/Samples/xslt/sampleXSLT.xslt +++ b/Samples/xslt/sampleXSLT.xslt @@ -1,4 +1,4 @@ - + From 41d3b90fd8de3282c99c450f5675207e98833906 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Tue, 9 May 2023 10:21:37 +0200 Subject: [PATCH 30/59] Removed version number from Mock Service (done #172) (#173) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/173 Reviewed-by: Dariusz Augustyniak --- .../mocked-services/src/main/resources/static/html/mock.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Backend/mocked-services/src/main/resources/static/html/mock.html b/Backend/mocked-services/src/main/resources/static/html/mock.html index e3b6254..d3ff264 100644 --- a/Backend/mocked-services/src/main/resources/static/html/mock.html +++ b/Backend/mocked-services/src/main/resources/static/html/mock.html @@ -15,7 +15,7 @@
    -

    MockedServices v1.0.0

    +

    MockedServices

    From 7fd6fd378813f6d1b941c609703f502e00eba1b0 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Tue, 9 May 2023 11:15:26 +0200 Subject: [PATCH 31/59] Fixed incorrect Content-Type (#174) (#175) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/175 Reviewed-by: Mikolaj Widla --- .../src/main/java/com/r11/tools/controller/MockController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java index 38d0bc3..8ec6473 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java @@ -194,6 +194,7 @@ public class MockController { MockedMessageDto mockedMessageDto = klausService.getMockedResponse(clientUUID, mockedResponseId); HttpHeaders httpHeaders = new HttpHeaders(); if (mockedMessageDto.getHttpHeaders() != null) mockedMessageDto.getHttpHeaders().forEach(httpHeaders::set); + httpHeaders.add("Content-Type", mockedMessageDto.getMediaType()); return new ResponseEntity<>(mockedMessageDto.getMessageBody(), httpHeaders, Objects.requireNonNull(HttpStatus.valueOf(mockedMessageDto.getHttpStatus()))); } From 6a1c6aac46539e535b3531d1e8b0b8d10eddc3f5 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Tue, 9 May 2023 15:12:57 +0200 Subject: [PATCH 32/59] Last opened page is now stored (solves #166) (#178) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/178 Reviewed-by: Mikolaj Widla --- Frontend/assets/css/frame.css | 2 +- Frontend/assets/scripts/dyn_host.js | 6 -- Frontend/assets/scripts/frame.js | 120 +++++++++++++++++++++++----- Frontend/index.html | 23 +++--- 4 files changed, 113 insertions(+), 38 deletions(-) delete mode 100644 Frontend/assets/scripts/dyn_host.js diff --git a/Frontend/assets/css/frame.css b/Frontend/assets/css/frame.css index 70d0b07..c6a6ba2 100644 --- a/Frontend/assets/css/frame.css +++ b/Frontend/assets/css/frame.css @@ -41,7 +41,7 @@ div#header { grid-column: 1; } -iframe#frame { +iframe#iframe { flex-grow: 1; background-color: #FFFFFF; } diff --git a/Frontend/assets/scripts/dyn_host.js b/Frontend/assets/scripts/dyn_host.js deleted file mode 100644 index efdc4c1..0000000 --- a/Frontend/assets/scripts/dyn_host.js +++ /dev/null @@ -1,6 +0,0 @@ -$(document).ready( function() { - document.getElementById("rest-mock").href = - window.location.protocol + "//" + window.location.hostname + ":8097"; - -}); - \ No newline at end of file diff --git a/Frontend/assets/scripts/frame.js b/Frontend/assets/scripts/frame.js index 15cd0fa..493333a 100644 --- a/Frontend/assets/scripts/frame.js +++ b/Frontend/assets/scripts/frame.js @@ -1,6 +1,51 @@ +const tools = new Map(); +/** + * This functions imports other js file. I hate this solution, but other didn't work. + * + * @function + * @name importScript + * @kind function + * @param {any} url + * @returns {void} + */ +function importScript(url) { + var script = document.createElement("script"); + script.src = url; + document.head.appendChild(script); +} + +/** + * Get address of Mock Services + * + * @function + * @name getMockHost + * @kind function + * @returns {string} + */ +function getMockHost() { + return window.location.protocol + "//" + window.location.hostname + ":8097"; +} + +/** + * Function called after page is loaded + * + * @function + * @name init + * @kind function + * @returns {void} + */ function init() { - changeActiveTools('xmlTool', 'XML'); + + tools.set("xpath", "tools/xpath.html"); + tools.set("xsd", "tools/xsd.html"); + tools.set("xslt", "tools/xslt.html"); + tools.set("xmlform", "tools/xmlFormatter.html"); + tools.set("jsonform", "tools/jsonFormatter.html"); + tools.set("mock", getMockHost()); + + changeActiveTools('XML'); + loadLastPage(); } /** @@ -12,26 +57,65 @@ function init() { * @param {any} activeClass class of elements that have to be shown * @param {any} activeCategoryButton class of category button that has to be active */ -function changeActiveTools(activeClass, activeCategoryButton) { - let tools = document.getElementById("toolList").children +function changeActiveTools(activeCategoryButton) { + let toolList = document.getElementById("toolList").children; + let categoryToClass = new Map([["XML", "xmlTool"], + ["JSON", "jsonTool"], + ["REST", "restTool"]]); - for (i = 0; i < tools.length; i++) { - if (tools[i].classList.contains(activeClass)) { - tools[i].style.display = "block"; - } - else { - tools[i].style.display = "none"; - } + let activeClass = categoryToClass.get(activeCategoryButton.toUpperCase()); + if(activeClass == null) return; + + for (i = 0; i < toolList.length; i++) { + if (toolList[i].classList.contains(activeClass)) + toolList[i].style.display = "block"; + else + toolList[i].style.display = "none"; } - let categories = document.getElementById("menu").children + let categoryList = document.getElementById("menu").children; - for (i = 0; i < categories.length; i++) { - if (categories[i].innerText == activeCategoryButton) { - categories[i].classList.add("active") - } - else { - categories[i].classList.remove("active") - } + for (i = 0; i < categoryList.length; i++) { + if (categoryList[i].innerText == activeCategoryButton) + categoryList[i].classList.add("active"); + else + categoryList[i].classList.remove("active"); } +} + +/** + * Function that changes active tool + * + * @function + * @name changeTool + * @kind function + * @param {any} tool + * @returns {void} + */ +function changeTool(tool) { + const url = tools.get(tool); + localStorage.setItem("lastPage", tool); + document.getElementById("iframe").src = url; +} + +/** + * Function that loads last used tool and sets active category accordingly + * + * @function + * @name loadLastPage + * @kind function + * @returns {void} + */ +function loadLastPage() { + const lastPage = localStorage.getItem("lastPage"); + switch (lastPage) { // XML category is default. + case "jsonform": + changeActiveTools('JSON'); + break; + case "mock": + changeActiveTools('REST'); + break; + + } + document.getElementById("iframe").src = tools.get(lastPage); } \ No newline at end of file diff --git a/Frontend/index.html b/Frontend/index.html index abb8dbe..4073ca4 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -4,7 +4,6 @@ - @@ -22,9 +21,9 @@
    @@ -34,14 +33,12 @@
    - +
    From d8504ee8f8f16605f1e6897d9009979cac0eff56 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 11 May 2023 11:20:36 +0200 Subject: [PATCH 33/59] Changed timezone (solves #164 and #181) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/183 Reviewed-by: Mikolaj Widla --- docker-compose.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 6a620bb..c317aaf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,9 @@ services: redis: image: 'redis' restart: "no" + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro xmltools-frontend: build: ./Frontend @@ -11,6 +14,9 @@ services: image: xmltools-frontend ports: - 8086:80 + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro xmltools-backend: build: ./Backend/tools-services @@ -25,6 +31,9 @@ services: image: xmltools-libxml-backend ports: - 8082:80 + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro xmltools-mocked-services: build: @@ -38,6 +47,9 @@ services: - redis environment: SPRING_PROFILES_ACTIVE: DEV + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro swagger: image: "swaggerapi/swagger-ui:latest" @@ -63,6 +75,9 @@ services: command: - "-e" - "--strict.perms=false" + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro networks: default: From 34038a2ce913f202fd2af079edc397d0be269815 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 11 May 2023 15:23:54 +0200 Subject: [PATCH 34/59] Tools java backend now uses interfaces for engine classes (solves #167) (#179) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/179 Reviewed-by: Mikolaj Widla --- .../java/com/r11/tools/SparkApplication.java | 14 +++++++++---- .../controller/ProcessorInfoController.java | 11 +++++++--- .../r11/tools/controller/XPathController.java | 20 ++++++++++++------- .../r11/tools/controller/XsdController.java | 14 +++++++++---- .../r11/tools/controller/XsltController.java | 16 ++++++++++----- .../main/java/com/r11/tools/xml/Saxon.java | 13 ++++++++---- .../main/java/com/r11/tools/xml/Xalan.java | 12 +++++------ .../java/com/r11/tools/xml/XmlEngine.java | 12 +++++++++++ 8 files changed, 79 insertions(+), 33 deletions(-) create mode 100644 Backend/tools-services/src/main/java/com/r11/tools/xml/XmlEngine.java diff --git a/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java b/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java index cee98f2..e1c0c96 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java @@ -8,6 +8,9 @@ import com.r11.tools.controller.XPathController; import com.r11.tools.controller.XsdController; import com.r11.tools.controller.XsltController; import com.r11.tools.controller.internal.RestControllerRegistry; +import com.r11.tools.xml.Saxon; +import com.r11.tools.xml.Xalan; +import com.r11.tools.xml.XmlEngine; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import spark.Spark; @@ -35,12 +38,15 @@ public class SparkApplication { Gson jsongson = new GsonBuilder() .disableHtmlEscaping() .create(); + XmlEngine saxon = new Saxon(); + XmlEngine xalan = new Xalan(); + RestControllerRegistry registry = new RestControllerRegistry(); - registry.registerController(new ProcessorInfoController(logger)); - registry.registerController(new XsdController(gson, logger)); - registry.registerController(new XPathController(gson, logger)); - registry.registerController(new XsltController(gson, logger)); + registry.registerController(new ProcessorInfoController(logger, saxon, xalan)); + registry.registerController(new XsdController(gson, logger, saxon, xalan)); + registry.registerController(new XPathController(gson, logger, saxon, xalan)); + registry.registerController(new XsltController(gson, logger, saxon, xalan)); registry.registerController(new JsonController(gson, jsongson, logger)); registry.register(); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/ProcessorInfoController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/ProcessorInfoController.java index 2a8333c..a926345 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/ProcessorInfoController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/ProcessorInfoController.java @@ -5,6 +5,7 @@ import com.r11.tools.controller.internal.HandlerType; import com.r11.tools.controller.internal.RestController; import com.r11.tools.controller.internal.ScopedControllerManifest; import com.r11.tools.xml.Saxon; +import com.r11.tools.xml.XmlEngine; import org.apache.logging.log4j.Logger; import spark.Request; import spark.Response; @@ -13,9 +14,13 @@ import spark.Response; public class ProcessorInfoController implements RestController { private final Logger logger; + private final XmlEngine saxon; + private final XmlEngine xalan; - public ProcessorInfoController(Logger logger) { + public ProcessorInfoController(Logger logger, XmlEngine saxon, XmlEngine xalan) { this.logger = logger; + this.saxon = saxon; + this.xalan = xalan; } /** @@ -24,8 +29,8 @@ public class ProcessorInfoController implements RestController { @ScopedControllerManifest(method = HandlerType.GET, path = "/procinfo") public void processorInfo(Request request, Response response) { try { - response.header("processor", "Saxon " + Saxon.getVersion() + " over s9api"); - response.body(Saxon.getVersion()); + response.header("processor", "Saxon " + saxon.getVersion() + " over s9api"); + response.body(saxon.getVersion()); } catch (Exception ex) { this.logger.error("Error on retrieving engine version. " + ex); response.body(ex.getMessage()); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java index a3d0ca2..822a113 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java @@ -5,6 +5,7 @@ import com.google.gson.JsonObject; import com.r11.tools.controller.internal.*; import com.r11.tools.xml.Saxon; import com.r11.tools.xml.Xalan; +import com.r11.tools.xml.XmlEngine; import org.apache.logging.log4j.Logger; import spark.Request; import spark.Response; @@ -15,9 +16,14 @@ public class XPathController implements RestController { private final Gson gson; private final Logger logger; - public XPathController(Gson gson, Logger logger) { + private final XmlEngine saxon; + private final XmlEngine xalan; + + public XPathController(Gson gson, Logger logger, XmlEngine saxon, XmlEngine xalan) { this.gson = gson; this.logger = logger; + this.saxon = saxon; + this.xalan = xalan; } @ScopedControllerManifest(method = HandlerType.POST, path = "/xpath") @@ -56,11 +62,11 @@ public class XPathController implements RestController { JsonObject responseJson = new JsonObject(); switch (processor) { case "saxon": - response.header("processor", "Saxon " + Saxon.getVersion() + " " + version + " over s9api"); + response.header("processor", "Saxon " + saxon.getVersion() + " " + version + " over s9api"); timeStart = System.currentTimeMillis(); try { - tmp = Saxon.processXPath(data, query, version).getData().trim(); + tmp = saxon.processXPath(data, query, version).getData().trim(); response.status(200); @@ -78,18 +84,18 @@ public class XPathController implements RestController { duration = System.currentTimeMillis() - timeStart; this.logger.info("Request (XPath, Saxon) processed in " + duration + " ms."); - responseJson.addProperty("processor", "Saxon " + Saxon.getVersion() + " " + version + " over s9api"); + responseJson.addProperty("processor", "Saxon " + saxon.getVersion() + " " + version + " over s9api"); responseJson.addProperty("time", duration); response.body(this.gson.toJson(responseJson)); return; case "xalan": - response.header("processor", Xalan.getVersion()); + response.header("processor", xalan.getVersion()); timeStart = System.currentTimeMillis(); try { - XPathQueryResult xPathQueryResult = Xalan.processXPath(data, query); + XPathQueryResult xPathQueryResult = xalan.processXPath(data, query, ""); response.status(200); @@ -108,7 +114,7 @@ public class XPathController implements RestController { duration = System.currentTimeMillis() - timeStart; this.logger.info("Request (XPath, Xalan) processed in " + duration + " ms."); - responseJson.addProperty("processor", Xalan.getVersion()); + responseJson.addProperty("processor", xalan.getVersion()); responseJson.addProperty("time", duration); response.body(this.gson.toJson(responseJson)); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java index f14e9da..68ecc15 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java @@ -7,6 +7,7 @@ import com.r11.tools.controller.internal.HandlerType; import com.r11.tools.controller.internal.RestController; import com.r11.tools.controller.internal.ScopedControllerManifest; import com.r11.tools.xml.Xalan; +import com.r11.tools.xml.XmlEngine; import org.apache.logging.log4j.Logger; import spark.Request; import spark.Response; @@ -17,9 +18,14 @@ public class XsdController implements RestController { private final Gson gson; private final Logger logger; - public XsdController(Gson gson, Logger logger) { + private final XmlEngine saxon; + private final XmlEngine xalan; + + public XsdController(Gson gson, Logger logger, XmlEngine saxon, XmlEngine xalan) { this.gson = gson; this.logger = logger; + this.saxon = saxon; + this.xalan = xalan; } @ScopedControllerManifest(method = HandlerType.POST, path = "/xsd") @@ -44,14 +50,14 @@ public class XsdController implements RestController { String data = requestJson.get("data").getAsString(); String xsd = requestJson.get("process").getAsString(); - response.header("processor", Xalan.getVersion()); + response.header("processor", xalan.getVersion()); long timeStart = System.currentTimeMillis(); String tmp; JsonObject responseJson = new JsonObject(); try { - tmp = Xalan.validate(data, xsd).trim(); + tmp = xalan.validate(data, xsd).trim(); response.status(200); @@ -69,7 +75,7 @@ public class XsdController implements RestController { long duration = System.currentTimeMillis() - timeStart; this.logger.info("Request (XSD, Xalan) processed in " + duration + " ms."); - responseJson.addProperty("processor", Xalan.getVersion()); + responseJson.addProperty("processor", xalan.getVersion()); responseJson.addProperty("time", duration); response.body(this.gson.toJson(responseJson)); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java index 6159456..966ea47 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java @@ -8,6 +8,7 @@ import com.r11.tools.controller.internal.RestController; import com.r11.tools.controller.internal.ScopedControllerManifest; import com.r11.tools.xml.Saxon; import com.r11.tools.xml.Xalan; +import com.r11.tools.xml.XmlEngine; import org.apache.logging.log4j.Logger; import spark.Request; import spark.Response; @@ -18,9 +19,14 @@ public class XsltController implements RestController { private final Gson gson; private final Logger logger; - public XsltController(Gson gson, Logger logger) { + private final XmlEngine saxon; + private final XmlEngine xalan; + + public XsltController(Gson gson, Logger logger, XmlEngine saxon, XmlEngine xalan) { this.gson = gson; this.logger = logger; + this.saxon = saxon; + this.xalan = xalan; } @ScopedControllerManifest(method = HandlerType.POST, path = "/xslt") @@ -61,7 +67,7 @@ public class XsltController implements RestController { case "saxon": timeStart = System.currentTimeMillis(); try { - tmp = Saxon.processXSLT(data, query); + tmp = saxon.processXSLT(data, query); response.status(200); @@ -79,7 +85,7 @@ public class XsltController implements RestController { duration = System.currentTimeMillis() - timeStart; this.logger.info("Request (XSLT, Saxon) processed in " + duration + " ms."); - responseJson.addProperty("processor", "Saxon " + Saxon.getVersion() + " " + version); + responseJson.addProperty("processor", "Saxon " + saxon.getVersion() + " " + version); responseJson.addProperty("time", duration); response.body(this.gson.toJson(responseJson)); @@ -88,7 +94,7 @@ public class XsltController implements RestController { case "xalan": timeStart = System.currentTimeMillis(); try { - tmp = Xalan.processXSLT(data, query); + tmp = xalan.processXSLT(data, query); response.status(200); @@ -106,7 +112,7 @@ public class XsltController implements RestController { duration = System.currentTimeMillis() - timeStart; this.logger.info("Request (XSLT, Xalan) processed in " + duration + " ms."); - responseJson.addProperty("processor", Xalan.getVersion()); + responseJson.addProperty("processor", xalan.getVersion()); responseJson.addProperty("time", duration); response.body(this.gson.toJson(responseJson)); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java b/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java index 4cb2835..f9f330b 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/xml/Saxon.java @@ -11,7 +11,7 @@ import java.io.StringWriter; * Handler for Saxon engine * @author Wojciech Czop */ -public class Saxon { +public class Saxon implements XmlEngine{ /** * Transforms string containing xml document via xslt @@ -20,7 +20,7 @@ public class Saxon { * @return transformed xml * @throws SaxonApiException thrown on stylesheet or transformation errors */ - public static String processXSLT(String data, String transform) throws SaxonApiException { + public String processXSLT(String data, String transform) throws SaxonApiException { Processor processor = new Processor(false); XsltCompiler compiler = processor.newXsltCompiler(); XsltExecutable stylesheet = compiler.compile(new StreamSource(new StringReader(transform))); @@ -34,6 +34,11 @@ public class Saxon { return sw.toString(); } + @Override + public String validate(String data, String xsd) { + throw new UnsupportedOperationException(); + } + /** * Process xpath and return either node or wrapped atomic value * @param data xml to be querried @@ -42,7 +47,7 @@ public class Saxon { * @return string xml representation of the node * @throws Exception thrown on node building errors or invalid xpath */ - public static XPathQueryResult processXPath(String data, String query, String version) throws Exception { + public XPathQueryResult processXPath(String data, String query, String version) throws Exception { Processor p = new Processor(false); XPathCompiler compiler = p.newXPathCompiler(); DocumentBuilder builder = p.newDocumentBuilder(); @@ -70,7 +75,7 @@ public class Saxon { * Returns version of the processor * @return version of the processor */ - public static String getVersion() { + public String getVersion() { return new Processor(false).getSaxonProductVersion(); } } diff --git a/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java b/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java index 1caad08..d9cf805 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java @@ -24,7 +24,7 @@ import java.io.*; * Handler for Xalan engine * @author Wojciech Czop */ -public class Xalan { +public class Xalan implements XmlEngine{ /** * Transforms string containing xml document via xslt @@ -33,7 +33,7 @@ public class Xalan { * @return transformed xml * @throws Exception thrown on stylesheet or transformation errors */ - public static String processXSLT(String data, String transform) throws Exception{ + public String processXSLT(String data, String transform) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(data))); @@ -51,7 +51,7 @@ public class Xalan { return sw.toString(); } - private static boolean isTextNode(Node n) { + private boolean isTextNode(Node n) { if (n == null) return false; short nodeType = n.getNodeType(); @@ -65,7 +65,7 @@ public class Xalan { * @return xml processed using given xpath * @throws Exception thrown on node building errors or invalid xpath */ - public static XPathQueryResult processXPath(String data, String transform) throws Exception { + public XPathQueryResult processXPath(String data, String transform, String version) throws Exception { // Set up a DOM tree to query. InputSource in = new InputSource(new StringReader(data)); @@ -112,7 +112,7 @@ public class Xalan { * Returns version of the processor * @return version of the processor */ - public static String getVersion(){ + public String getVersion(){ return org.apache.xalan.Version.getVersion(); } @@ -123,7 +123,7 @@ public class Xalan { * @return statement of validity * @throws Exception thrown on invalid xsd schema or xml */ - public static String validate(String data, String xsd) throws Exception{ + public String validate(String data, String xsd) throws Exception { Source dataSource = new StreamSource(new StringReader(data)); Source xsdSource = new StreamSource(new StringReader(xsd)); SchemaFactory schemaFactory = SchemaFactory diff --git a/Backend/tools-services/src/main/java/com/r11/tools/xml/XmlEngine.java b/Backend/tools-services/src/main/java/com/r11/tools/xml/XmlEngine.java new file mode 100644 index 0000000..5742073 --- /dev/null +++ b/Backend/tools-services/src/main/java/com/r11/tools/xml/XmlEngine.java @@ -0,0 +1,12 @@ +package com.r11.tools.xml; + +import com.r11.tools.controller.internal.XPathQueryResult; + +public interface XmlEngine { + XPathQueryResult processXPath(String data, String query, String version) throws Exception; + String processXSLT(String data, String transform) throws Exception; + String validate(String data, String xsd) throws Exception; + + public String getVersion(); + +} From dc3df79fc16c33646eaa6dbf0039fbb1005412e0 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Fri, 12 May 2023 10:06:19 +0200 Subject: [PATCH 35/59] Moved frontend of REST Mock to frontend container (solves #168) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/186 Reviewed-by: Mikolaj Widla --- .../r11/tools/controller/MainController.java | 27 ------------ .../assets/css/tools/mock}/common.css | 0 .../css/tools/mock}/font/Material-Icons.woff2 | Bin .../mock}/font/Nunito-VariableFont_wght.ttf | Bin .../assets/css/tools/mock}/font/fontello.eot | Bin .../assets/css/tools/mock}/font/fontello.svg | 0 .../assets/css/tools/mock}/font/fontello.ttf | Bin .../assets/css/tools/mock}/font/fontello.woff | Bin .../css/tools/mock}/font/fontello.woff2 | Bin .../assets/css/tools/mock}/fontello.css | 0 .../assets/css/tools/mock}/main.css | 0 .../assets/css/tools/mock}/r11addons.css | 0 .../assets/css/tools/mock}/r11flexbox.css | 0 .../assets/css/tools/mock}/r11modal.css | 0 .../assets/css/tools/mock}/r11tables.css | 0 .../assets/css/tools/mock}/r11tool.css | 0 .../assets/css/tools/mock}/r11tooltip.css | 0 Frontend/assets/scripts/frame.js | 2 +- .../scripts/tools/mock}/datatransfer.js | 2 +- .../assets/scripts/tools/mock}/fiddle.js | 0 .../scripts/tools/mock}/historyloader.js | 0 .../assets/scripts/tools/mock}/modal.js | 0 .../assets/scripts/tools/mock}/uianimation.js | 0 Frontend/assets/scripts/tools/scripts.js | 32 +++++--------- Frontend/index.html | 1 - .../static/html => Frontend/tools}/mock.html | 41 ++++-------------- 26 files changed, 21 insertions(+), 84 deletions(-) delete mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/controller/MainController.java rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/common.css (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/font/Material-Icons.woff2 (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/font/Nunito-VariableFont_wght.ttf (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/font/fontello.eot (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/font/fontello.svg (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/font/fontello.ttf (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/font/fontello.woff (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/font/fontello.woff2 (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/fontello.css (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/main.css (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/r11addons.css (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/r11flexbox.css (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/r11modal.css (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/r11tables.css (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/r11tool.css (100%) rename {Backend/mocked-services/src/main/resources/static/css => Frontend/assets/css/tools/mock}/r11tooltip.css (100%) rename {Backend/mocked-services/src/main/resources/static/js => Frontend/assets/scripts/tools/mock}/datatransfer.js (99%) rename {Backend/mocked-services/src/main/resources/static/js => Frontend/assets/scripts/tools/mock}/fiddle.js (100%) rename {Backend/mocked-services/src/main/resources/static/js => Frontend/assets/scripts/tools/mock}/historyloader.js (100%) rename {Backend/mocked-services/src/main/resources/static/js => Frontend/assets/scripts/tools/mock}/modal.js (100%) rename {Backend/mocked-services/src/main/resources/static/js => Frontend/assets/scripts/tools/mock}/uianimation.js (100%) rename {Backend/mocked-services/src/main/resources/static/html => Frontend/tools}/mock.html (89%) diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MainController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MainController.java deleted file mode 100644 index e4c3b66..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MainController.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.r11.tools.controller; - -import lombok.SneakyThrows; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -/** - * Class responsible for returning homepage html - * @author Gabriel Modzelewski - */ -@Controller -@RequestMapping("/") -public class MainController { - /** - * Default path to get the homepage - * @return the view of homepage - */ - @SneakyThrows - @GetMapping - public ModelAndView showHome(){ - ModelAndView mov = new ModelAndView(); - mov.setViewName("html/mock"); - return mov; - } -} diff --git a/Backend/mocked-services/src/main/resources/static/css/common.css b/Frontend/assets/css/tools/mock/common.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/common.css rename to Frontend/assets/css/tools/mock/common.css diff --git a/Backend/mocked-services/src/main/resources/static/css/font/Material-Icons.woff2 b/Frontend/assets/css/tools/mock/font/Material-Icons.woff2 similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/Material-Icons.woff2 rename to Frontend/assets/css/tools/mock/font/Material-Icons.woff2 diff --git a/Backend/mocked-services/src/main/resources/static/css/font/Nunito-VariableFont_wght.ttf b/Frontend/assets/css/tools/mock/font/Nunito-VariableFont_wght.ttf similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/Nunito-VariableFont_wght.ttf rename to Frontend/assets/css/tools/mock/font/Nunito-VariableFont_wght.ttf diff --git a/Backend/mocked-services/src/main/resources/static/css/font/fontello.eot b/Frontend/assets/css/tools/mock/font/fontello.eot similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/fontello.eot rename to Frontend/assets/css/tools/mock/font/fontello.eot diff --git a/Backend/mocked-services/src/main/resources/static/css/font/fontello.svg b/Frontend/assets/css/tools/mock/font/fontello.svg similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/fontello.svg rename to Frontend/assets/css/tools/mock/font/fontello.svg diff --git a/Backend/mocked-services/src/main/resources/static/css/font/fontello.ttf b/Frontend/assets/css/tools/mock/font/fontello.ttf similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/fontello.ttf rename to Frontend/assets/css/tools/mock/font/fontello.ttf diff --git a/Backend/mocked-services/src/main/resources/static/css/font/fontello.woff b/Frontend/assets/css/tools/mock/font/fontello.woff similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/fontello.woff rename to Frontend/assets/css/tools/mock/font/fontello.woff diff --git a/Backend/mocked-services/src/main/resources/static/css/font/fontello.woff2 b/Frontend/assets/css/tools/mock/font/fontello.woff2 similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/font/fontello.woff2 rename to Frontend/assets/css/tools/mock/font/fontello.woff2 diff --git a/Backend/mocked-services/src/main/resources/static/css/fontello.css b/Frontend/assets/css/tools/mock/fontello.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/fontello.css rename to Frontend/assets/css/tools/mock/fontello.css diff --git a/Backend/mocked-services/src/main/resources/static/css/main.css b/Frontend/assets/css/tools/mock/main.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/main.css rename to Frontend/assets/css/tools/mock/main.css diff --git a/Backend/mocked-services/src/main/resources/static/css/r11addons.css b/Frontend/assets/css/tools/mock/r11addons.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/r11addons.css rename to Frontend/assets/css/tools/mock/r11addons.css diff --git a/Backend/mocked-services/src/main/resources/static/css/r11flexbox.css b/Frontend/assets/css/tools/mock/r11flexbox.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/r11flexbox.css rename to Frontend/assets/css/tools/mock/r11flexbox.css diff --git a/Backend/mocked-services/src/main/resources/static/css/r11modal.css b/Frontend/assets/css/tools/mock/r11modal.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/r11modal.css rename to Frontend/assets/css/tools/mock/r11modal.css diff --git a/Backend/mocked-services/src/main/resources/static/css/r11tables.css b/Frontend/assets/css/tools/mock/r11tables.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/r11tables.css rename to Frontend/assets/css/tools/mock/r11tables.css diff --git a/Backend/mocked-services/src/main/resources/static/css/r11tool.css b/Frontend/assets/css/tools/mock/r11tool.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/r11tool.css rename to Frontend/assets/css/tools/mock/r11tool.css diff --git a/Backend/mocked-services/src/main/resources/static/css/r11tooltip.css b/Frontend/assets/css/tools/mock/r11tooltip.css similarity index 100% rename from Backend/mocked-services/src/main/resources/static/css/r11tooltip.css rename to Frontend/assets/css/tools/mock/r11tooltip.css diff --git a/Frontend/assets/scripts/frame.js b/Frontend/assets/scripts/frame.js index 493333a..9d2335c 100644 --- a/Frontend/assets/scripts/frame.js +++ b/Frontend/assets/scripts/frame.js @@ -42,7 +42,7 @@ function init() { tools.set("xslt", "tools/xslt.html"); tools.set("xmlform", "tools/xmlFormatter.html"); tools.set("jsonform", "tools/jsonFormatter.html"); - tools.set("mock", getMockHost()); + tools.set("mock", "tools/mock.html"); changeActiveTools('XML'); loadLastPage(); diff --git a/Backend/mocked-services/src/main/resources/static/js/datatransfer.js b/Frontend/assets/scripts/tools/mock/datatransfer.js similarity index 99% rename from Backend/mocked-services/src/main/resources/static/js/datatransfer.js rename to Frontend/assets/scripts/tools/mock/datatransfer.js index ba21743..922d5eb 100644 --- a/Backend/mocked-services/src/main/resources/static/js/datatransfer.js +++ b/Frontend/assets/scripts/tools/mock/datatransfer.js @@ -4,7 +4,7 @@ var json = {}; var jsonIndex = 0; var lastId = 1; var htable_row = 0; -var host = getDomain(); +var host = window.location.protocol + "//" + window.location.hostname + ":8097"; var dataModified = false; const addMessageName = 'addMessage'; const loadMessageName = 'changeMessage'; diff --git a/Backend/mocked-services/src/main/resources/static/js/fiddle.js b/Frontend/assets/scripts/tools/mock/fiddle.js similarity index 100% rename from Backend/mocked-services/src/main/resources/static/js/fiddle.js rename to Frontend/assets/scripts/tools/mock/fiddle.js diff --git a/Backend/mocked-services/src/main/resources/static/js/historyloader.js b/Frontend/assets/scripts/tools/mock/historyloader.js similarity index 100% rename from Backend/mocked-services/src/main/resources/static/js/historyloader.js rename to Frontend/assets/scripts/tools/mock/historyloader.js diff --git a/Backend/mocked-services/src/main/resources/static/js/modal.js b/Frontend/assets/scripts/tools/mock/modal.js similarity index 100% rename from Backend/mocked-services/src/main/resources/static/js/modal.js rename to Frontend/assets/scripts/tools/mock/modal.js diff --git a/Backend/mocked-services/src/main/resources/static/js/uianimation.js b/Frontend/assets/scripts/tools/mock/uianimation.js similarity index 100% rename from Backend/mocked-services/src/main/resources/static/js/uianimation.js rename to Frontend/assets/scripts/tools/mock/uianimation.js diff --git a/Frontend/assets/scripts/tools/scripts.js b/Frontend/assets/scripts/tools/scripts.js index 9c89779..3532208 100644 --- a/Frontend/assets/scripts/tools/scripts.js +++ b/Frontend/assets/scripts/tools/scripts.js @@ -65,28 +65,6 @@ function clearDataField() { } -/** - * The `escapeHTML` function is used to escape special characters in an HTML element's innerHTML property. - * This is done to prevent these characters from being interpreted as HTML tags or attributes, - * which could potentially cause security vulnerabilities or unintended behavior. - * - * @function - * @name escapeHTML - * @kind function - * @param {any} element - * @returns {void} - */ -function escapeHTML(elementID) { - document.getElementById(elementID).innerHTML = document.getElementById(elementID).innerHTML - .replace(/&/g, "&") - .replace(//g, ">") - .replace(/"/g, """) - .replace(/'/g, "'"); -} - - - /** * It fills the XML area with a sample XML. * @@ -111,6 +89,16 @@ function fillDefaultXML(element) { } } + +/** +* It fills the XSD area with a sample XSD and XML area with matching XML. +* +* @function +* @name fillDefaultXSD +* @kind function +* @param {any} element +* @returns {void} +*/ function fillDefaultXSD(){ const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; fetch(serverAddress + "/assets/samples/sampleXSD.xsd") diff --git a/Frontend/index.html b/Frontend/index.html index 4073ca4..d8aeaa6 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -5,7 +5,6 @@ - Release11 Web Tools diff --git a/Backend/mocked-services/src/main/resources/static/html/mock.html b/Frontend/tools/mock.html similarity index 89% rename from Backend/mocked-services/src/main/resources/static/html/mock.html rename to Frontend/tools/mock.html index d3ff264..6039601 100644 --- a/Backend/mocked-services/src/main/resources/static/html/mock.html +++ b/Frontend/tools/mock.html @@ -3,12 +3,10 @@ R11 MockedServices - - - - + + + -
    @@ -155,14 +153,6 @@ -
    @@ -179,19 +169,6 @@
    -
    @@ -302,7 +279,7 @@
    Message saved
    -
    Your message has been successfuly saved.
    You might view it under the link.
    +
    Your message has been successfully saved.
    You might view it under the link.
    - - - - - + + + + + From c89623c3a8b0c2327068f65c0f83008a0db3cb33 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Fri, 12 May 2023 14:13:47 +0200 Subject: [PATCH 36/59] Dependencies in libXML now have specified versions Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/187 Reviewed-by: Mikolaj Widla --- Backend-libXML/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Backend-libXML/requirements.txt b/Backend-libXML/requirements.txt index 7c41ff0..abb4521 100644 --- a/Backend-libXML/requirements.txt +++ b/Backend-libXML/requirements.txt @@ -1,3 +1,3 @@ -lxml -flask -flask_cors \ No newline at end of file +lxml==4.9.2 +flask==2.3.2 +flask_cors==3.0.10 \ No newline at end of file From 2d97e39dbe36ca07c2a1e711cd5408bf279e3205 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Fri, 12 May 2023 15:03:46 +0200 Subject: [PATCH 37/59] Fixed 404 when no lastPage was stored (solves #189) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/190 --- Frontend/assets/scripts/frame.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Frontend/assets/scripts/frame.js b/Frontend/assets/scripts/frame.js index 9d2335c..c1c72f7 100644 --- a/Frontend/assets/scripts/frame.js +++ b/Frontend/assets/scripts/frame.js @@ -107,7 +107,11 @@ function changeTool(tool) { * @returns {void} */ function loadLastPage() { - const lastPage = localStorage.getItem("lastPage"); + var lastPage = localStorage.getItem("lastPage"); + if (lastPage == null) { + lastPage = "xpath"; + } + switch (lastPage) { // XML category is default. case "jsonform": changeActiveTools('JSON'); From bcbfd34febb81dc58b565a8f0d76a9e44b098ff1 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Tue, 16 May 2023 09:59:04 +0200 Subject: [PATCH 38/59] Moved scripts from .html files to seperate js .files (#191) Let's hope everything works as before or better. Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/191 Reviewed-by: Mikolaj Widla --- Frontend/assets/scripts/frame.js | 15 -- Frontend/assets/scripts/tools/json.js | 72 ----- .../assets/scripts/tools/jsonFormatter.js | 250 ++++++++++++++++++ Frontend/assets/scripts/tools/xmlFormatter.js | 34 +++ Frontend/assets/scripts/tools/xpath.js | 174 ++++++++++++ Frontend/assets/scripts/tools/xsd.js | 51 ++++ Frontend/assets/scripts/tools/xslt.js | 100 +++++++ Frontend/tools/jsonFormatter.html | 175 +----------- Frontend/tools/xmlFormatter.html | 17 +- Frontend/tools/xpath.html | 151 +---------- Frontend/tools/xsd.html | 40 +-- Frontend/tools/xslt.html | 88 +----- 12 files changed, 616 insertions(+), 551 deletions(-) delete mode 100644 Frontend/assets/scripts/tools/json.js create mode 100644 Frontend/assets/scripts/tools/jsonFormatter.js create mode 100644 Frontend/assets/scripts/tools/xmlFormatter.js create mode 100644 Frontend/assets/scripts/tools/xpath.js create mode 100644 Frontend/assets/scripts/tools/xsd.js create mode 100644 Frontend/assets/scripts/tools/xslt.js diff --git a/Frontend/assets/scripts/frame.js b/Frontend/assets/scripts/frame.js index c1c72f7..00f61c6 100644 --- a/Frontend/assets/scripts/frame.js +++ b/Frontend/assets/scripts/frame.js @@ -1,20 +1,5 @@ const tools = new Map(); -/** - * This functions imports other js file. I hate this solution, but other didn't work. - * - * @function - * @name importScript - * @kind function - * @param {any} url - * @returns {void} - */ -function importScript(url) { - var script = document.createElement("script"); - script.src = url; - document.head.appendChild(script); -} - /** * Get address of Mock Services * diff --git a/Frontend/assets/scripts/tools/json.js b/Frontend/assets/scripts/tools/json.js deleted file mode 100644 index 1f5f09c..0000000 --- a/Frontend/assets/scripts/tools/json.js +++ /dev/null @@ -1,72 +0,0 @@ -function formatAndValidateJson(errorElement) { - const input = document.querySelector('#jsonBlock'); - const processInfo = document.getElementById(errorElement); - - const address = window.location.protocol + "//" + window.location.hostname + ":" + 8081 + "/json/formatting" - - fetch(address, { - method: 'POST', - body: input.textContent - }) - .then(async (response) => { - const promise = response.json(); - if (!response.ok) { - throw Error(await promise); - } - - return promise; - }) - .then((data) => { - input.innerText = data.data; - processInfo.innerText = ""; - hljs.highlightElement(input); - - processInfo.innerHTML = "Computed in " + data.time + "ms"; - }) - .catch((error) => { - processInfo.innerHTML = "" + error.data + ""; - console.error('Error:', error); - }); -} - -function minimizeJson(errorElement) { - const input = document.querySelector('#jsonBlock'); - const processInfo = document.getElementById(errorElement); - - const address = window.location.protocol + "//" + window.location.hostname + ":" + 8081 + "/json/minimize" - - fetch(address, { - method: 'POST', - body: input.textContent - }) - .then(async (response) => { - const promise = response.json(); - if (!response.ok) { - throw Error(await promise); - } - - return promise; - }) - .then((data) => { - input.innerText = data.data; - processInfo.innerText = ""; - hljs.highlightElement(input); - - processInfo.innerHTML = "Computed in " + data.time + "ms"; - }) - .catch((error) => { - processInfo.innerHTML = "" + error.data + ""; - console.error('Error:', error); - }); -} - -function clearJsonData() { - const input = document.querySelector('#jsonBlock'); - input.textContent = ""; -} - -function insertDefaultJson() { - const input = document.querySelector('#jsonBlock'); - input.textContent = "{\"enter\": \"your\", \"json\": \"here\"}"; - hljs.highlightElement(input); -} \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/jsonFormatter.js b/Frontend/assets/scripts/tools/jsonFormatter.js new file mode 100644 index 0000000..64f7609 --- /dev/null +++ b/Frontend/assets/scripts/tools/jsonFormatter.js @@ -0,0 +1,250 @@ + + +const mergeHTMLPlugin = (function () { + 'use strict'; + + var originalStream; + + /** + * @param {string} value + * @returns {string} + */ + function escapeHTML(value) { + return value + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + } + + + /* plugin itself */ + + /** @type {HLJSPlugin} */ + const mergeHTMLPlugin = { + // preserve the original HTML token stream + "before:highlightElement": ({ el }) => { + originalStream = nodeStream(el); + }, + // merge it afterwards with the highlighted token stream + "after:highlightElement": ({ el, result, text }) => { + if (!originalStream.length) { + return; + } + + const resultNode = document.createElement('div'); + resultNode.innerHTML = result.value; + result.value = mergeStreams(originalStream, nodeStream(resultNode), text); + el.innerHTML = result.value; + } + }; + + /** + * @param {Node} node + */ + function tag(node) { + return node.nodeName.toLowerCase(); + } + + /** + * @param {Node} node + */ + function nodeStream(node) { + /** @type Event[] */ + const result = []; + (function _nodeStream(node, offset) { + for (let child = node.firstChild; child; child = child.nextSibling) { + if (child.nodeType === 3) { + offset += child.nodeValue.length; + } else if (child.nodeType === 1) { + result.push({ + event: 'start', + offset: offset, + node: child + }); + offset = _nodeStream(child, offset); + + if (!tag(child).match(/br|hr|img|input/)) { + result.push({ + event: 'stop', + offset: offset, + node: child + }); + } + } + } + return offset; + })(node, 0); + return result; + } + + /** + * @param {any} original - the original stream + * @param {any} highlighted - stream of the highlighted source + * @param {string} value - the original source itself + */ + function mergeStreams(original, highlighted, value) { + let processed = 0; + let result = ''; + const nodeStack = []; + + function selectStream() { + if (!original.length || !highlighted.length) { + return original.length ? original : highlighted; + } + if (original[0].offset !== highlighted[0].offset) { + return (original[0].offset < highlighted[0].offset) ? original : highlighted; + } + + return highlighted[0].event === 'start' ? original : highlighted; + } + + /** + * @param {Node} node + */ + function open(node) { + /** @param {Attr} attr */ + function attributeString(attr) { + return ' ' + attr.nodeName + '="' + escapeHTML(attr.value) + '"'; + } + + // @ts-ignore + result += '<' + tag(node) + [].map.call(node.attributes, attributeString).join('') + + '>'; + } + + /** + * @param {Node} node + */ + function close(node) { + result += ''; + } + + /** + * @param {Event} event + */ + function render(event) { + (event.event === 'start' ? open : close)(event.node); + } + + while (original.length || highlighted.length) { + let stream = selectStream(); + result += escapeHTML(value.substring(processed, stream[0].offset)); + processed = stream[0].offset; + if (stream === original) { + /* + On any opening or closing tag of the original markup we first close + the entire highlighted node stack, then render the original tag along + with all the following original tags at the same offset and then + reopen all the tags on the highlighted stack. + */ + nodeStack.reverse().forEach(close); + do { + render(stream.splice(0, 1)[0]); + stream = selectStream(); + } while (stream === original && stream.length && stream[0].offset === processed); + nodeStack.reverse().forEach(open); + } else { + if (stream[0].event === 'start') { + nodeStack.push(stream[0].node); + } else { + nodeStack.pop(); + } + render(stream.splice(0, 1)[0]); + } + } + return result + escapeHTML(value.substr(processed)); + } + + return mergeHTMLPlugin; + +}()); + +function formatAndValidateJson(errorElement) { + const input = document.querySelector('#jsonBlock'); + const processInfo = document.getElementById(errorElement); + + const address = window.location.protocol + "//" + window.location.hostname + ":" + 8081 + "/json/formatting" + + fetch(address, { + method: 'POST', + body: input.textContent + }) + .then(async (response) => { + const promise = response.json(); + if (!response.ok) { + throw Error(await promise); + } + + return promise; + }) + .then((data) => { + input.innerText = data.data; + processInfo.innerText = ""; + hljs.highlightElement(input); + + processInfo.innerHTML = "Computed in " + data.time + "ms"; + }) + .catch((error) => { + processInfo.innerHTML = "" + error.data + ""; + console.error('Error:', error); + }); +} + +function minimizeJson(errorElement) { + const input = document.querySelector('#jsonBlock'); + const processInfo = document.getElementById(errorElement); + + const address = window.location.protocol + "//" + window.location.hostname + ":" + 8081 + "/json/minimize" + + fetch(address, { + method: 'POST', + body: input.textContent + }) + .then(async (response) => { + const promise = response.json(); + if (!response.ok) { + throw Error(await promise); + } + + return promise; + }) + .then((data) => { + input.innerText = data.data; + processInfo.innerText = ""; + hljs.highlightElement(input); + + processInfo.innerHTML = "Computed in " + data.time + "ms"; + }) + .catch((error) => { + processInfo.innerHTML = "" + error.data + ""; + console.error('Error:', error); + }); +} + +function clearJsonData() { + const input = document.querySelector('#jsonBlock'); + input.textContent = ""; +} + +function insertDefaultJson() { + const input = document.querySelector('#jsonBlock'); + input.textContent = "{\"enter\": \"your\", \"json\": \"here\"}"; + hljs.highlightElement(input); +} + +/** + * This function is executed after the page is loaded. + * + * @function + * @name init + * @kind function + */ +function init() { + // Make sure that only plain text is pasted + configurePastingInElement("jsonBlock"); + + hljs.addPlugin(mergeHTMLPlugin); +} + diff --git a/Frontend/assets/scripts/tools/xmlFormatter.js b/Frontend/assets/scripts/tools/xmlFormatter.js new file mode 100644 index 0000000..fef7d28 --- /dev/null +++ b/Frontend/assets/scripts/tools/xmlFormatter.js @@ -0,0 +1,34 @@ +/** + * This function is executed after the page is loaded. + * + * @function + * @name init + * @kind function + */ +function init() { + configurePastingInElement("xmlArea"); +} + +/** + * Function returns processor that will be used to transform XML. + * This solution allows to use one function for sending request from every tool + * + * @function + * @name getProcessor + * @kind function + */ +function getProcessor() { + return "libxml"; +} + +/** + * Function returns version of XML processor that will be used to transform XML. + * This solution allows to use one function for sending request from every tool + * + * @function + * @name getVersion + * @kind function + */ +function getVersion() { + return "1.0" +} \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/xpath.js b/Frontend/assets/scripts/tools/xpath.js new file mode 100644 index 0000000..ab5bff6 --- /dev/null +++ b/Frontend/assets/scripts/tools/xpath.js @@ -0,0 +1,174 @@ + +/** + * The `processVersionSelector()` function is responsible for updating the display of the web page + * based on the selected processor and version. + * + * @function + * @name processVersionSelector + * @kind function + * @returns {void} + */ +function processVersionSelector() { + var processor = getProcessor(); + var hideableOptions = document.getElementsByClassName("hideable"); + for (let i = 0; i < hideableOptions.length; i++) { + hideableOptions[i].style = "display: none;"; + } + if (processor == "xalan" || processor == "libxml") { + var xalanOptions = document.getElementsByClassName("xalan"); + for (let i = 0; i < xalanOptions.length; i++) { + xalanOptions[i].style = ""; + } + document.getElementById("versions").selectedIndex = 0; + } + else { + var saxonOptions = document.getElementsByClassName("saxon"); + for (let i = 0; i < saxonOptions.length; i++) { + saxonOptions[i].style = ""; + } + document.getElementById("versions").selectedIndex = 3; + + } + processTooltip(); + +} + +/** + * The `processTooltip()` function is responsible for updating the display of the tooltip based on the selected version of the processor. + * It shows or hides different sections of the tooltip based on the selected version. + * It also handles the click event on the form and updates the tooltip accordingly. + * + * @function + * @name processTooltip + * @kind function + */ +function processTooltip() { + var filter = "collapse" + getVersion(); + var collList; + + + if (filter == "collapse3.0") { + document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.0 functions"; + hideList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); + showList(document.getElementsByName("collapse30")); + hideList(document.getElementsByName("collapse31")); + + } else if (filter == "collapse3.1") { + document.getElementById("tooltipFunctionInfo").innerText = "XPath 3.1 functions"; + hideList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); + hideList(document.getElementsByName("collapse30")); + showList(document.getElementsByName("collapse31")); + } else if (filter == "collapse2.0") { + document.getElementById("tooltipFunctionInfo").innerText = "XPath 2.0 functions"; + hideList(document.getElementsByName("collapse10")); + showList(document.getElementsByName("collapse20")); + hideList(document.getElementsByName("collapse30")); + hideList(document.getElementsByName("collapse31")); + } else { + document.getElementById("tooltipFunctionInfo").innerText = "XPath 1.0 functions"; + showList(document.getElementsByName("collapse10")); + hideList(document.getElementsByName("collapse20")); + hideList(document.getElementsByName("collapse30")); + hideList(document.getElementsByName("collapse31")); + + } +} + + + +/** + * This function is executed after the page is loaded. + * + * @function + * @name init + * @kind function + */ +function init() { + + // Make sure that only plain text is pasted + configurePastingInElement("xmlArea"); + configurePastingInElement("transformArea"); + + //Handle clicks in whole form and set info in tooltip + setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); + setDefaultContent(document.getElementById("transformArea"), 'Insert XPath expression here'); + + processVersionSelector(); + processTooltip(); + tool.addEventListener('change', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID == "processors") { + processVersionSelector(); + processTooltip(); + } + else if (targetID == "versions") { + processTooltip(); + } + + + }) + tool.addEventListener('click', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID !== "xmlArea" && targetID !== "transformArea") { + return; + } + processTooltip(); + + }) + tool.addEventListener('change', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID !== "xmlArea" && targetID !== "transformArea") { + return; + } + processTooltip(); + }) + + var triggerList = document.getElementsByClassName("collapseTrigger"); + for (i = 0; i < triggerList.length; i++) { + + triggerList[i].addEventListener("click", function () { + var collapsible = this.parentElement; + if (this.tagName == "A") { + var collapsibleData = this.nextElementSibling; + } else { + var collapsibleData = this.parentElement.nextElementSibling; + + } + + + if (collapsibleData.style.maxHeight > "0px") { + collapsibleData.style.maxHeight = "0px"; + + this.classList.toggle("active", false); + if (!this.classList.contains("collapsibleMini")) { + collapsible.classList.toggle("active", false); + } + + var subLists1 = collapsibleData.getElementsByClassName("content"); + var subLists2 = collapsibleData.getElementsByClassName("active"); + for (j = 0; j < subLists1.length; j++) { + subLists1[j].style.maxHeight = "0px"; + } + for (j = 0; j < subLists2.length; j++) { + subLists2[j].classList.toggle("active", false); + } + } else { + collapsibleData.style.maxHeight = (collapsibleData.scrollHeight) + "px"; + + this.classList.toggle("active", true); + if (!this.classList.contains("collapsibleMini")) { + collapsible.classList.toggle("active", true); + } else { + var parentContent = this.closest(".content"); + parentContent.style.maxHeight = (parentContent.scrollHeight + collapsibleData.scrollHeight) + "px"; + } + } + }); + } +} + diff --git a/Frontend/assets/scripts/tools/xsd.js b/Frontend/assets/scripts/tools/xsd.js new file mode 100644 index 0000000..62e5612 --- /dev/null +++ b/Frontend/assets/scripts/tools/xsd.js @@ -0,0 +1,51 @@ +/** + * This function is executed after the page is loaded. + * + * @function + * @name init + * @kind function + */ +function init() { + // Make sure that only plain text is pasted + configurePastingInElement("xmlArea"); + configurePastingInElement("transformArea"); + + //Handle clicks in whole form and set info in tooltip + setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); + setDefaultContent(document.getElementById("transformArea"), 'Insert XSD here'); + + // refreshTooltip(); + processTooltip(); + tool.addEventListener('click', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID !== "processors" && targetID !== "xmlArea" && targetID !== "transformArea" && targetID !== "versions") { + return; + } + + processTooltip(); + + }) +} + +/** + * The `processTooltip()` function is responsible for updating the display of the tooltip based on the selected version of the processor. + * It shows or hides different sections of the tooltip based on the selected version. + * It also handles the click event on the form and updates the tooltip accordingly. + * + * @function + * @name processTooltip + * @kind function + */ +function processTooltip() { + + if (getProcessor() == "xalan") { + document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions"; + document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0"; + hideList(document.getElementsByName("collapse30")); + } else { + document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0, 2.0 & 3.0 functions"; + document.getElementById("processorTooltipInfo").innerText = "Supports XSLT up to 3.0"; + showList(document.getElementsByName("collapse30")); + } +} \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/xslt.js b/Frontend/assets/scripts/tools/xslt.js new file mode 100644 index 0000000..4e61cb1 --- /dev/null +++ b/Frontend/assets/scripts/tools/xslt.js @@ -0,0 +1,100 @@ +/** + * The `processTooltip()` function is responsible for updating the display of the tooltip based on the selected version of the processor. + * It shows or hides different sections of the tooltip based on the selected version. + * It also handles the click event on the form and updates the tooltip accordingly. + * + * @function + * @name processTooltip + * @kind function + */ +function processTooltip() { + + if (getProcessor() == "xalan" || getProcessor() == "libxml") { + document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions"; + document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0"; + hideList(document.getElementsByName("collapse30")); + } else { + document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0, 2.0 & 3.0 functions"; + document.getElementById("processorTooltipInfo").innerText = "Supports XSLT up to 3.0"; + showList(document.getElementsByName("collapse30")); + } +} + + +/** + * This function is executed after the page is loaded. + * + * @function + * @name init + * @kind function + */ +function init() { + // Make sure that only plain text is pasted + configurePastingInElement("xmlArea"); + configurePastingInElement("transformArea"); + + //Handle clicks in whole form and set info in tooltip + setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); + setDefaultContent(document.getElementById("transformArea"), 'Insert XSLT here'); + + // refreshTooltip(); + processTooltip(); + tool.addEventListener('click', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID !== "processors" && targetID !== "xmlArea" && targetID !== "transformArea" && targetID !== "versions") { + return; + } + + processTooltip(); + }) + + tool.addEventListener('change', event => { + //Check if script was called from textarea or selector + var targetID = event.target.getAttribute('id'); + if (targetID !== "processors") { + return; + } + + processTooltip(); + + }) + + var triggerList = document.getElementsByClassName("collapseTrigger"); + for (i = 0; i < triggerList.length; i++) { + + triggerList[i].addEventListener("click", function () { + + var collapsible = this.parentElement; + var collapsibleData = this.nextElementSibling; + if (collapsibleData.style.maxHeight > "0px") { + collapsibleData.style.maxHeight = "0px"; + + this.classList.toggle("active", false); + if (!this.classList.contains("collapsibleMini")) { + collapsible.classList.toggle("active", false); + } + + var subLists1 = collapsibleData.getElementsByClassName("content"); + var subLists2 = collapsibleData.getElementsByClassName("active"); + for (j = 0; j < subLists1.length; j++) { + subLists1[j].style.maxHeight = "0px"; + } + for (j = 0; j < subLists2.length; j++) { + subLists2[j].classList.toggle("active", false); + } + } else { + collapsibleData.style.maxHeight = (collapsibleData.scrollHeight) + "px"; + + this.classList.toggle("active", true); + if (!this.classList.contains("collapsibleMini")) { + collapsible.classList.toggle("active", true); + } else { + var parentContent = this.closest(".content"); + parentContent.style.maxHeight = (parentContent.scrollHeight + collapsibleData.scrollHeight) + "px"; + } + } + }); + } + +} \ No newline at end of file diff --git a/Frontend/tools/jsonFormatter.html b/Frontend/tools/jsonFormatter.html index 300ff95..8081f02 100644 --- a/Frontend/tools/jsonFormatter.html +++ b/Frontend/tools/jsonFormatter.html @@ -7,10 +7,9 @@ - - + + - @@ -61,175 +60,5 @@
    - - diff --git a/Frontend/tools/xmlFormatter.html b/Frontend/tools/xmlFormatter.html index c9419ea..a200e44 100644 --- a/Frontend/tools/xmlFormatter.html +++ b/Frontend/tools/xmlFormatter.html @@ -5,8 +5,9 @@ - + + @@ -62,20 +63,6 @@ - - diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index b7726d4..6a6fc3c 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -5,6 +5,7 @@ + @@ -17115,156 +17116,6 @@ - - \ No newline at end of file diff --git a/Frontend/tools/xsd.html b/Frontend/tools/xsd.html index 100756b..52e559a 100644 --- a/Frontend/tools/xsd.html +++ b/Frontend/tools/xsd.html @@ -6,6 +6,7 @@ + @@ -79,45 +80,6 @@ - - \ No newline at end of file diff --git a/Frontend/tools/xslt.html b/Frontend/tools/xslt.html index 7fd299b..e5dd2f0 100644 --- a/Frontend/tools/xslt.html +++ b/Frontend/tools/xslt.html @@ -6,6 +6,7 @@ + @@ -1147,93 +1148,6 @@ - - \ No newline at end of file From 1930cde695386c249c10708823baf8d72d207e9c Mon Sep 17 00:00:00 2001 From: Dariusz Augustyniak Date: Wed, 17 May 2023 14:08:16 +0200 Subject: [PATCH 39/59] Postman tests (#194) Co-authored-by: augustyd Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/194 Reviewed-by: Adam Bem Co-authored-by: Dariusz Augustyniak Co-committed-by: Dariusz Augustyniak --- ...elease Tools Tests.postman_collection.json | 11342 ++++++++++++++++ 1 file changed, 11342 insertions(+) create mode 100644 Tests/Release Tools Tests.postman_collection.json diff --git a/Tests/Release Tools Tests.postman_collection.json b/Tests/Release Tools Tests.postman_collection.json new file mode 100644 index 0000000..f979a93 --- /dev/null +++ b/Tests/Release Tools Tests.postman_collection.json @@ -0,0 +1,11342 @@ +{ + "info": { + "_postman_id": "429fb09c-4653-405d-b6cb-de03b624e67b", + "name": "Release Tools Tests", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "Xpath functions 2.0", + "item": [ + { + "name": "SaxonTrace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"trace(5, 'the value of 5 is:')\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAdjust-dateTime-to-timezone", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2002-05-30T03:00:00Z\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"2002-05-30T09:00:00+06:00\",\n \"process\": \"adjust-dateTime-to-timezone(/start)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAdjust-date-to-timezone", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2002-09-23Z\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"2002-09-24+06:00\",\n \"process\": \"adjust-date-to-timezone(/start)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAdjust-time-to-timezone", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"09:30:10.5Z\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"adjust-time-to-timezone(/start)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAnalyze-string", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"\\n The\\n \\n cat\\n \\n sat\\n \\n on\\n \\n the\\n \\n mat\\n .\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"analyze-string(\\\"The cat sat on the mat.\\\", \\\"\\\\w+\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonApply", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"abc\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"apply(concat#3, [\\\"a\\\", \\\"b\\\", \\\"c\\\"])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAvailable-environment-variables", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"PATH\\nHOSTNAME\\nJAVA_HOME\\nPWD\\nJAVA_VERSION\\nLANG\\nHOME\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"available-environment-variables() \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonAvg", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"avg((1,2,3))\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonBase-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.chevrolet.com/\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"base-uri(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonBoolean", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"boolean(/start) \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCodepoint-equal", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"codepoint-equal(string(/start),'09:30:10.5') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCodepoint-to-String", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"ψ\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"0968\",\n \"process\": \"codepoints-to-string(xs:integer(/start)) \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCollation-key", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"AAB4AABzAAA6AABzAAB0AAByAABpAABuAABn\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"collation-key('xs:string') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCollection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"AAB4AABzAAA6AABzAAB0AAByAABpAABuAABn\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"collation-key('xs:string') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCompare", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"compare('xs:string','jakisstring') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonContains", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"contains('xs:string','string') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonContains-token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"false\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"contains-token('xs:string sting strung same','string') \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCount", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"4\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"count(('xs:string',' sting',' strung ','same')) \",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCurrent-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result.slice(0, 10)).to.eql((new Date()).toISOString().slice(0, 10));", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"current-date()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCurrent-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result.slice(0, 18)).to.eql((new Date()).toISOString().slice(0, 18));", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"current-dateTime()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCurrent-time", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result.slice(0, 8)).to.eql((new Date()).toISOString().slice(11, 19));", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"09:30:10.5\",\n \"process\": \"current-time()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonData", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"data(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonDeep-equal", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"deep-equal(/l:library/l:readerList/p:person[1],/l:library/l:readerList/p:person[2])\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonDefault-collation", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.w3.org/2005/xpath-functions/collation/codepoint\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"default-collation()\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonDefault-language", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"en\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"default-language()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "Saxondistinct-values", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n2\\n3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"distinct-values(('1','1','2','3'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "Saxondistinct-values-parametryzacja", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n2\\n3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + " var request = pm.request.toJSON().url.query;", + " console.log(request);", + " pm.environment.set(\"process\", request[0].value);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"{{process}}\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "process", + "value": "distinct-values(('1','1','2','3'))", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonDocument-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"document-uri()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonDoc-available", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"doc-available('https://www.w3schools.com/xml/note.xml')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonDoc", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"\\n Tove\\n Jani\\n Reminder\\n Don't forget me this weekend!\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"doc('https://www.w3schools.com/xml/note.xml')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonEmpty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + " pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"empty(/l:library/l:readerList/p:person[0])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonEncode-for-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"l%3Alibrary%2Fl%3AreaderList\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"encode-for-uri('l:library/l:readerList')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonEnds-with", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"ends-with('l:library/l:readerList','ist')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonEnvironment-variable", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"/usr/local/openjdk-18\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"environment-variable('JAVA_HOME')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonError", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Error signalled by application call on error()\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"error()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonExactly-one", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\" \");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"exactly-one(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonExists", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"exists(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFalse", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"false\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"false()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFloor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"floor(5.5)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFold-left", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"15\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"fold-left(1 to 5, 0, function($a, $b) { $a + $b })\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFold-right", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"15\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"fold-right(1 to 5, 0, function($a, $b) { $a + $b })\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFor-each", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n4\\n9\\n16\\n25\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"for-each(1 to 5, function($a) { $a * $a })\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFor-each-pair", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"ax\\nby\\ncz\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"for-each-pair(('a', 'b', 'c'), ('x', 'y', 'z'), concat#2)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFormat-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " const date = new Date();", + "", + "let day = date.getDate();", + "let month = date.getMonth() + 1;", + "let year = date.getFullYear();", + "if (date < 10) {", + " date = '0' + date;", + "}", + "", + "if (month < 10) {", + " month = '0' + month;", + "}", + "", + "// This arrangement can be altered based on how we want the date's format to appear.", + "let currentDate = `${month}/${day}/${year}`;", + "console.log(currentDate); // \"17-6-2022\"", + " pm.expect(jsonData.result).to.eql(currentDate);", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"format-date(current-date(), '[M01]/[D01]/[Y0001]')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFormat-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " const date = new Date();", + "", + "let day = date.getDate();", + "let month = date.getMonth() + 1;", + "let year = date.getFullYear();", + "if (date < 10) {", + " date = '0' + date;", + "}", + "", + "if (month < 10) {", + " month = '0' + month;", + "}", + "", + "// This arrangement can be altered based on how we want the date's format to appear.", + "let currentDate = `${month}/${day}/${year}`;", + "console.log(currentDate); // \"17-6-2022\"", + " pm.expect(jsonData.result).to.eql(currentDate);", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"format-dateTime(current-dateTime(), '[M01]/[D01]/[Y0001]')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFormat-integer", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"one hundred and twenty three\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"format-integer(123, 'w')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFormat-number", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"14%\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"format-number(0.14, '01%')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFormat-time", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql((new Date()).toISOString().slice(11, 19));", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"format-time(current-time(), '[H01]:[m01]:[s01]')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFunction-arity", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('3');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"function-arity(substring#3)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFunction-lookup", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('2011-11-11T11:11:11Z');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \" (function-lookup(xs:QName('xs:dateTimeStamp'), 1), xs:dateTime#1)[1] ('2011-11-11T11:11:11Z')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonFunction-name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('fn:substring');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"function-name(substring#3)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonGenerate-id", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('d0e11');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"generate-id(/l:library/l:readerList/p:person[2])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonHas-children", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('true');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"has-children(/l:library/l:readerList/p:person[2])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonHead", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(' ');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"head(/l:library/l:readerList/p:person)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonHours-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql((new Date().getHours()-2).toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"hours-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonHours-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('10');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"hours-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonHours-from-time", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('11');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"hours-from-time(xs:time('11:23:00'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"id(d0e1)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "Saxonidref", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"idref(d0e11)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonImplicit-timezone", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('PT0S');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"implicit-timezone()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonIndex-of", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('2\\n5');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"index-of((10, 20, 30, 30, 20, 10), 20)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonInnermost", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(' \\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 5123\\n Lauren\\n Wong\\n\\n\\n 6422\\n Harry Potter\\n 7542\\n\\n\\n 1234\\n Macbeth\\n 5123\\n\\n\\n 9556\\n Romeo and Juliet\\n');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"innermost((/l:library/l:bookList/b:book , /l:library/l:readerList/p:person))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonIn-scope-prefixes", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('b\\nl\\np\\nxsi\\nxml');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"in-scope-prefixes(/l:library/l:bookList/b:book[1])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonInsert-before", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1\\n2\\n8\\n9\\n10\\n3\\n4\\n5\\n6\\n7');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"insert-before((1,2,3,4,5,6,7),3,(8,9,10))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonIri-to-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('http://tools.zipper.release11.com:8086/');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"iri-to-uri ('http://tools.zipper.release11.com:8086/')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonJson-to-xml", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('\\n saxon\\n');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"{\\\"processor\\\": \\\"saxon\\\"}\",\n \"process\": \"json-to-xml(/)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLang", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('false');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"lang(/l:library/l:readerList/p:person[2])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLast", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('4\\n4\\n4\\n4');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person/last()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLoad-xquery-module", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('An empty sequence is not allowed as the first argument of fn:load-xquery-module()');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"load-xquery-module(document-uri(/))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLocal-name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('library');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"local-name(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLocal-name-from-QName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('person');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"local-name-from-QName(QName(\\\"http://www.example.com/example\\\", \\\"person\\\"))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLower-case", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('sarcastic');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"lower-case('SaRcAsTiC')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMatches", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('true');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"matches(/l:library/l:readerList/p:person[2]/p:name,'Adam')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMax", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('6');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"max((2,3,4,5,6,1))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"min((2,3,4,5,6,1))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMinutes-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql((new Date().getMinutes()).toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"minutes-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMinutes-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('0');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"minutes-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMinutes-from-time", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('23');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"minutes-from-time(xs:time('11:23:00'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMonth-from-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('3');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"month-from-date(xs:date('2023-03-16'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMonth-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql((new Date().getMonth()+1).toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"month-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonMonths-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('0');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"months-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('l:library');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/name()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNamespace-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/library\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/namespace-uri()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNamespace-uri-for-prefix", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.w3.org/XML/1998/namespace\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri-for-prefix('xml', element())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNamespace-uri-from-QName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.w3.org/XML/1998/namespace\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri-for-prefix('xml', element())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNilled", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"false\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"nilled(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNode-name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"l:library\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"node-name(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNormalize-space", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"aaaa aaa a aaa\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"normalize-space(' aaaa aaa a aaa ')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNormalize-unicode", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"aaaa aaa a aaa\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"normalize-unicode(' aaaa aaa a aaa ','NFKC')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNot", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"false\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"not(1)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNumber", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1.11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"number(1.11)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonOne-or-more", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\" \\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 5123\\n Lauren\\n Wong\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"one-or-more(/l:library/l:readerList/p:person)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonOutermost", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\" \\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 7321\\n Adam\\n Choke\\n\\n\\n 5123\\n Lauren\\n Wong\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"outermost(/l:library/l:readerList/p:person)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonParse-ietf-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1994-06-06T07:29:35Z\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"parse-ietf-date('Wed, 06 Jun 1994 07:29:35 GMT')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonParse-json", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"map{\\\"data\\\":\\\"09:30:10.5\\\"}\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"parse-json('{\\\"data\\\": \\\"09:30:10.5\\\"}')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonParse-xml", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"09:30:10.5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"parse-xml('09:30:10.5')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonParse-xml-fragment", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"09:30:10.5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"parse-xml-fragment('09:30:10.5')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonPath", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"/Q{http://www.release11.com/library}library[1]/Q{http://www.release11.com/library}readerList[1]/Q{http://www.release11.com/person}person[2]\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"path(/l:library/l:readerList/p:person[2])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonPosition", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n2\\n3\\n4\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person/position()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonPrefix-from-QName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"p\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"prefix-from-QName(QName('http://www.example.com/example', 'p:person'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonQName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"p:person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"QName('http://www.example.com/example', 'p:person')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonRandom-number-generator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"p:person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"QName('http://www.example.com/example', 'p:person')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonRemove", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n3\\n4\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"remove(('1','2','3','4'),2)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonReplace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"ACC\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"replace('ABC', 'B', 'C')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonResolve-QName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"hell\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"resolve-QName('hell', /l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonResolve-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"p:person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"resolve-uri('p:person')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonReverse", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"4\\n3\\n2\\n1\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"reverse(('1','2','3','4'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonRoot", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"\\n City library\\n 345123\\n \\n \\n \\n 7321\\n Adam\\n Choke\\n \\n \\n 7321\\n Adam\\n Choke\\n \\n \\n 5123\\n Lauren\\n Wong\\n \\n \\n \\n \\n 6422\\n Harry Potter\\n 7542\\n \\n \\n 1234\\n Macbeth\\n 5123\\n \\n \\n 9556\\n Romeo and Juliet\\n \\n \\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"root(//p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonRound", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"round(5.49)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonRound-half-to-even", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"5.5\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"round-half-to-even(5.49,1)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSeconds-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result.slice(0, 2)).to.eql((new Date().getSeconds()).toString() || (new Date().getSeconds()-1).toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"seconds-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSeconds-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('0');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"seconds-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSeconds-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('0');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"seconds-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSerialize", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1 2 3 4');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"serialize((1,2,3,4))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSort", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1\\n-2\\n5\\n8\\n10\\n-10\\n10');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"sort((1, -2, 5, 10, -10, 10, 8), (), abs#1)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonStarts-with", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('true');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"starts-with('ABC','A')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonStatic-base-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/static-base-uri()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonString", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('Adam');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string(/l:library/l:readerList/p:person[2]/p:name)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonString-join", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1A2A3');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-join((1,2,3),'A')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonString-length", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-length('A')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonString-to-codepoints", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('65');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-to-codepoints('A')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubsequence", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('2\\n3');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"subsequence((1,2,3,4),2,2)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('BC');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring('ABCDEF',2,2)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring-after", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('BCDEF');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-after ('ACBCDEF','C')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring-before", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('A');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-before ('ACBCDEF','C')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonSum", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('6');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"sum((1,2,3))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTail", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('2\\n3');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"tail((1,2,3))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTimezone-from-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('PT0S');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"timezone-from-date(current-date())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTimezone-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('PT0S');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"timezone-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTimezone-from-time", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('PT0S');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"timezone-from-time(current-time())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTokenize", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('B\\nCB\\nB\\nD');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"tokenize('BACBABAD','A')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTrace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('Adam\\nAdam\\nLauren');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"trace(//p:name[1])\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTranslate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('BAr');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"translate('bar','abc','ABC')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonTrue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('true');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"true()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUnordered", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('4\\n3\\n2\\n4\\n5');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"unordered((4, 3, 2, 4, 5))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUnparsed-text", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('.dockerenv\\napp\\nbin\\nboot\\ndev\\netc\\nhome\\nlib\\nlib64\\nmedia\\nmnt\\nopt\\nproc\\nroot\\nrun\\nsbin\\nsrv\\nsys\\ntmp\\nusr\\nvar');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"unparsed-text('')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUnparsed-text-available", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('true');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"unparsed-text-available('')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUnparsed-text-lines", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('.dockerenv\\napp\\nbin\\nboot\\ndev\\netc\\nhome\\nlib\\nlib64\\nmedia\\nmnt\\nopt\\nproc\\nroot\\nrun\\nsbin\\nsrv\\nsys\\ntmp\\nusr\\nvar');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"unparsed-text-lines ('')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUpper-case", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('AAA');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"upper-case('aaa')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonUri-collection", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('AAA');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"upper-case('aaa')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonXml-to-json", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('[1,\\\"is\\\",true]');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"1is1\",\n \"process\": \"xml-to-json(/)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonYear-from-date", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(new Date().getFullYear().toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"1is1\",\n \"process\": \"year-from-date(current-date())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonYear-from-dateTime", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(new Date().getFullYear().toString());", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"1is1\",\n \"process\": \"year-from-dateTime(current-dateTime())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonYears-from-duration", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('0');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"1is1\",\n \"process\": \"years-from-duration(xs:dayTimeDuration('P3DT10H'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonZero-or-one", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql('1');", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 3.1 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"1is1\",\n \"process\": \"zero-or-one((1))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Xpath functions 1.0", + "item": [ + { + "name": "LIBXMLString", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"string(11)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLConcat", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"AdamChoke\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"concat(/l:library/l:readerList/p:person[1]/p:name,/l:library/l:readerList/p:person[1]/p:surname)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LlibXMLBasic", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Test1\\n\\nTest3\\n\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"/values/value\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLLast", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Lauren \\n\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person[last()]/p:name\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLPosition", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\" 5123 Lauren Wong \\n\\n\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person[position()=2]\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLCount", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"count(/l:library/l:readerList/p:person)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLLocalName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"local-name(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLNamespace-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "LIMXMLContains", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"True\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"contains(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLStarts-with", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"True\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"starts-with(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIMXMLSubstring-before", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1999\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-before(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLSubstring-after", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"04/01\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-after(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLSubstring", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"234\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring(\\\"12345\\\", 1.5, 2.6)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLString-length", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"4.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-length(\\\"Adam\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLNormalize-space", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"A d am\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"normalize-space (\\\" A d am \\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLTranslate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"BAr\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"translate(\\\"bar\\\",\\\"abc\\\",\\\"ABC\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanBasic", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Test1\\nTest3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"/values/value\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "XalanString", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"string(11)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "XalanLast", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Lauren\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person[last()]/p:name\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "XalanPosition", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\" 5123 Lauren Wong \");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person[position()=2]\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "XalanCount", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"count(/l:library/l:readerList/p:person)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "XalanLocalName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"local-name(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "XalanNamespace-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "XalanName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "XalanConcat", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"AdamChoke\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"concat(/l:library/l:readerList/p:person[1]/p:name,/l:library/l:readerList/p:person[1]/p:surname)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanStarts-with", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"starts-with(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanContains", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"contains(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanSubstring-before", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1999\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-before(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanSubstring-after", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"04/01\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-after(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanSubstring", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"234\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring(\\\"12345\\\", 1.5, 2.6)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanString-length", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"4\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-length(\\\"Adam\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanNormalize-space", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"A d am\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"normalize-space (\\\" A d am \\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanTranslate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"BAr\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"translate(\\\"bar\\\",\\\"abc\\\",\\\"ABC\\\")\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonBasic", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Test1\\nTest3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"/values/value\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonString", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"string(11)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLast", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"Lauren\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person[last()]/p:name\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonPosition", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\\n2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/p:person/position()\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonCount", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/count(p:person)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonLocalName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"local-name(/l:library/l:readerList/p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonNamespace-uri", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"http://www.release11.com/person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/namespace-uri(p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ] + } + }, + "response": [] + }, + { + "name": "SaxonName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"p:person\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"/l:library/l:readerList/name(p:person[1])\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonConcat", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"AdamChoke\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"concat(/l:library/l:readerList/p:person[1]/p:name,/l:library/l:readerList/p:person[1]/p:surname)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonStarts-with", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"starts-with(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonContains", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"true\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"contains(/l:library/l:readerList/p:person[1]/p:name, 'A')\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring-before", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1999\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-before(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring-after", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"04/01\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring-after(\\\"1999/04/01\\\",\\\"/\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonSubstring", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"234\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"substring(\\\"12345\\\", 1.5, 2.6)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonString-length", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"4\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"string-length(\\\"Adam\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonNormalize-space", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"A d am\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"normalize-space (\\\" A d am \\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonTranslate", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"BAr\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"translate(\\\"bar\\\",\\\"abc\\\",\\\"ABC\\\")\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLNumber", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"number(11)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLSum", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"12444.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"sum(/l:library/l:readerList/p:person/p:readerID)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLFloor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"floor(1.1)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLCeiling", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"ceiling(1.1)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "LIBXMLRound", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"3.0\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"libxml2 over lxml\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"round(3.14)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8082/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8082", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanNumber", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"number(11)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanSum", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"12444\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"sum(/l:library/l:readerList/p:person/p:readerID)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanFloor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"floor(1.1)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanCeiling", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"ceiling(1.1)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "XalanRound", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Xalan Java 2.7.2\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"round(3.14)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonNumber", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"11\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"number(11)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonSum", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"12444\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"sum(/l:library/l:readerList/p:person/p:readerID)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonFloor", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"1\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"floor(1.1)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonCeiling", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"2\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"ceiling(1.1)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "SaxonRound", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Works correctly\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.result).to.eql(\"3\");", + "});", + "pm.test(\"correct engine\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData.processor).to.eql(\"Saxon 11.4 2.0 over s9api\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"round(3.14)\",\n \"processor\": \"saxon\",\n \"version\": \"2.0\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://tools.zipper.release11.com:8081/xpath", + "protocol": "http", + "host": [ + "tools", + "zipper", + "release11", + "com" + ], + "port": "8081", + "path": [ + "xpath" + ], + "query": [ + { + "key": "", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + } + ] + } + ] +} \ No newline at end of file From e697a783ae3551ef99834225a1b5d6ea4d320b34 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 18 May 2023 13:36:51 +0200 Subject: [PATCH 40/59] Solved #195 and cleaned up code (#196) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/196 Reviewed-by: Dariusz Augustyniak --- .../java/com/r11/tools/SparkApplication.java | 2 +- .../r11/tools/controller/XPathController.java | 130 +++++++++--------- .../r11/tools/controller/XsdController.java | 4 +- .../r11/tools/controller/XsltController.java | 115 +++++++++------- .../main/java/com/r11/tools/xml/Xalan.java | 2 +- 5 files changed, 133 insertions(+), 120 deletions(-) diff --git a/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java b/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java index e1c0c96..58149be 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/SparkApplication.java @@ -44,7 +44,7 @@ public class SparkApplication { RestControllerRegistry registry = new RestControllerRegistry(); registry.registerController(new ProcessorInfoController(logger, saxon, xalan)); - registry.registerController(new XsdController(gson, logger, saxon, xalan)); + registry.registerController(new XsdController(gson, logger, xalan)); registry.registerController(new XPathController(gson, logger, saxon, xalan)); registry.registerController(new XsltController(gson, logger, saxon, xalan)); registry.registerController(new JsonController(gson, jsongson, logger)); diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java index 822a113..a188566 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/XPathController.java @@ -3,8 +3,6 @@ package com.r11.tools.controller; import com.google.gson.Gson; import com.google.gson.JsonObject; import com.r11.tools.controller.internal.*; -import com.r11.tools.xml.Saxon; -import com.r11.tools.xml.Xalan; import com.r11.tools.xml.XmlEngine; import org.apache.logging.log4j.Logger; import spark.Request; @@ -50,10 +48,6 @@ public class XPathController implements RestController { String processor = requestJson.get("processor").getAsString(); String version = requestJson.get("version").getAsString(); - String tmp = ""; - long timeStart; - long duration; - if (processor == null) { response.body("saxon, xalan"); return; @@ -62,65 +56,77 @@ public class XPathController implements RestController { JsonObject responseJson = new JsonObject(); switch (processor) { case "saxon": - response.header("processor", "Saxon " + saxon.getVersion() + " " + version + " over s9api"); - timeStart = System.currentTimeMillis(); - - try { - tmp = saxon.processXPath(data, query, version).getData().trim(); - - response.status(200); - - responseJson.addProperty("result", tmp); - responseJson.addProperty("status", "OK"); - } catch (Exception ex) { - this.logger.error("Error on processing XPath using Saxon. " + ex); - - response.status(400); - - responseJson.addProperty("result", ex.getMessage()); - responseJson.addProperty("status", "ERR"); - } - - duration = System.currentTimeMillis() - timeStart; - this.logger.info("Request (XPath, Saxon) processed in " + duration + " ms."); - - responseJson.addProperty("processor", "Saxon " + saxon.getVersion() + " " + version + " over s9api"); - responseJson.addProperty("time", duration); - - response.body(this.gson.toJson(responseJson)); - return; - + processWithSaxon(response, data, query, version, responseJson); + break; case "xalan": - response.header("processor", xalan.getVersion()); - timeStart = System.currentTimeMillis(); - - try { - XPathQueryResult xPathQueryResult = xalan.processXPath(data, query, ""); - - response.status(200); - - responseJson.addProperty("result", xPathQueryResult.getData().trim()); - responseJson.addProperty("status", "OK"); - responseJson.addProperty("type", xPathQueryResult.getType()); - } catch (Exception ex) { - this.logger.error("Error on processing XPath using Xalan. " + ex); - - response.status(400); - - responseJson.addProperty("result", ex.getMessage()); - responseJson.addProperty("status", "ERR"); - } - - duration = System.currentTimeMillis() - timeStart; - this.logger.info("Request (XPath, Xalan) processed in " + duration + " ms."); - - responseJson.addProperty("processor", xalan.getVersion()); - responseJson.addProperty("time", duration); - - response.body(this.gson.toJson(responseJson)); - return; + processWithXalan(response, data, query, responseJson); + break; default: response.body("saxon, xalan"); } } + + private void processWithXalan(Response response, String data, String query, JsonObject responseJson) { + long timeStart; + long duration; + response.header("processor", xalan.getVersion()); + timeStart = System.currentTimeMillis(); + + try { + XPathQueryResult xPathQueryResult = xalan.processXPath(data, query, ""); + + response.status(200); + + responseJson.addProperty("result", xPathQueryResult.getData().trim()); + responseJson.addProperty("status", "OK"); + responseJson.addProperty("type", xPathQueryResult.getType()); + } catch (Exception ex) { + this.logger.error("Error on processing XPath using Xalan. " + ex); + + response.status(400); + + responseJson.addProperty("result", ex.getMessage()); + responseJson.addProperty("status", "ERR"); + } + + duration = System.currentTimeMillis() - timeStart; + this.logger.info("Request (XPath, Xalan) processed in " + duration + " ms."); + + responseJson.addProperty("processor", xalan.getVersion()); + responseJson.addProperty("time", duration); + + response.body(this.gson.toJson(responseJson)); + } + + private void processWithSaxon(Response response, String data, String query, String version, JsonObject responseJson) { + long timeStart; + String tmp; + long duration; + response.header("processor", "Saxon " + saxon.getVersion() + " " + version + " over s9api"); + timeStart = System.currentTimeMillis(); + + try { + tmp = saxon.processXPath(data, query, version).getData().trim(); + + response.status(200); + + responseJson.addProperty("result", tmp); + responseJson.addProperty("status", "OK"); + } catch (Exception ex) { + this.logger.error("Error on processing XPath using Saxon. " + ex); + + response.status(400); + + responseJson.addProperty("result", ex.getMessage()); + responseJson.addProperty("status", "ERR"); + } + + duration = System.currentTimeMillis() - timeStart; + this.logger.info("Request (XPath, Saxon) processed in " + duration + " ms."); + + responseJson.addProperty("processor", "Saxon " + saxon.getVersion() + " " + version + " over s9api"); + responseJson.addProperty("time", duration); + + response.body(this.gson.toJson(responseJson)); + } } diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java index 68ecc15..3a04ce6 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsdController.java @@ -18,13 +18,11 @@ public class XsdController implements RestController { private final Gson gson; private final Logger logger; - private final XmlEngine saxon; private final XmlEngine xalan; - public XsdController(Gson gson, Logger logger, XmlEngine saxon, XmlEngine xalan) { + public XsdController(Gson gson, Logger logger, XmlEngine xalan) { this.gson = gson; this.logger = logger; - this.saxon = saxon; this.xalan = xalan; } diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java index 966ea47..29e0fd6 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/XsltController.java @@ -57,69 +57,78 @@ public class XsltController implements RestController { response.body("saxon, xalan"); return; } - - String tmp; - long timeStart; - long duration; - JsonObject responseJson = new JsonObject(); switch (processor) { case "saxon": - timeStart = System.currentTimeMillis(); - try { - tmp = saxon.processXSLT(data, query); - - response.status(200); - - responseJson.addProperty("result", tmp); - responseJson.addProperty("status", "OK"); - } catch (Exception ex) { - this.logger.error("Error on processing XSLT using Saxon. " + ex); - - response.status(400); - - responseJson.addProperty("result", ex.getMessage()); - responseJson.addProperty("status", "ERR"); - } - - duration = System.currentTimeMillis() - timeStart; - this.logger.info("Request (XSLT, Saxon) processed in " + duration + " ms."); - - responseJson.addProperty("processor", "Saxon " + saxon.getVersion() + " " + version); - responseJson.addProperty("time", duration); - - response.body(this.gson.toJson(responseJson)); + processWithSaxon(response, data, query, version, responseJson); return; case "xalan": - timeStart = System.currentTimeMillis(); - try { - tmp = xalan.processXSLT(data, query); - - response.status(200); - - responseJson.addProperty("result", tmp); - responseJson.addProperty("status", "OK"); - } catch (Exception ex) { - this.logger.error("Error on processing XSLT using Xalan. " + ex); - - response.status(400); - - responseJson.addProperty("result", ex.getMessage()); - responseJson.addProperty("status", "ERR"); - } - - duration = System.currentTimeMillis() - timeStart; - this.logger.info("Request (XSLT, Xalan) processed in " + duration + " ms."); - - responseJson.addProperty("processor", xalan.getVersion()); - responseJson.addProperty("time", duration); - - response.body(this.gson.toJson(responseJson)); + processWithXalan(response, data, query, responseJson); return; default: response.body("saxon, xalan"); } } + + private void processWithXalan(Response response, String data, String query, JsonObject responseJson) { + long duration; + long timeStart; + String tmp; + timeStart = System.currentTimeMillis(); + try { + tmp = xalan.processXSLT(data, query); + + response.status(200); + + responseJson.addProperty("result", tmp); + responseJson.addProperty("status", "OK"); + } catch (Exception ex) { + this.logger.error("Error on processing XSLT using Xalan. " + ex); + + response.status(400); + + responseJson.addProperty("result", ex.getMessage()); + responseJson.addProperty("status", "ERR"); + } + + duration = System.currentTimeMillis() - timeStart; + this.logger.info("Request (XSLT, Xalan) processed in " + duration + " ms."); + + responseJson.addProperty("processor", xalan.getVersion()); + responseJson.addProperty("time", duration); + + response.body(this.gson.toJson(responseJson)); + } + + private void processWithSaxon(Response response, String data, String query, String version, JsonObject responseJson) { + long duration; + String tmp; + long timeStart; + timeStart = System.currentTimeMillis(); + try { + tmp = saxon.processXSLT(data, query); + + response.status(200); + + responseJson.addProperty("result", tmp); + responseJson.addProperty("status", "OK"); + } catch (Exception ex) { + this.logger.error("Error on processing XSLT using Saxon. " + ex); + + response.status(400); + + responseJson.addProperty("result", ex.getMessage()); + responseJson.addProperty("status", "ERR"); + } + + duration = System.currentTimeMillis() - timeStart; + this.logger.info("Request (XSLT, Saxon) processed in " + duration + " ms."); + + responseJson.addProperty("processor", "Saxon " + saxon.getVersion() + " " + version); + responseJson.addProperty("time", duration); + + response.body(this.gson.toJson(responseJson)); + } } diff --git a/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java b/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java index d9cf805..51ad04f 100644 --- a/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java +++ b/Backend/tools-services/src/main/java/com/r11/tools/xml/Xalan.java @@ -103,7 +103,7 @@ public class Xalan implements XmlEngine{ return new XPathQueryResult(resultString.toString(), "node"); } catch (TransformerException e) { String returnData = XPathAPI.eval(doc, transform).toString(); - return new XPathQueryResult(data, "string"); + return new XPathQueryResult(returnData, "string"); } } From 369256baf24e4532bc578351eb104e7335bb63a5 Mon Sep 17 00:00:00 2001 From: Dariusz Augustyniak Date: Thu, 18 May 2023 13:38:38 +0200 Subject: [PATCH 41/59] tests with variable URL (#200) Co-authored-by: augustyd Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/200 Reviewed-by: Adam Bem Co-authored-by: Dariusz Augustyniak Co-committed-by: Dariusz Augustyniak --- ...elease Tools Tests.postman_collection.json | 2570 +++-------------- 1 file changed, 461 insertions(+), 2109 deletions(-) diff --git a/Tests/Release Tools Tests.postman_collection.json b/Tests/Release Tools Tests.postman_collection.json index f979a93..c24b80c 100644 --- a/Tests/Release Tools Tests.postman_collection.json +++ b/Tests/Release Tools Tests.postman_collection.json @@ -44,17 +44,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -96,17 +88,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -200,17 +184,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -252,17 +228,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -304,17 +272,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -356,17 +316,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -408,17 +360,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -460,17 +404,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -512,17 +448,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -564,17 +492,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -616,17 +536,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -668,17 +580,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -720,17 +624,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -772,17 +668,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -824,17 +712,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -876,17 +756,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -928,17 +800,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -980,17 +844,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1032,17 +888,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1084,17 +932,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1136,17 +976,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1188,17 +1020,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1240,17 +1064,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1292,17 +1108,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1344,17 +1152,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1407,17 +1207,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -1458,7 +1250,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"document-uri()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"document-uri(/*)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", "options": { "raw": { "language": "json" @@ -1466,17 +1258,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1518,17 +1302,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1570,17 +1346,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1622,17 +1390,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1674,17 +1434,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1726,17 +1478,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1778,17 +1522,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1830,17 +1566,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1882,17 +1610,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1934,17 +1654,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -1986,17 +1698,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2038,17 +1742,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2090,17 +1786,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2142,17 +1830,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2194,17 +1874,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2246,17 +1918,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2314,17 +1978,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2382,17 +2038,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2434,17 +2082,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2486,17 +2126,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2538,17 +2170,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2590,17 +2214,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2642,17 +2258,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2694,17 +2302,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2746,17 +2346,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2798,17 +2390,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2850,17 +2434,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2902,17 +2478,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -2954,17 +2522,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3006,17 +2566,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3058,17 +2610,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3110,17 +2654,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3162,17 +2698,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3214,17 +2742,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3266,17 +2786,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3318,17 +2830,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3370,17 +2874,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3422,17 +2918,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3474,17 +2962,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3526,17 +3006,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3578,17 +3050,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3630,17 +3094,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3682,17 +3138,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3734,17 +3182,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3786,17 +3226,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3838,17 +3270,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3890,17 +3314,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3942,17 +3358,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -3994,17 +3402,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4046,17 +3446,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4098,17 +3490,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4150,17 +3534,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4202,17 +3578,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4254,17 +3622,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4306,17 +3666,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4358,17 +3710,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4410,17 +3754,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4438,7 +3774,7 @@ "});", "pm.test(\"Works correctly\", function () {", " var jsonData = pm.response.json();", - " pm.expect(jsonData.result).to.eql(\"http://www.w3.org/XML/1998/namespace\");", + " pm.expect(jsonData.result).to.eql(\"http://www.example.com/example\");", "});", "pm.test(\"correct engine\", function () {", " var jsonData = pm.response.json();", @@ -4454,7 +3790,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri-for-prefix('xml', element())\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"namespace-uri-from-QName(QName('http://www.example.com/example', 'person'))\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", "options": { "raw": { "language": "json" @@ -4462,17 +3798,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4514,17 +3842,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4566,17 +3886,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4618,17 +3930,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4670,17 +3974,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4722,17 +4018,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4774,17 +4062,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4826,17 +4106,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4878,17 +4150,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4930,17 +4194,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -4982,17 +4238,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5034,17 +4282,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5086,17 +4326,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5138,17 +4370,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5190,17 +4414,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5242,17 +4458,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5294,17 +4502,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5322,7 +4522,7 @@ "});", "pm.test(\"Works correctly\", function () {", " var jsonData = pm.response.json();", - " pm.expect(jsonData.result).to.eql(\"p:person\");", + " pm.expect(jsonData.result.slice(0, 24)).to.eql(\"map{\\\"next\\\":Q{anon}anon#0\");", "});", "pm.test(\"correct engine\", function () {", " var jsonData = pm.response.json();", @@ -5338,7 +4538,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"QName('http://www.example.com/example', 'p:person')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"random-number-generator()\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", "options": { "raw": { "language": "json" @@ -5346,17 +4546,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5398,17 +4590,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5450,17 +4634,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5502,17 +4678,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5554,17 +4722,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5606,17 +4766,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5658,17 +4810,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5710,17 +4854,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5762,17 +4898,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5814,17 +4942,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5866,17 +4986,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5918,17 +5030,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -5970,17 +5074,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6022,17 +5118,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6074,17 +5162,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6126,17 +5206,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6178,17 +5250,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6230,17 +5294,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6282,17 +5338,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6334,17 +5382,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6386,17 +5426,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6438,17 +5470,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6490,17 +5514,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6542,17 +5558,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6594,17 +5602,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6646,17 +5646,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6698,17 +5690,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6750,17 +5734,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6802,17 +5778,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6854,17 +5822,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6906,17 +5866,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -6958,17 +5910,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7010,17 +5954,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7062,17 +5998,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7114,17 +6042,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7166,17 +6086,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7218,17 +6130,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7270,17 +6174,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7294,11 +6190,11 @@ "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + " pm.response.to.have.status(400);", "});", "pm.test(\"Works correctly\", function () {", " var jsonData = pm.response.json();", - " pm.expect(jsonData.result).to.eql('AAA');", + " pm.expect(jsonData.result).to.eql('Invalid URI passed to uri-collection: City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet ');", "});", "pm.test(\"correct engine\", function () {", " var jsonData = pm.response.json();", @@ -7314,7 +6210,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"upper-case('aaa')\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", + "raw": "{\n \"data\": \" City library 345123 7321 Adam Choke 7321 Adam Choke 5123 Lauren Wong 6422 Harry Potter 7542 1234 Macbeth 5123 9556 Romeo and Juliet \",\n \"process\": \"uri-collection(/l:library)\",\n \"processor\": \"saxon\",\n \"version\": \"3.1\"\n}", "options": { "raw": { "language": "json" @@ -7322,17 +6218,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7374,17 +6262,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7426,17 +6306,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7478,17 +6350,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7530,17 +6394,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7582,17 +6438,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -7639,17 +6487,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ] } }, @@ -7691,17 +6531,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -7750,17 +6582,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ] } }, @@ -7802,17 +6626,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ] } }, @@ -7854,17 +6670,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ] } }, @@ -7906,17 +6714,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ] } }, @@ -7958,17 +6758,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ] } }, @@ -8010,17 +6802,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ] } }, @@ -8062,17 +6846,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -8121,17 +6897,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ] } }, @@ -8173,17 +6941,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -8232,17 +6992,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -8291,17 +7043,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -8350,17 +7094,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -8409,17 +7145,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -8468,17 +7196,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -8527,17 +7247,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -8586,17 +7298,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -8630,7 +7334,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"string(11)\",\n \"processor\": \"xalan\",\n \"version\": \"2.0\"\n}", + "raw": "{\n \"data\": \"Test1Test3\",\n \"process\": \"string('11')\",\n \"processor\": \"xalan\",\n \"version\": \"1.0\"\n}", "options": { "raw": { "language": "json" @@ -8638,17 +7342,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -8690,17 +7386,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -8742,17 +7430,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -8794,17 +7474,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -8846,17 +7518,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -8898,17 +7562,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -8950,17 +7606,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -9002,17 +7650,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -9061,17 +7701,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -9120,17 +7752,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -9179,17 +7803,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -9238,17 +7854,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -9297,17 +7905,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -9356,17 +7956,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -9415,17 +8007,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -9474,17 +8058,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -9533,17 +8109,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -9585,17 +8153,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -9637,17 +8197,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -9689,17 +8241,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -9741,17 +8285,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -9793,17 +8329,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -9845,17 +8373,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ] } }, @@ -9897,17 +8417,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -9956,17 +8468,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10015,17 +8519,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10074,17 +8570,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10133,17 +8621,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10192,17 +8672,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10251,17 +8723,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10310,17 +8774,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10369,17 +8825,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10428,17 +8876,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10487,17 +8927,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -10546,17 +8978,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -10605,17 +9029,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -10664,17 +9080,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -10723,17 +9131,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8082/xpath", - "protocol": "http", + "raw": "{{TestURL2}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8082", - "path": [ - "xpath" + "{{TestURL2}}" ], "query": [ { @@ -10782,17 +9182,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10841,17 +9233,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10900,17 +9284,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -10959,17 +9335,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -11018,17 +9386,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -11077,17 +9437,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -11136,17 +9488,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -11195,17 +9539,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -11254,17 +9590,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -11313,17 +9641,9 @@ } }, "url": { - "raw": "http://tools.zipper.release11.com:8081/xpath", - "protocol": "http", + "raw": "{{TestURL1}}", "host": [ - "tools", - "zipper", - "release11", - "com" - ], - "port": "8081", - "path": [ - "xpath" + "{{TestURL1}}" ], "query": [ { @@ -11338,5 +9658,37 @@ } ] } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "TestURL1", + "value": "http://tools.zipper.release11.com:8081/xpath", + "type": "default" + }, + { + "key": "TestURL2", + "value": "http://tools.zipper.release11.com:8082/xpath", + "type": "default" + } ] } \ No newline at end of file From d231a7476bfa290e6d4cea141b4d7771ffbde0a6 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Fri, 19 May 2023 13:09:01 +0200 Subject: [PATCH 42/59] Fixed timezone (#193) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/193 Reviewed-by: Mikolaj Widla --- Frontend/Dockerfile | 3 +++ docker-compose.yml | 22 ++++------------------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Frontend/Dockerfile b/Frontend/Dockerfile index 58fdcd5..4e9751f 100644 --- a/Frontend/Dockerfile +++ b/Frontend/Dockerfile @@ -1,5 +1,8 @@ FROM nginx:stable-alpine +RUN apk add --no-cache tzdata +ENV TZ Europe/Warsaw + COPY ./tools/ /usr/share/nginx/html/tools/ COPY ./lawful/ /usr/share/nginx/html/lawful/ COPY ./assets/ /usr/share/nginx/html/assets/ diff --git a/docker-compose.yml b/docker-compose.yml index c317aaf..c9e1120 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,36 +4,27 @@ services: redis: image: 'redis' restart: "no" - volumes: - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro xmltools-frontend: build: ./Frontend container_name: xmltools-frontend image: xmltools-frontend ports: - - 8086:80 - volumes: - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro + - 8086:80 xmltools-backend: build: ./Backend/tools-services container_name: xmltools-backend image: xmltools-backend ports: - - 8081:8081 + - 8081:8081 xmltools-libxml-backend: build: ./Backend-libXML container_name: xmltools-libxml-backend image: xmltools-libxml-backend ports: - - 8082:80 - volumes: - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro + - 8082:80 xmltools-mocked-services: build: @@ -47,9 +38,7 @@ services: - redis environment: SPRING_PROFILES_ACTIVE: DEV - volumes: - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro + TZ: Europe/Warsaw swagger: image: "swaggerapi/swagger-ui:latest" @@ -75,9 +64,6 @@ services: command: - "-e" - "--strict.perms=false" - volumes: - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro networks: default: From d5e33381a23cfc2b9fb6dd004bb8b7171e216dd8 Mon Sep 17 00:00:00 2001 From: Mikolaj Widla Date: Fri, 19 May 2023 13:10:45 +0200 Subject: [PATCH 43/59] Refactor of History module (#184) Co-authored-by: widlam Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/184 Reviewed-by: Adam Bem Co-authored-by: Mikolaj Widla Co-committed-by: Mikolaj Widla --- Backend/mocked-services/pom.xml | 25 +- .../com/r11/tools/config/RedisConfig.java | 68 ----- .../configuration/RetentionConfiguration.java | 64 +++++ .../RetentionConfigurationProperties.java | 31 +++ .../r11/tools/configuration/WebConfig.java | 28 +++ .../r11/tools/controller/EventController.java | 56 ----- .../r11/tools/controller/MockController.java | 23 +- .../tools/controller/MvcExceptionHandler.java | 2 + .../controller/RequestHistoryController.java | 71 ++++++ .../IncomingMockRequestInterceptor.java | 79 ++++++ .../tools/mappers/MockedMessageMapper.java | 1 + .../tools/mappers/RequestHistoryMapper.java | 24 ++ .../main/java/com/r11/tools/model/Event.java | 36 --- ...questDto.java => HistoryRequestModel.java} | 12 +- .../com/r11/tools/model/MockedMessage.java | 2 + .../com/r11/tools/model/RequestHistory.java | 45 ++++ .../r11/tools/model/RequestHistoryDTO.java | 33 +++ .../r11/tools/repository/EventRepository.java | 20 -- .../tools/repository/EventRepositoryImpl.java | 99 -------- .../repository/RequestHistoryRepository.java | 20 ++ .../com/r11/tools/service/EtrackService.java | 20 -- .../r11/tools/service/EtrackServiceImpl.java | 44 ---- .../r11/tools/service/KlausServiceImpl.java | 3 +- .../tools/service/RequestHistoryService.java | 23 ++ .../service/RequestHistoryServiceImpl.java | 58 +++++ .../com/r11/tools/utilis/BusinessKey.java | 24 -- .../com/r11/tools/utilis/RedisAppender.java | 235 ------------------ .../com/r11/tools/utilis/TrackingClient.java | 24 -- .../src/main/resources/application.properties | 9 + .../src/main/resources/data-access.properties | 2 - .../src/main/resources/logback.xml | 18 -- Frontend/assets/css/tools/mock/common.css | 2 + Frontend/assets/css/tools/mock/r11addons.css | 25 +- Frontend/assets/css/tools/mock/r11popup.css | 83 +++++++ Frontend/assets/css/tools/mock/r11tables.css | 25 ++ .../assets/scripts/tools/mock/datatransfer.js | 2 +- .../scripts/tools/mock/historyloader.js | 27 +- Frontend/assets/scripts/tools/mock/popup.js | 34 +++ .../assets/scripts/tools/mock/uianimation.js | 110 +++++++- Frontend/tools/mock.html | 41 ++- 40 files changed, 855 insertions(+), 693 deletions(-) delete mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/config/RedisConfig.java create mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfiguration.java create mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfigurationProperties.java create mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/configuration/WebConfig.java delete mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/controller/EventController.java create mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java create mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/interceptor/IncomingMockRequestInterceptor.java create mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/mappers/RequestHistoryMapper.java delete mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/model/Event.java rename Backend/mocked-services/src/main/java/com/r11/tools/model/{EventRequestDto.java => HistoryRequestModel.java} (79%) create mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java create mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistoryDTO.java delete mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepository.java delete mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepositoryImpl.java create mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/repository/RequestHistoryRepository.java delete mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackService.java delete mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackServiceImpl.java create mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryService.java create mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java delete mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/utilis/BusinessKey.java delete mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/utilis/RedisAppender.java delete mode 100644 Backend/mocked-services/src/main/java/com/r11/tools/utilis/TrackingClient.java delete mode 100644 Backend/mocked-services/src/main/resources/data-access.properties create mode 100644 Frontend/assets/css/tools/mock/r11popup.css create mode 100644 Frontend/assets/scripts/tools/mock/popup.js diff --git a/Backend/mocked-services/pom.xml b/Backend/mocked-services/pom.xml index 0a6ceb7..96e6d0e 100644 --- a/Backend/mocked-services/pom.xml +++ b/Backend/mocked-services/pom.xml @@ -7,7 +7,7 @@ org.springframework.boot spring-boot-starter-parent - 2.3.1.RELEASE + 2.7.11 @@ -18,9 +18,10 @@ 3.3.0 1.1.6 3.16.1 - 1.3.1.Final + 1.5.5.Final Release11 ${project.artifactId} + 1.18.26 @@ -57,21 +58,6 @@ org.springframework.boot spring-boot-starter-data-redis - - com.cwbase - logback-redis-appender - ${logback-redis-appender.version} - - - redis.clients - jedis - ${jedis.version} - - - org.codehaus.jettison - jettison - 1.4.1 - @@ -101,6 +87,11 @@ lombok ${lombok.version} + + org.projectlombok + lombok-mapstruct-binding + 0.2.0 + -Amapstruct.defaultComponentModel=spring diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/config/RedisConfig.java b/Backend/mocked-services/src/main/java/com/r11/tools/config/RedisConfig.java deleted file mode 100644 index c3438d2..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/config/RedisConfig.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.r11.tools.config; - -import java.util.Objects; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.core.env.Environment; -import org.springframework.data.redis.connection.RedisStandaloneConfiguration; -import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.repository.configuration.EnableRedisRepositories; -import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; -import redis.clients.jedis.JedisPool; - -/** - * Class containing configuration for Redis db client - * @author Rafał Żukowicz - */ -@Configuration -@EnableRedisRepositories -@PropertySource("classpath:data-access.properties") -public class RedisConfig { - - @Autowired - private Environment environment; - - /** - * Bean of JedisPool - the Redis client. It stores requests in "the pool" and then fires them at Redis. - * It's considered super lightweight and fast client variant - * @return lightweight client of the Redis - the JedisPool - */ - @Bean - JedisPool jedisPool(){ - final JedisPool pool = new JedisPool(environment.getProperty("redis.host"), - Integer.parseInt(environment.getProperty("redis.port"))); - return pool; - } - - /** - * Bean of a factory for connenction object. - * It's initialized with Redis db url property and is fed to other methods. - * @return the factory for RedisTemplates - */ - @Bean - JedisConnectionFactory jedisConnectionFactory() { - RedisStandaloneConfiguration redisStandaloneConfiguration = - new RedisStandaloneConfiguration(Objects.requireNonNull(environment.getProperty("redis.host")), - Integer.parseInt(Objects.requireNonNull(environment.getProperty("redis.port")))); - return new JedisConnectionFactory(redisStandaloneConfiguration); - } - - /** - * RedisTemplate is the tool to store and retrieve given type (object) of hash from the database. - * It's like you could store your Java object by just naming it inside database. You might thing about it - * as of DAO. - * @return RedisTemplate the redis dao. - */ - @Bean - public RedisTemplate redisTemplate() { - RedisTemplate redisTemplate = new RedisTemplate<>(); - redisTemplate.setConnectionFactory(jedisConnectionFactory()); - redisTemplate.setExposeConnection(true); - redisTemplate.setDefaultSerializer(new GenericJackson2JsonRedisSerializer()); - return redisTemplate; - } - -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfiguration.java b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfiguration.java new file mode 100644 index 0000000..3923df0 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfiguration.java @@ -0,0 +1,64 @@ +package com.r11.tools.configuration; + +import com.r11.tools.repository.MockedResponseRepository; +import com.r11.tools.repository.RequestHistoryRepository; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; + +import java.time.LocalDateTime; + +/** + * Based on configuration deletes all outdated messages and history records from database. + * + * @author Mikołaj Widła + */ + +@EnableScheduling +@EnableAsync +@Configuration +public class RetentionConfiguration { + + private final MockedResponseRepository responseRepository; + private final RequestHistoryRepository historyRepository; + private final RetentionConfigurationProperties retentionProperties; + private final Logger log = LogManager.getRootLogger(); + + + public RetentionConfiguration(MockedResponseRepository responseRepository, + RequestHistoryRepository historyRepository, + RetentionConfigurationProperties retentionProperties){ + this.historyRepository = historyRepository; + this.responseRepository = responseRepository; + this.retentionProperties = retentionProperties; + } + @Scheduled(fixedDelayString = "#{${retention.retention-cooldown} * 60000 }") + @Async + public void deleteMessagesAndHistoryRecords(){ + log.info("OUTDATED MESSAGES AND HISTORY RECORDS DELETED!"); + responseRepository + .findAll() + .iterator() + .forEachRemaining( mockedMessage -> { + if (mockedMessage.getCreatedAt().plusMinutes(retentionProperties.getMinutesToDeleteMessage()).isBefore(LocalDateTime.now())){ + responseRepository.delete(mockedMessage); + } + } ); + + historyRepository + .findAll() + .iterator() + .forEachRemaining( + historyRecord -> { + if (historyRecord.getDateTimeStamp().plusMinutes(retentionProperties.getMinutesToDeleteHistoryRecord()).isBefore(LocalDateTime.now())){ + historyRepository.delete(historyRecord); + } + } + ); + } + +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfigurationProperties.java b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfigurationProperties.java new file mode 100644 index 0000000..00aac59 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/RetentionConfigurationProperties.java @@ -0,0 +1,31 @@ +package com.r11.tools.configuration; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import javax.validation.constraints.Positive; + +/** + * Store all properties needed to change a retention in {@link RetentionConfiguration} + * + * @author Mikołaj Widła + */ + +@Configuration +@ConfigurationProperties(prefix = "retention") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +public class RetentionConfigurationProperties { + @Positive + private Integer minutesToDeleteMessage; + @Positive + private Integer minutesToDeleteHistoryRecord; + @Positive + private Integer retentionCooldown; +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/configuration/WebConfig.java b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/WebConfig.java new file mode 100644 index 0000000..52cdc81 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/configuration/WebConfig.java @@ -0,0 +1,28 @@ +package com.r11.tools.configuration; + +import com.r11.tools.interceptor.IncomingMockRequestInterceptor; +import lombok.AllArgsConstructor; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * Configuration for {@link IncomingMockRequestInterceptor} + * + * @author Mikołaj Widła + */ + +@Configuration +@AllArgsConstructor +public class WebConfig implements WebMvcConfigurer{ + + private final IncomingMockRequestInterceptor requestInterceptor; + + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor( requestInterceptor ) + .addPathPatterns("/api/mock/r/**"); + } + +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/EventController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/EventController.java deleted file mode 100644 index 81ff153..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/EventController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.r11.tools.controller; - -import com.r11.tools.model.EventRequestDto; -import com.r11.tools.service.EtrackService; -import lombok.AllArgsConstructor; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; -import java.time.LocalDateTime; -import java.util.UUID; - -/** - * It's the REST api for {@link com.r11.tools.model.Event} - * @author Gabriel Modzelewski - */ -@RestController -@RequestMapping(path = "/api/event") -@AllArgsConstructor -public class EventController { - private final EtrackService service; - - /** - * Returns the list of Events in given time bracket. - * The list of objects is received via {@link EventRequestDto}, which contains time brackets, - * as well as the key - uuid. - * @param event EventRequestDto object that contains data needed to query the database - * @return list of {@link com.r11.tools.model.Event} - */ - @PostMapping - public ResponseEntity filterHistory(@RequestBody EventRequestDto event){ - return new ResponseEntity(service.getEventsByDateTimeAndBusinessKeys(event), HttpStatus.OK); - } - - /** - * Returns the list of Events of last 24h from given date. - * @param uuid unique id of message list - * @param messageId unique id of message in message list - * @return list of {@link com.r11.tools.model.Event} - */ - @GetMapping(path = "/{uuid}/{messageId}") - public ResponseEntity getLastDay(@PathVariable UUID uuid, - @PathVariable Integer messageId){ - LocalDateTime requestTime = LocalDateTime.now(); - LocalDateTime dayBeforeRequest = requestTime.minusDays(1L); - EventRequestDto eventRequestDto = EventRequestDto.builder() - .clientUUID(uuid) - .mockedResponseId(messageId) - .localDateTimeFrom(dayBeforeRequest) - .localDateTimeTo(requestTime) - .build(); - return new ResponseEntity(service.getEventsByDateTimeAndBusinessKeys(eventRequestDto), HttpStatus.OK); - } - - -} - diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java index 8ec6473..61f00fe 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java @@ -3,13 +3,14 @@ package com.r11.tools.controller; import com.fasterxml.jackson.databind.ObjectMapper; import com.r11.tools.model.MockedMessageDto; import com.r11.tools.service.KlausService; -import com.r11.tools.utilis.BusinessKey; -import com.r11.tools.utilis.TrackingClient; import lombok.AllArgsConstructor; import lombok.SneakyThrows; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.springframework.http.*; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; @@ -18,17 +19,19 @@ import java.util.*; /** * Returns the homepage and provides the api for javascript async requests. * @author Gabriel Modzelewski + * @author Mikołaj Widła */ @RestController @RequestMapping(path = "/api/mock") @AllArgsConstructor +@CrossOrigin(origins = "*") public class MockController { private final KlausService klausService; private final Logger log = LogManager.getRootLogger(); @ExceptionHandler(Exception.class) public void errorHandler(Exception ex){ - log.error(ex.getStackTrace()); + log.error(Arrays.toString(ex.getStackTrace())); } /** @@ -175,22 +178,14 @@ public class MockController { /** * It's one of the most important features - the bread and butter of the Mocked Service. It's link that allows * to receive mocked response from the server and use it to mock! - * @param requestEntity Logs the data of request * @param clientUUID the key-uuid of given set of messages * @param mockedResponseId unique id of given message * @return */ - @GetMapping(value = "/r/{clientUUID}/{mockedResponseId}") - public ResponseEntity getMockedResponse(RequestEntity requestEntity, + @RequestMapping(value = "/r/{clientUUID}/{mockedResponseId}") + public ResponseEntity getMockedResponse( @PathVariable UUID clientUUID, @PathVariable int mockedResponseId) { - TrackingClient.setBusinessKeys(Map.of(BusinessKey.INTERFACE_NAME, "getMockedResponse - request", - BusinessKey.CLIENT_UUID, String.valueOf(clientUUID), - BusinessKey.MESSAGE_ID, String.valueOf(mockedResponseId))); - // log.info(requestEntity.toString().replaceAll("\"", "\\\\\"").substring(1).replaceAll("\n","")); - TrackingClient.setBusinessKeys(Map.of(BusinessKey.INTERFACE_NAME, "getMockedResponse - response", - BusinessKey.CLIENT_UUID, String.valueOf(clientUUID), - BusinessKey.MESSAGE_ID, String.valueOf(mockedResponseId))); MockedMessageDto mockedMessageDto = klausService.getMockedResponse(clientUUID, mockedResponseId); HttpHeaders httpHeaders = new HttpHeaders(); if (mockedMessageDto.getHttpHeaders() != null) mockedMessageDto.getHttpHeaders().forEach(httpHeaders::set); diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MvcExceptionHandler.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MvcExceptionHandler.java index 2c9f582..1879df5 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MvcExceptionHandler.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MvcExceptionHandler.java @@ -7,6 +7,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.BindException; import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.ExceptionHandler; @@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler; * @author Rafał Żukowicz */ @ControllerAdvice +@CrossOrigin(origins = "*") public class MvcExceptionHandler { /** diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java new file mode 100644 index 0000000..de220c7 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java @@ -0,0 +1,71 @@ +package com.r11.tools.controller; + +import com.r11.tools.mappers.RequestHistoryMapper; +import com.r11.tools.model.HistoryRequestModel; +import com.r11.tools.model.RequestHistory; +import com.r11.tools.model.RequestHistoryDTO; +import com.r11.tools.service.RequestHistoryService; +import lombok.AllArgsConstructor; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; + +/** + * It's the REST api for {@link RequestHistory} + * @author Gabriel Modzelewski + * @author Mikołaj Widła + */ +@RestController +@RequestMapping(path = "/api/event") +@AllArgsConstructor +@CrossOrigin(origins = "*") +public class RequestHistoryController { + private final RequestHistoryService service; + private final RequestHistoryMapper mapper; + + /** + * Returns the list of Events in given time bracket. + * The list of objects is received via {@link RequestHistoryDTO}, which contains time brackets, + * as well as the key - uuid. + * @param historyRequestModel EventRequestDto object that contains data needed to query the database + * @return list of {@link RequestHistory} + */ + @PostMapping + public ResponseEntity> filterHistory(@RequestBody HistoryRequestModel historyRequestModel){ + return ResponseEntity.ok( + service.getHistoryRecordsBetweenDatesAndByUUIDAndMessageId(historyRequestModel) + .stream() + .map(mapper::requestHistoryToRequestHistoryDTO) + .collect(Collectors.toList()) + ); + } + + /** + * Returns the list of Events of last 24h from given date. + * @param uuid unique id of message list + * @param messageId unique id of message in message list + * @return list of {@link RequestHistory} + */ + @GetMapping(path = "/{uuid}/{messageId}") + public ResponseEntity> getLastDay(@PathVariable UUID uuid, + @PathVariable Integer messageId){ + LocalDateTime requestTime = LocalDateTime.now(); + LocalDateTime dayBeforeRequest = requestTime.minusDays(1L); + List requestHistory = service.getHistoryRecordsBetweenDatesAndByUUIDAndMessageId( + HistoryRequestModel.builder() + .localDateTimeFrom(dayBeforeRequest) + .localDateTimeTo(requestTime) + .clientUUID(uuid) + .mockedResponseId(messageId) + .build() + ).stream() + .map(mapper::requestHistoryToRequestHistoryDTO) + .collect(Collectors.toList()); + return ResponseEntity.ok(requestHistory); + } +} + diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/interceptor/IncomingMockRequestInterceptor.java b/Backend/mocked-services/src/main/java/com/r11/tools/interceptor/IncomingMockRequestInterceptor.java new file mode 100644 index 0000000..70faec3 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/interceptor/IncomingMockRequestInterceptor.java @@ -0,0 +1,79 @@ +package com.r11.tools.interceptor; + +import com.r11.tools.model.RequestHistoryDTO; +import com.r11.tools.service.RequestHistoryService; +import lombok.AllArgsConstructor; +import org.springframework.http.HttpMethod; +import org.springframework.stereotype.Component; +import org.springframework.util.StreamUtils; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.HandlerMapping; +import org.springframework.web.util.ContentCachingRequestWrapper; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.nio.charset.Charset; +import java.time.LocalDateTime; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +/** + * Interceptor that gets needed data from HttpRequest, and saves it to history + * @author Mikołaj Widła + */ + +@Component +@AllArgsConstructor +public class IncomingMockRequestInterceptor implements HandlerInterceptor { + + private final RequestHistoryService historyService; + + @Override + public boolean preHandle(HttpServletRequest httpRequest, HttpServletResponse response, Object handler){ + Map headers = getHeadersFromHttpRequest(httpRequest); + Map pathVariable = getPathVariablesFromHttpRequest(httpRequest); + String requestBody = getRequestBodyFromHttpRequest(httpRequest); + + RequestHistoryDTO historyDTO = RequestHistoryDTO.builder() + .httpMethod(HttpMethod.valueOf(httpRequest.getMethod())) + .headers( headers ) + .messageID(Integer.valueOf(pathVariable.get("mockedResponseId"))) + .clientUUID(UUID.fromString(pathVariable.get("clientUUID"))) + .dateTimeStamp(LocalDateTime.now()) + .requestBody(requestBody) + .build(); + historyService.saveRequest(historyDTO); + return true; + } + + private Map getHeadersFromHttpRequest( HttpServletRequest httpRequest ){ + Set headersName = StreamSupport.stream( + Spliterators.spliteratorUnknownSize( + httpRequest.getHeaderNames().asIterator(), + Spliterator.ORDERED + ), false + ).collect(Collectors.toSet()); + + return headersName.stream() + .collect(Collectors.toMap( + value -> value, + httpRequest::getHeader + )); + } + + private Map getPathVariablesFromHttpRequest( HttpServletRequest httpRequest ){ + return (Map) httpRequest.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); + } + + private String getRequestBodyFromHttpRequest( HttpServletRequest httpRequest ){ + HttpServletRequest wrappedRequest = new ContentCachingRequestWrapper(httpRequest); + try { + return StreamUtils.copyToString(wrappedRequest.getInputStream(), Charset.defaultCharset()); + } catch (IOException e) { + return ""; + } + } + +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java index 882ab09..0ba9a76 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java @@ -12,6 +12,7 @@ import org.mapstruct.*; public interface MockedMessageMapper { @Mapping( target = "compositePrimaryKey", expression = "java(mockedMessageDto.getClientUUID() + \"_\"" + " + mockedMessageDto.getMockedResponseId())") + @Mapping( target = "createdAt" , expression = "java(java.time.LocalDateTime.now())") MockedMessage mockedMessageDtoToMockedMessage(MockedMessageDto mockedMessageDto); MockedMessageDto mockedMessageToMockedMessageDto(MockedMessage mockedMessage); } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/mappers/RequestHistoryMapper.java b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/RequestHistoryMapper.java new file mode 100644 index 0000000..a4bb5ed --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/RequestHistoryMapper.java @@ -0,0 +1,24 @@ +package com.r11.tools.mappers; + +import com.r11.tools.model.RequestHistory; +import com.r11.tools.model.RequestHistoryDTO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; + +/** +* Map between DTO and Entity +* +* @author Mikołaj Widła +* + */ + +@Mapper +public interface RequestHistoryMapper { + + @Mapping(target = "id", expression = "java(null)") + @Mapping(target = "clientUUID", expression = "java(requestHistoryDTO.getClientUUID().toString())") + RequestHistory requestHistoryDTOToRequestHistory(RequestHistoryDTO requestHistoryDTO); + @Mapping(target = "clientUUID", expression = "java(java.util.UUID.fromString(requestHistory.getClientUUID()))") + RequestHistoryDTO requestHistoryToRequestHistoryDTO(RequestHistory requestHistory); + +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/Event.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/Event.java deleted file mode 100644 index 4bd0b4e..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/Event.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.r11.tools.model; - -import java.time.LocalDateTime; -import lombok.*; -import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.lang.Nullable; - -/** - * Pojo class for Event entity - * @author Rafał Żukowicz - */ -@Data -@Builder -@ToString -@NoArgsConstructor -@AllArgsConstructor -public class Event implements Comparable{ - - @DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm:ss") - private LocalDateTime dateTimeStamp; - @Nullable - private String interfaceName; - @Nullable - private String clientUUID; - @Nullable - private Integer messageId; - private String thread; - private String level; - @Nullable - private String message; - - @Override - public int compareTo(Event o) { - return this.getDateTimeStamp().compareTo(o.getDateTimeStamp()) * -1; - } -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/EventRequestDto.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/HistoryRequestModel.java similarity index 79% rename from Backend/mocked-services/src/main/java/com/r11/tools/model/EventRequestDto.java rename to Backend/mocked-services/src/main/java/com/r11/tools/model/HistoryRequestModel.java index ecfc03f..54aa79f 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/EventRequestDto.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/HistoryRequestModel.java @@ -1,22 +1,24 @@ package com.r11.tools.model; -import java.time.LocalDateTime; -import java.util.UUID; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import java.util.UUID; + /** - * Pojo for history query request. Contains information necessary to obtain {@link Event} list - * @author Rafał Żukowicz + * Represents all data needed to get HistoryRecord from database + * @author Mikołaj Widła */ + @Data @Builder @NoArgsConstructor @AllArgsConstructor -public class EventRequestDto { +public class HistoryRequestModel { private UUID clientUUID; @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java index 29989d4..abdf15a 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java @@ -2,6 +2,7 @@ package com.r11.tools.model; import com.r11.tools.model.constraints.HttpCode; import java.io.Serializable; +import java.time.LocalDateTime; import java.util.Map; import java.util.UUID; import javax.validation.constraints.Positive; @@ -34,6 +35,7 @@ public class MockedMessage implements Serializable { private Map httpHeaders; @HttpCode private Integer httpStatus; + private LocalDateTime createdAt; } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java new file mode 100644 index 0000000..385d5e2 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java @@ -0,0 +1,45 @@ +package com.r11.tools.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.data.annotation.Id; +import org.springframework.data.redis.core.RedisHash; +import org.springframework.data.redis.core.index.Indexed; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.http.HttpMethod; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Map; + +/** + * Pojo class for Event entity + * @author Rafał Żukowicz + * @author Mikołaj Widła + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@RedisHash("mockHistory") +public class RequestHistory implements Comparable, Serializable { + + @Id + private String id; + @DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm:ss") + private LocalDateTime dateTimeStamp; + @Indexed + private String clientUUID; + @Indexed + private Integer messageID; + private Map headers; + private HttpMethod httpMethod; + private String requestBody; + + @Override + public int compareTo(RequestHistory o) { + return this.getDateTimeStamp().compareTo(o.getDateTimeStamp()) * -1; + } +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistoryDTO.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistoryDTO.java new file mode 100644 index 0000000..1df697c --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistoryDTO.java @@ -0,0 +1,33 @@ +package com.r11.tools.model; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.http.HttpMethod; + +import java.time.LocalDateTime; +import java.util.Map; +import java.util.UUID; + +/** + * Pojo for history query request. Contains information necessary to obtain {@link RequestHistory} list + * @author Rafał Żukowicz + * @author Mikołaj Widła + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class RequestHistoryDTO { + + private UUID clientUUID; + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private LocalDateTime dateTimeStamp; + private Integer messageID; + private Map headers; + private HttpMethod httpMethod; + private String requestBody; + +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepository.java b/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepository.java deleted file mode 100644 index c634732..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepository.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.r11.tools.repository; - -import com.r11.tools.model.Event; -import com.r11.tools.utilis.BusinessKey; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; -import org.springframework.stereotype.Repository; -import org.springframework.transaction.annotation.Transactional; - -/** - * Event entity dao interface - * @author Rafał Żukowicz - */ -@Repository -@Transactional -public interface EventRepository { - List findEvents(LocalDateTime localDateTimeFrom, LocalDateTime localDateTimeTo, - Map businessKeys); -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepositoryImpl.java b/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepositoryImpl.java deleted file mode 100644 index 3de0e2a..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/repository/EventRepositoryImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.r11.tools.repository; - -import static com.r11.tools.utilis.RedisAppender.LOG_PREFIX; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.r11.tools.model.Event; -import com.r11.tools.utilis.BusinessKey; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import lombok.AllArgsConstructor; -import org.springframework.stereotype.Repository; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; - -/** - * Builds Event list based on logs created via {@link com.r11.tools.utilis.TrackingClient} and {@link com.r11.tools.utilis.RedisAppender} - * @author Rafał Żukowicz - */ -@Repository -@AllArgsConstructor -public class EventRepositoryImpl implements EventRepository { - private final JedisPool jedisPool; - private final ObjectMapper objectMapper; - - /** - * Creates list of {@link Event} based on {@link com.r11.tools.model.EventRequestDto} data via searching logs - * @param localDateTimeFrom date from which logs are retrieved - * @param localDateTimeTo date to which logs are retrieved - * @param businessKeys set keys for redis values - * @return - */ - @Override - public List findEvents(LocalDateTime localDateTimeFrom, LocalDateTime localDateTimeTo, - Map businessKeys) { - List eventStrings = findEventsBetweenDates(localDateTimeFrom.toLocalDate(), localDateTimeTo.toLocalDate()); - if (businessKeys.size() > 0) { - eventStrings = businessKeysFilter(eventStrings, businessKeys); - } - List events = parseEvents(eventStrings); - if (localDateTimeFrom.toLocalTime() != LocalTime.MIN) { - events = events.stream().filter(event -> event.getDateTimeStamp().compareTo(localDateTimeFrom) >= 0) - .collect(Collectors.toList()); - } - return events.stream().filter(event -> event.getDateTimeStamp().compareTo(localDateTimeTo) <= 0) - .collect(Collectors.toList()); - } - - /** - * Returns logs between given dates - * @param localDateFrom date from which logs are retrieved - * @param localDateTo date to which logs are retrieved - * @return - */ - private List findEventsBetweenDates(LocalDate localDateFrom, LocalDate localDateTo) { - try (Jedis jedis = jedisPool.getResource()) { - return localDateFrom.datesUntil(localDateTo.plusDays(1)).map(day -> LOG_PREFIX + day.toString()) - .map(key -> jedis.lrange(key, 0, -1)).flatMap(Collection::stream).collect(Collectors.toList()); - } - } - - /** - * Filters keys so only the ones queried are retirned - * @param events list of logs - * @param businessKeys set keys for redis values - * @return filtered list of logs - */ - private List businessKeysFilter(List events, Map businessKeys) { - for (Map.Entry entry : businessKeys.entrySet()) { - String stringPattern = entry.getKey().getReasonPhrase()+ "\"" + ":" + "\"" + entry.getValue() + "\""; - events = events.stream().filter(s -> s.contains(stringPattern)).collect(Collectors.toList()); - } - return events; - } - - /** - * Parses list of logs into list of {@link Event} - * @param eventStrings list of logs - * @return list of {@link Event} - */ - private List parseEvents(List eventStrings) { - List events = new ArrayList<>(); - for (String eventString : eventStrings) { - eventString = eventString.replaceAll("\\R", ""); - try { - events.add(objectMapper.readValue(eventString, Event.class)); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - } - return events; - } -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/repository/RequestHistoryRepository.java b/Backend/mocked-services/src/main/java/com/r11/tools/repository/RequestHistoryRepository.java new file mode 100644 index 0000000..2df27d5 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/repository/RequestHistoryRepository.java @@ -0,0 +1,20 @@ +package com.r11.tools.repository; + +import com.r11.tools.model.RequestHistory; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * History Record entity dao interface + * @author Rafał Żukowicz + */ +@Repository +@Transactional +public interface RequestHistoryRepository extends CrudRepository { + List findAllByClientUUIDAndMessageID( + String clientUUID, + Integer messageID); +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackService.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackService.java deleted file mode 100644 index 98c6658..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.r11.tools.service; - -import com.r11.tools.model.Event; -import com.r11.tools.model.EventRequestDto; -import java.util.List; -import org.springframework.stereotype.Service; - -/** - * Spring service interface for {@link com.r11.tools.controller.EventController} - * @author Rafał Żukowicz - */ -@Service -public interface EtrackService { - /** - * Searches for {@link Event} objects between date brackets - * @param eventsDto object containing required data for request - * @return list of {@link Event} - */ - List getEventsByDateTimeAndBusinessKeys(EventRequestDto eventsDto); -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackServiceImpl.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackServiceImpl.java deleted file mode 100644 index ea49c17..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/EtrackServiceImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.r11.tools.service; - -import com.r11.tools.model.Event; -import com.r11.tools.model.EventRequestDto; -import com.r11.tools.repository.EventRepository; -import com.r11.tools.utilis.BusinessKey; -import lombok.AllArgsConstructor; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Spring Service for {@link com.r11.tools.controller.EventController}. Contains logic required for quering - * the database for {@link Event} objects - * @author Rafał Żukowicz - */ -@Service -@AllArgsConstructor -public class EtrackServiceImpl implements EtrackService { - - private final EventRepository eventRepository; - - /** - * Adds {@link BusinessKey} to {@link EventRequestDto} - * in order to create query via{@link com.r11.tools.repository.EventRepositoryImpl} - * @param eventsDto object containing required data for request - * @return list of {@link Event} - */ - @Override - public List getEventsByDateTimeAndBusinessKeys(EventRequestDto eventsDto) { - Map businessKeys = new HashMap<>(); - businessKeys.put(BusinessKey.CLIENT_UUID, eventsDto.getClientUUID().toString()); - if (eventsDto.getMockedResponseId() != null){ - businessKeys.put(BusinessKey.MESSAGE_ID, String.valueOf(eventsDto.getMockedResponseId())); - } - List events = eventRepository.findEvents(eventsDto.getLocalDateTimeFrom(), eventsDto.getLocalDateTimeTo(), - businessKeys); - Collections.sort(events); - return events; - } -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java index 2190048..ce16bb2 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java @@ -1,6 +1,5 @@ package com.r11.tools.service; -import com.fasterxml.jackson.databind.ObjectMapper; import com.r11.tools.mappers.MockedMessageMapper; import com.r11.tools.model.MockedMessage; import com.r11.tools.model.MockedMessageDto; @@ -13,6 +12,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; + import java.util.List; import java.util.Optional; import java.util.UUID; @@ -30,7 +30,6 @@ public class KlausServiceImpl implements KlausService { private final MockedMessageMapper mockedMessageMapper; private final Logger log = LogManager.getRootLogger(); private final MockedResponseRepository mockedResponseRepository; - private final ObjectMapper objectMapper; /** * Removes message of given id in given key-uuid set diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryService.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryService.java new file mode 100644 index 0000000..1f8042a --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryService.java @@ -0,0 +1,23 @@ +package com.r11.tools.service; + +import com.r11.tools.controller.RequestHistoryController; +import com.r11.tools.model.HistoryRequestModel; +import com.r11.tools.model.RequestHistory; +import com.r11.tools.model.RequestHistoryDTO; +import java.util.List; +import org.springframework.stereotype.Service; + +/** + * Spring service interface for {@link RequestHistoryController} + * @author Rafał Żukowicz + */ +@Service +public interface RequestHistoryService { + /** + * Searches for {@link RequestHistory} objects between date brackets + * @param historyRequestModel object containing required data for request + * @return list of {@link RequestHistory} + */ + List getHistoryRecordsBetweenDatesAndByUUIDAndMessageId(HistoryRequestModel historyRequestModel); + void saveRequest(RequestHistoryDTO requestDTO); +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java new file mode 100644 index 0000000..ffe3ed5 --- /dev/null +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java @@ -0,0 +1,58 @@ +package com.r11.tools.service; + +import com.r11.tools.controller.RequestHistoryController; +import com.r11.tools.mappers.RequestHistoryMapper; +import com.r11.tools.model.HistoryRequestModel; +import com.r11.tools.model.RequestHistory; +import com.r11.tools.model.RequestHistoryDTO; +import com.r11.tools.repository.RequestHistoryRepository; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * Spring Service for {@link RequestHistoryController}. Contains logic required for quering + * the database for {@link RequestHistory} objects + * @author Rafał Żukowicz + * @author Mikołaj Widła + */ +@Service +@AllArgsConstructor +public class RequestHistoryServiceImpl implements RequestHistoryService { + + private final RequestHistoryRepository repository; + private final RequestHistoryMapper requestMapper; + + /** + * in order to create query via{@link com.r11.tools.repository.RequestHistoryRepository} + * @param historyRequestModel object containing required data for request + * @return list of {@link RequestHistory} + */ + @Override + public List getHistoryRecordsBetweenDatesAndByUUIDAndMessageId(HistoryRequestModel historyRequestModel) { + List history = repository.findAllByClientUUIDAndMessageID( + historyRequestModel.getClientUUID().toString(), + historyRequestModel.getMockedResponseId() + ); + Collections.sort(history); + + return history.stream() + .filter( historyRecord -> historyRecord + .getDateTimeStamp() + .isAfter(historyRequestModel.getLocalDateTimeFrom()) + ).filter( + historyRecord-> historyRecord + .getDateTimeStamp() + .isBefore(historyRequestModel.getLocalDateTimeTo()) + ) + .collect(Collectors.toList()); + } + + @Override + public void saveRequest(RequestHistoryDTO requestDTO) { + repository.save(requestMapper.requestHistoryDTOToRequestHistory(requestDTO)); + } +} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/BusinessKey.java b/Backend/mocked-services/src/main/java/com/r11/tools/utilis/BusinessKey.java deleted file mode 100644 index fc90cdd..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/BusinessKey.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.r11.tools.utilis; - -import lombok.AllArgsConstructor; - -/** - * Enum of keys for redis database. - * @author Rafał Żukowicz - */ -@AllArgsConstructor -public enum BusinessKey { - INTERFACE_NAME("interfaceName"), - CLIENT_UUID("clientUUID"), - MESSAGE_ID("messageId"); - - private final String phrase; - - /** - * Returns string value of given enum variant - * @return string value of enum - */ - public String getReasonPhrase() { - return this.phrase; - } -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/RedisAppender.java b/Backend/mocked-services/src/main/java/com/r11/tools/utilis/RedisAppender.java deleted file mode 100644 index 0626848..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/RedisAppender.java +++ /dev/null @@ -1,235 +0,0 @@ -package com.r11.tools.utilis; - -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.Layout; -import ch.qos.logback.core.UnsynchronizedAppenderBase; -import com.cwbase.logback.AdditionalField; -import com.cwbase.logback.JSONEventLayout; -import java.time.LocalDate; -import java.util.Arrays; -import java.util.Iterator; -import org.apache.commons.pool2.impl.GenericObjectPoolConfig; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; -import redis.clients.jedis.Protocol; - -/** - * Class is used to insert logs directly to Redis. {@link com.release11.klaus.repository.EventRepositoryImpl} is using those logs. - * @author Rafał Żukowicz - * @author Gabriel Modzelewski - */ -public class RedisAppender extends UnsynchronizedAppenderBase { - - JedisPool pool; - JSONEventLayout jsonlayout; - Layout layout; - String host = "localhost"; - int port = Protocol.DEFAULT_PORT; - String key = null; - int timeout = Protocol.DEFAULT_TIMEOUT; - String password = null; - int database = Protocol.DEFAULT_DATABASE; - - public static final String LOG_PREFIX = "logstash_"; - - - public RedisAppender() { - jsonlayout = new JSONEventLayout(); - } - - /** - * Appends JedisPool by another log - * @param event object containing log info - */ - @Override - protected void append(ILoggingEvent event) { - Jedis client = pool.getResource(); - try { - String json = layout == null ? jsonlayout.doLayout(event) : layout.doLayout(event); - key = LOG_PREFIX + LocalDate.now(); - client.rpush(key, json); - } catch (Exception e) { - e.printStackTrace(); - } finally { - if (client != null) { - client.close(); - } - } - } - - @Deprecated - public String getSource() { - return jsonlayout.getSource(); - } - - @Deprecated - public void setSource(String source) { - jsonlayout.setSource(source); - } - - @Deprecated - public String getSourceHost() { - return jsonlayout.getSourceHost(); - } - - @Deprecated - public void setSourceHost(String sourceHost) { - jsonlayout.setSourceHost(sourceHost); - } - - @Deprecated - public String getSourcePath() { - return jsonlayout.getSourcePath(); - } - - @Deprecated - public void setSourcePath(String sourcePath) { - jsonlayout.setSourcePath(sourcePath); - } - - @Deprecated - public String getTags() { - if (jsonlayout.getTags() != null) { - Iterator i = jsonlayout.getTags().iterator(); - StringBuilder sb = new StringBuilder(); - while (i.hasNext()) { - sb.append(i.next()); - if (i.hasNext()) { - sb.append(','); - } - } - return sb.toString(); - } - return null; - } - - @Deprecated - public void setTags(String tags) { - if (tags != null) { - String[] atags = tags.split(","); - jsonlayout.setTags(Arrays.asList(atags)); - } - } - - @Deprecated - public String getType() { - return jsonlayout.getType(); - } - - @Deprecated - public void setType(String type) { - jsonlayout.setType(type); - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public int getTimeout() { - return timeout; - } - - public void setTimeout(int timeout) { - this.timeout = timeout; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public int getDatabase() { - return database; - } - - public void setDatabase(int database) { - this.database = database; - } - - @Deprecated - public void setMdc(boolean flag) { - jsonlayout.setProperties(flag); - } - - @Deprecated - public boolean getMdc() { - return jsonlayout.getProperties(); - } - - @Deprecated - public void setLocation(boolean flag) { - jsonlayout.setLocationInfo(flag); - } - - @Deprecated - public boolean getLocation() { - return jsonlayout.getLocationInfo(); - } - - @Deprecated - public void setCallerStackIndex(int index) { - jsonlayout.setCallerStackIdx(index); - } - - @Deprecated - public int getCallerStackIndex() { - return jsonlayout.getCallerStackIdx(); - } - - @Deprecated - public void addAdditionalField(AdditionalField p) { - jsonlayout.addAdditionalField(p); - } - - public Layout getLayout() { - return layout; - } - - public void setLayout(Layout layout) { - this.layout = layout; - } - - /** - * Starts new instance of JedisPool - */ - @Override - public void start() { - super.start(); - GenericObjectPoolConfig config = new GenericObjectPoolConfig(); - config.setTestOnBorrow(true); - pool = new JedisPool(config, host, port, timeout, password, database); - } - - /** - * Stops and destroys JedisPool object - */ - @Override - public void stop() { - super.stop(); - pool.destroy(); - } - -} diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/TrackingClient.java b/Backend/mocked-services/src/main/java/com/r11/tools/utilis/TrackingClient.java deleted file mode 100644 index 3f49400..0000000 --- a/Backend/mocked-services/src/main/java/com/r11/tools/utilis/TrackingClient.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.r11.tools.utilis; - -import java.util.Map; -import org.slf4j.MDC; - -/** - * This static class has one purpose and one purpose only. It logs data about incomming requests. - * The data from logs is received via {@link com.release11.klaus.repository.EventRepositoryImpl} - * @author Rafał Żukowski - */ -public final class TrackingClient { - - /** - * Logs data inside the given map - * @param businessKeysMap map containing all the information about incomming request - */ - public static void setBusinessKeys(Map businessKeysMap){ - for (Map.Entry entry : businessKeysMap.entrySet()) { - MDC.put(entry.getKey().getReasonPhrase(), entry.getValue()); - } - } - - -} diff --git a/Backend/mocked-services/src/main/resources/application.properties b/Backend/mocked-services/src/main/resources/application.properties index bd52dd8..cc5394a 100644 --- a/Backend/mocked-services/src/main/resources/application.properties +++ b/Backend/mocked-services/src/main/resources/application.properties @@ -5,3 +5,12 @@ spring.mvc.view.suffix=.html logging.level.root=INFO logging.level.org.springframework.web=INFO logging.level.com.release11=INFO + +#database: +spring.redis.host=redis +spring.redis.port=6379 + +#retention +retention.minutes-to-delete-message=120 +retention.minutes-to-delete-history-record=1440 +retention.retention-cooldown=1440 diff --git a/Backend/mocked-services/src/main/resources/data-access.properties b/Backend/mocked-services/src/main/resources/data-access.properties deleted file mode 100644 index 27196b6..0000000 --- a/Backend/mocked-services/src/main/resources/data-access.properties +++ /dev/null @@ -1,2 +0,0 @@ -redis.host = redis -redis.port = 6379 \ No newline at end of file diff --git a/Backend/mocked-services/src/main/resources/logback.xml b/Backend/mocked-services/src/main/resources/logback.xml index 16733a7..1827e28 100644 --- a/Backend/mocked-services/src/main/resources/logback.xml +++ b/Backend/mocked-services/src/main/resources/logback.xml @@ -2,25 +2,8 @@ - - - redis - 6379 - logstash - - - - {"dateTimeStamp" : "%d{yyyy-MM-dd}T%d{HH:mm:ss}", "eventId":"%X{eventId}", "interfaceName":"%X{interfaceName}", "clientUUID":"%X{clientUUID}", "messageId":"%X{messageId}", "thread":"%t","level":"%-5level", "message":"%msg"}%n - - - - - - - ${HOME_LOG} - logs/mockServices.%d{yyyy-MM-dd}.%i.log 10MB @@ -34,7 +17,6 @@ - diff --git a/Frontend/assets/css/tools/mock/common.css b/Frontend/assets/css/tools/mock/common.css index 350f678..f814529 100644 --- a/Frontend/assets/css/tools/mock/common.css +++ b/Frontend/assets/css/tools/mock/common.css @@ -6,6 +6,8 @@ @import url('r11tooltip.css'); @import url('r11modal.css'); @import url('r11flexbox.css'); +@import url('r11popup.css'); +@import url('../../highlight.css'); @font-face { font-family: 'Material Icons'; diff --git a/Frontend/assets/css/tools/mock/r11addons.css b/Frontend/assets/css/tools/mock/r11addons.css index 94db8ae..2d2e72e 100644 --- a/Frontend/assets/css/tools/mock/r11addons.css +++ b/Frontend/assets/css/tools/mock/r11addons.css @@ -69,4 +69,27 @@ .content p { margin: 0; padding: 0; -} \ No newline at end of file +} + +.refresh-button{ + float: right; + border: none; + background-color: unset; + font-size: xx-large; +} + +.refresh-button:hover{ + animation-name: rotation; + animation-duration: 0.8s; + animation-iteration-count: infinite; + animation-timing-function: linear; +} + +@keyframes rotation{ + from{ + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } + } \ No newline at end of file diff --git a/Frontend/assets/css/tools/mock/r11popup.css b/Frontend/assets/css/tools/mock/r11popup.css new file mode 100644 index 0000000..296349a --- /dev/null +++ b/Frontend/assets/css/tools/mock/r11popup.css @@ -0,0 +1,83 @@ +.popup-flex:not(.hiddable-container){ + animation: blur 0.5s ease-in-out ; + animation-fill-mode: forwards; +} +.popup-flex{ + display: flex; + align-items: center; + width: 100%; + height: 100%; + z-index: 50; + flex-direction: column; + gap: 2%; + position: fixed; + justify-content: center; +} + +.popup-body{ + min-width: 33%; + max-width: 60%; + max-height: 70%; + background-color: white; + box-shadow: 10px 10px 5px lightblue; + min-height: 45%; + border-radius: 1em; + text-align: center; + padding: 10px 15px 15px 15px; + color: black; + border: 1px #2A93B0 solid; + display: flex; + flex-direction: column; + position: fixed; +} + +.popup-button-close-container{ + text-align: right; + margin-right: 2%; + margin-top: 1%; + font-size: xx-large; + font-weight: bold; + position: sticky; + top:0 +} + +.hiddable-popup-option{ + flex-grow: 1; + overflow: auto; + padding: 1.5%; +} + +.popup-button-close{ + background: padding-box; + border: 0; +} + +.popup-button-close:hover{ + color: #2A93B0; +} + +.hiddable-container{ + display:none; +} + +.hidden-popup-type{ + display: none; +} + +#history-request-body{ + text-align: justify; +} + +@keyframes blur { + 0% { + backdrop-filter: blur(0px); + } + + 50% { + backdrop-filter: blur(5px); + } + + 100% { + backdrop-filter: blur(10px); + } + } diff --git a/Frontend/assets/css/tools/mock/r11tables.css b/Frontend/assets/css/tools/mock/r11tables.css index 0a680ab..c78730b 100644 --- a/Frontend/assets/css/tools/mock/r11tables.css +++ b/Frontend/assets/css/tools/mock/r11tables.css @@ -68,4 +68,29 @@ background-color: #3bc4f1; text-align: left; color: white; +} + +.table-default td{ + text-align: center; +} + +#header-table tr td { + border: 1px black solid; + padding: 1.5%; + +} + +#header-table{ + border-collapse: collapse; + width: 100%; + height: 100%; +} + +.history-header-name{ + min-width: 10vw; +} + +#historyTable, td{ + padding: 1%; + overflow-x: scroll; } \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/mock/datatransfer.js b/Frontend/assets/scripts/tools/mock/datatransfer.js index 922d5eb..34945a2 100644 --- a/Frontend/assets/scripts/tools/mock/datatransfer.js +++ b/Frontend/assets/scripts/tools/mock/datatransfer.js @@ -470,7 +470,7 @@ function selectMessage(id){ $('.tile[tileid="'+id+'"]').addClass("active"); initializeHistory(); - refreshHeaderTable(innerHTML); + refreshHeaderTable(document.innerHTML); } diff --git a/Frontend/assets/scripts/tools/mock/historyloader.js b/Frontend/assets/scripts/tools/mock/historyloader.js index 8c1912a..4c54671 100644 --- a/Frontend/assets/scripts/tools/mock/historyloader.js +++ b/Frontend/assets/scripts/tools/mock/historyloader.js @@ -46,13 +46,36 @@ function historyToHtml(){ for(let i=0; i' + - '' + historyJson[i].dateTimeStamp + '' + - '' + historyJson[i].interfaceName + '' + + '' + parseTimeStamp(historyJson[i].dateTimeStamp) + '' + + '' + historyJson[i].httpMethod + '' + + '' + parseRequestBody(historyJson[i].requestBody, i) + '' + + ' ' + ''; } return innerHTML; } +function parseRequestBody(requestBody,i){ + return requestBody.length == 0 ? + "No request body" : + '' +} + +function parseTimeStamp(timeStamp){ + return timeStamp.substring(0,19).replace('T',' '); +} + +function parseHeaders(pos){ + parsedJson = new Map(); + headers = historyJson[pos].headers + Object.keys( headers ).forEach( + (jsonKey) => { + parsedJson.set( jsonKey , headers[jsonKey] ); + } + ) + return parsedJson; +} + function displayHistory(){ $('#historyTable tbody').html(historyToHtml()); } diff --git a/Frontend/assets/scripts/tools/mock/popup.js b/Frontend/assets/scripts/tools/mock/popup.js new file mode 100644 index 0000000..0d2b91f --- /dev/null +++ b/Frontend/assets/scripts/tools/mock/popup.js @@ -0,0 +1,34 @@ + +function switchPopups (neededPopupOption) { + $('.hiddable-popup-option').addClass('hidden-popup-type'); + $('#'+neededPopupOption).removeClass('hidden-popup-type'); + } + +function showPopup(){ + $('.popup-flex').removeClass('hiddable-container'); +} + +function hidePopup(){ + $('.popup-flex').addClass('hiddable-container'); + $('.hiddable-popup-option').addClass('hidden-popup-type'); +} + +/* +* Event listener that's close the popup when user clicks out of a popup. +*/ + +window.addEventListener( + 'click' , + (clickedElement) => { + if(!document.getElementById('popup-body').contains(clickedElement.target) && clickedElement.target.className == 'popup-flex' ) { + hidePopup(); + } + } +); + +$('.popup-button-close').click( + () => { + hidePopup(); + $('.hiddable-popup-option').addClass('hidden-popup-type') + } +); \ No newline at end of file diff --git a/Frontend/assets/scripts/tools/mock/uianimation.js b/Frontend/assets/scripts/tools/mock/uianimation.js index 46dfb20..7340b83 100644 --- a/Frontend/assets/scripts/tools/mock/uianimation.js +++ b/Frontend/assets/scripts/tools/mock/uianimation.js @@ -35,7 +35,6 @@ $('#historyTab').click(showHistory); $('#btn-history-filter').click(historyFilterSwitch); - const tabitem = $('.tabitem'); function showHistory(){ $('#headersTab').click(showHeaders); @@ -52,8 +51,6 @@ function initializeHistory(){ getLast24hHistoryData(); } - - function showHeaders(){ $('#historyTab').click(showHistory); tabitem.removeClass('active'); @@ -63,6 +60,109 @@ function showHeaders(){ $('#headersTab').off('click'); } +function showHeadersHistory(element){ + historyTable = ''; + headers = parseHeaders(element.id) + headers.forEach( + (value,key) => { + historyTable += + '' + + ''+ key + '' + + ''+ value + '' + + '' + } + ); + document.getElementById('header-history-table-body').innerHTML = historyTable; + switchPopups('history-headers-table'); + showPopup(); +} + +async function formatJSON(json) { + const address = window.location.protocol + "//" + window.location.hostname + ":" + 8081 + "/json/formatting"; + + var init = { + body: json, + method: "POST" + }; + var request = new Request(address, init); + + var result = await fetch(request).then(response => { + return response.text().then(function (text) { + var json = JSON.parse(text); + json.status = response.status; + return json; + }); + + }); + return result; +} + +async function formatXML(xml) { + const address = window.location.protocol + "//" + window.location.hostname + ":" + 8082 + "/prettify"; + var data = { + data: xml, + process: "", + processor: "libxml", + version: "1.0" + } + + var init = { + body: JSON.stringify(data), + method: "POST" + }; + var request = new Request(address, init); + + var result = await fetch(request).then(response => { + return response.text().then(function (text) { + return JSON.parse(text); + }); + + }); + return result; +} + +function showRequestBody(element){ + var historyRequestBody = historyJson[element.id].requestBody; + const popupContent = document.getElementById('code-highlight-content') + + document.getElementById('code-highlight-content').innerText = "Loading..."; + switch(historyJson[element.id].headers["content-type"]){ + case "application/json":{ + formatJSON(historyRequestBody).then(function(result) { + + if (result.status == "200") { + popupContent.innerText = result.data; + highlightSyntax('code-highlight-content'); + } + else { + popupContent.innerText = historyRequestBody; + } + }); + break; + } + case "application/xml":{ + formatXML(historyRequestBody).then(function(result) { + if (result.status == "OK") { + popupContent.innerText = result.result; + highlightSyntax('code-highlight-content'); + } + else { + popupContent.innerText = historyRequestBody; + } + + }); + + break; + } + default:{ + popupContent.innerText = historyRequestBody; + highlightSyntax('code-highlight-content'); + } + } + switchPopups('history-request-body'); + showPopup(); +} + function focusInTip(element){ showTip(element); focusedField = true; @@ -73,6 +173,10 @@ function focusOutTip(element){ hidTip(element); } +function refreshHistoryRecords(){ + getLast24hHistoryData(); +} + function hidTip(element){ if(focusedField) return; $('#'+element).removeClass('active'); diff --git a/Frontend/tools/mock.html b/Frontend/tools/mock.html index 6039601..837c834 100644 --- a/Frontend/tools/mock.html +++ b/Frontend/tools/mock.html @@ -9,6 +9,34 @@ +
    @@ -127,7 +155,10 @@
    - + +
    @@ -149,7 +180,9 @@ Timestamp - Type + Method + Request Body + Headers @@ -299,5 +332,9 @@ + + + + From 2aaf993f7a34b0f151dadae2fb59bd954861c963 Mon Sep 17 00:00:00 2001 From: widlam Date: Tue, 23 May 2023 08:38:28 +0200 Subject: [PATCH 44/59] Started to removing changing UUID and many messages system --- .../r11/tools/controller/MockController.java | 117 +++--------------- .../controller/RequestHistoryController.java | 5 +- .../IncomingMockRequestInterceptor.java | 1 - .../tools/mappers/MockedMessageMapper.java | 12 +- .../tools/mappers/RequestHistoryMapper.java | 1 - .../r11/tools/model/HistoryRequestModel.java | 1 - .../com/r11/tools/model/MockedMessage.java | 19 ++- .../com/r11/tools/model/MockedMessageDto.java | 16 +-- .../com/r11/tools/model/RequestHistory.java | 5 +- .../r11/tools/model/RequestHistoryDTO.java | 1 - .../repository/MockedResponseRepository.java | 4 +- .../repository/RequestHistoryRepository.java | 4 +- .../com/r11/tools/service/KlausService.java | 8 +- .../r11/tools/service/KlausServiceImpl.java | 34 ++--- .../service/RequestHistoryServiceImpl.java | 5 +- Frontend/assets/css/tools/mock/r11tool.css | 4 - .../assets/scripts/tools/mock/datatransfer.js | 13 +- Frontend/tools/mock.html | 41 +----- 18 files changed, 62 insertions(+), 229 deletions(-) diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java index 61f00fe..a9af2c3 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/controller/MockController.java @@ -51,106 +51,35 @@ public class MockController { * Returns the full list of messages. It's used by javascript on the client side to initialize homepage * with data from the database. * @param uuidValue the key-uuid of given set of messages - * @return responds with 200 OK and list of {@link MockedMessageDto} + * @return responds with 200 OK and {@link MockedMessageDto} */ @GetMapping({"/", "/{uuidValue}"}) - public List getListOfMessages(@PathVariable(required = false) String uuidValue){ + public MockedMessageDto getMessage(@PathVariable(required = false) String uuidValue){ UUID clientUUID; + MockedMessageDto message ; if(uuidValue == null || uuidValue.equals("")) clientUUID = UUID.randomUUID(); else clientUUID = UUID.fromString(uuidValue); - List messages = klausService.getAllMockedResponses(clientUUID); - if(messages.size() == 0) { - klausService.setMockedResponse(buildDefaultMessage(clientUUID)); - messages = klausService.getAllMockedResponses(clientUUID); - } - Collections.sort(messages); - return messages; - } + message = klausService + .getMockedMessageByClientUUID(clientUUID) + .orElse( buildDefaultMessage(clientUUID) ); - /** - * If provided UUID does not exist in database returns ResponseEntity with new generated UUID(if previous UUID is not provided), - * or old UUID(if previous UUID is provided). If provided UUID exists function returns provided UUID. - * @param givenUUIDValue the UUID client wants to check exsitance in database - * @param previousUUIDValue the previous UUID used by client(optional variable) - * @return ResponseEntity with UUID - */ - @RequestMapping( - method = RequestMethod.GET , - path = {"/check/{givenUUIDValue}/{previousUUIDValue}", - "/check/{givenUUIDValue}"}) - public ResponseEntity checkUUID( - @PathVariable String givenUUIDValue - ,@PathVariable(required = false) String previousUUIDValue ){ - try{ - UUID.fromString(givenUUIDValue); - } catch (IllegalArgumentException ex){ - log.error("Wrong UUID value!"); - if (previousUUIDValue == null || previousUUIDValue.equals("")){ - UUID newUUID = UUID.randomUUID(); - log.info("New UUID generated."); - return ResponseEntity.ok(newUUID.toString()); - } - log.info("Previous UUID value restored."); - return ResponseEntity.ok(previousUUIDValue); - } - return ResponseEntity.ok(givenUUIDValue); - } - - /** - * Accepts empty post request and creates new message in given set. The new message has default set of data, - * which is constructed in {@link #buildDefaultMessage(UUID, int)} method. - * @param uuidValue the key-uuid of given set of messages - * @return confirmation response with 200 OK - */ - @PostMapping("/{uuidValue}") - public ResponseEntity addNewMessage(@PathVariable String uuidValue){ - UUID clientUUID = UUID.fromString(uuidValue); - List messages = klausService.getAllMockedResponses(clientUUID); - MockedMessageDto nextMessage = buildDefaultMessage(clientUUID, findNextId(messages)); - return klausService.setMockedResponse(nextMessage); - } - - /** - * Deletes message of given id via client request - * @param uuidValue the key-uuid of given set of messages - * @param idValue unique id of given message - * @return after deletion the confirmation is send with status 200 OK - */ - @DeleteMapping("/{uuidValue}/{idValue}") - public ResponseEntity removeMessage(@PathVariable String uuidValue, - @PathVariable String idValue){ - UUID clientUUID = UUID.fromString(uuidValue); - int id = Integer.parseInt(idValue); - return klausService.deleteMockedResponse(clientUUID, id); - } - - - /** - * Recalls {@link #buildDefaultMessage(UUID)} for message construction and sets id of message - * @param uuid the key-uuid of given set of messages - * @param id unique id of given message - * @return message with default dataset and set id - */ - private static MockedMessageDto buildDefaultMessage(UUID uuid, int id){ - MockedMessageDto message = buildDefaultMessage(uuid); - message.setMockedResponseId(id); return message; } + /** * Constructs message with default set of data * @param uuid the key-uuid of given set of messages * @return message with default dataset */ - private static MockedMessageDto buildDefaultMessage(UUID uuid){ + private MockedMessageDto buildDefaultMessage(UUID uuid){ Map headers = new HashMap<>(); headers.put("Keep-Alive", "timeout=60"); headers.put("Connection", "keep-alive"); headers.put("Date", LocalDateTime.now().toString()); - return MockedMessageDto.builder() + MockedMessageDto mockedMessageDto = MockedMessageDto.builder() .clientUUID(uuid) - .mockedResponseId(1) - .mediaType(MediaType.APPLICATION_XML_VALUE) + .contentType(MediaType.APPLICATION_XML_VALUE) .messageBody("\n" + "\n" + " Tove\n" + @@ -161,38 +90,24 @@ public class MockController { .httpHeaders(headers) .httpStatus(200) .build(); + klausService.setMockedResponse(mockedMessageDto); + return mockedMessageDto; } - - /** - * Finds the highest id in the list and returns it incremented by 1 - * @param messages list of messages - * @return highest id incremented by 1 - */ - public static int findNextId(List messages) { - int highestId = 0; - for (MockedMessageDto m : messages) - highestId = highestId > m.getMockedResponseId() ? highestId : m.getMockedResponseId(); - return ++highestId; - } - /** * It's one of the most important features - the bread and butter of the Mocked Service. It's link that allows * to receive mocked response from the server and use it to mock! * @param clientUUID the key-uuid of given set of messages - * @param mockedResponseId unique id of given message * @return */ - @RequestMapping(value = "/r/{clientUUID}/{mockedResponseId}") + @RequestMapping(value = "/r/{clientUUID}") public ResponseEntity getMockedResponse( - @PathVariable UUID clientUUID, - @PathVariable int mockedResponseId) { - MockedMessageDto mockedMessageDto = klausService.getMockedResponse(clientUUID, mockedResponseId); + @PathVariable UUID clientUUID) { + MockedMessageDto mockedMessageDto = klausService.getMockedResponse(clientUUID); HttpHeaders httpHeaders = new HttpHeaders(); if (mockedMessageDto.getHttpHeaders() != null) mockedMessageDto.getHttpHeaders().forEach(httpHeaders::set); - httpHeaders.add("Content-Type", mockedMessageDto.getMediaType()); + httpHeaders.add("Content-Type", mockedMessageDto.getContentType()); return new ResponseEntity<>(mockedMessageDto.getMessageBody(), httpHeaders, Objects.requireNonNull(HttpStatus.valueOf(mockedMessageDto.getHttpStatus()))); } - } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java index de220c7..74a63c9 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java @@ -47,12 +47,10 @@ public class RequestHistoryController { /** * Returns the list of Events of last 24h from given date. * @param uuid unique id of message list - * @param messageId unique id of message in message list * @return list of {@link RequestHistory} */ @GetMapping(path = "/{uuid}/{messageId}") - public ResponseEntity> getLastDay(@PathVariable UUID uuid, - @PathVariable Integer messageId){ + public ResponseEntity> getLastDay(@PathVariable UUID uuid){ LocalDateTime requestTime = LocalDateTime.now(); LocalDateTime dayBeforeRequest = requestTime.minusDays(1L); List requestHistory = service.getHistoryRecordsBetweenDatesAndByUUIDAndMessageId( @@ -60,7 +58,6 @@ public class RequestHistoryController { .localDateTimeFrom(dayBeforeRequest) .localDateTimeTo(requestTime) .clientUUID(uuid) - .mockedResponseId(messageId) .build() ).stream() .map(mapper::requestHistoryToRequestHistoryDTO) diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/interceptor/IncomingMockRequestInterceptor.java b/Backend/mocked-services/src/main/java/com/r11/tools/interceptor/IncomingMockRequestInterceptor.java index 70faec3..0693ef9 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/interceptor/IncomingMockRequestInterceptor.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/interceptor/IncomingMockRequestInterceptor.java @@ -39,7 +39,6 @@ public class IncomingMockRequestInterceptor implements HandlerInterceptor { RequestHistoryDTO historyDTO = RequestHistoryDTO.builder() .httpMethod(HttpMethod.valueOf(httpRequest.getMethod())) .headers( headers ) - .messageID(Integer.valueOf(pathVariable.get("mockedResponseId"))) .clientUUID(UUID.fromString(pathVariable.get("clientUUID"))) .dateTimeStamp(LocalDateTime.now()) .requestBody(requestBody) diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java index 0ba9a76..af0098f 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/MockedMessageMapper.java @@ -4,15 +4,23 @@ import com.r11.tools.model.MockedMessage; import com.r11.tools.model.MockedMessageDto; import org.mapstruct.*; +import java.util.Optional; + /** * Creates key value for redis entry * @author Rafał Źukowicz */ @Mapper public interface MockedMessageMapper { - @Mapping( target = "compositePrimaryKey", expression = "java(mockedMessageDto.getClientUUID() + \"_\"" + - " + mockedMessageDto.getMockedResponseId())") @Mapping( target = "createdAt" , expression = "java(java.time.LocalDateTime.now())") MockedMessage mockedMessageDtoToMockedMessage(MockedMessageDto mockedMessageDto); MockedMessageDto mockedMessageToMockedMessageDto(MockedMessage mockedMessage); + + default Optional optionalMockedMessageToOptionalMockedMessageDTO(Optional optionalMockedMessage){ + return optionalMockedMessage.map(this::mockedMessageToMockedMessageDto); + } + + default Optional optionalMockedMessageDTOToOptionalMockedMessage(Optional optionalMockedMessageDto){ + return optionalMockedMessageDto.map(this::mockedMessageDtoToMockedMessage); + } } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/mappers/RequestHistoryMapper.java b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/RequestHistoryMapper.java index a4bb5ed..5f97e92 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/mappers/RequestHistoryMapper.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/mappers/RequestHistoryMapper.java @@ -15,7 +15,6 @@ import org.mapstruct.Mapping; @Mapper public interface RequestHistoryMapper { - @Mapping(target = "id", expression = "java(null)") @Mapping(target = "clientUUID", expression = "java(requestHistoryDTO.getClientUUID().toString())") RequestHistory requestHistoryDTOToRequestHistory(RequestHistoryDTO requestHistoryDTO); @Mapping(target = "clientUUID", expression = "java(java.util.UUID.fromString(requestHistory.getClientUUID()))") diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/HistoryRequestModel.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/HistoryRequestModel.java index 54aa79f..06b251f 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/HistoryRequestModel.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/HistoryRequestModel.java @@ -25,6 +25,5 @@ public class HistoryRequestModel { private LocalDateTime localDateTimeFrom; @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private LocalDateTime localDateTimeTo; - private Integer mockedResponseId; } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java index abdf15a..a0b6d0e 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessage.java @@ -1,11 +1,6 @@ package com.r11.tools.model; import com.r11.tools.model.constraints.HttpCode; -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.Map; -import java.util.UUID; -import javax.validation.constraints.Positive; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -14,6 +9,11 @@ import org.springframework.data.annotation.Id; import org.springframework.data.redis.core.RedisHash; import org.springframework.data.redis.core.index.Indexed; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Map; +import java.util.UUID; + /** * MockedMessage redis entity pojo * @author Rafał Żukowicz @@ -24,13 +24,10 @@ import org.springframework.data.redis.core.index.Indexed; @NoArgsConstructor @AllArgsConstructor public class MockedMessage implements Serializable { - @Id - private String compositePrimaryKey; @Indexed + @Id private UUID clientUUID; - @Positive - private Integer mockedResponseId; - private String mediaType; + private String contentType; private String messageBody; private Map httpHeaders; @HttpCode @@ -38,5 +35,3 @@ public class MockedMessage implements Serializable { private LocalDateTime createdAt; } - - diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessageDto.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessageDto.java index caae824..d3206ed 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessageDto.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/MockedMessageDto.java @@ -1,12 +1,11 @@ package com.r11.tools.model; import com.r11.tools.model.constraints.HttpCode; +import lombok.*; + import java.io.Serializable; import java.util.Map; import java.util.UUID; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Positive; -import lombok.*; /** * Alternative version of {@link MockedMessage} used in http body @@ -18,19 +17,12 @@ import lombok.*; @ToString @NoArgsConstructor @AllArgsConstructor -public class MockedMessageDto implements Serializable, Comparable { +public class MockedMessageDto implements Serializable{ private UUID clientUUID; - @NotNull - @Positive - private Integer mockedResponseId; - private String mediaType; + private String contentType; private String messageBody; private Map httpHeaders; @HttpCode private Integer httpStatus; - @Override - public int compareTo(MockedMessageDto message) { - return this.mockedResponseId > message.getMockedResponseId() ? 1 : -1; - } } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java index 385d5e2..fe43393 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java @@ -26,14 +26,11 @@ import java.util.Map; @RedisHash("mockHistory") public class RequestHistory implements Comparable, Serializable { - @Id - private String id; @DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm:ss") private LocalDateTime dateTimeStamp; @Indexed + @Id private String clientUUID; - @Indexed - private Integer messageID; private Map headers; private HttpMethod httpMethod; private String requestBody; diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistoryDTO.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistoryDTO.java index 1df697c..7c78958 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistoryDTO.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistoryDTO.java @@ -25,7 +25,6 @@ public class RequestHistoryDTO { private UUID clientUUID; @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private LocalDateTime dateTimeStamp; - private Integer messageID; private Map headers; private HttpMethod httpMethod; private String requestBody; diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/repository/MockedResponseRepository.java b/Backend/mocked-services/src/main/java/com/r11/tools/repository/MockedResponseRepository.java index 7b12b0b..f9296fa 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/repository/MockedResponseRepository.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/repository/MockedResponseRepository.java @@ -14,11 +14,11 @@ import org.springframework.transaction.annotation.Transactional; */ @Repository @Transactional -public interface MockedResponseRepository extends CrudRepository { +public interface MockedResponseRepository extends CrudRepository { /** * Finds all messages by their uuid * @param clientUUID the key-uuid of given set of messages * @return Optional of list of {@link com.r11.tools.model.MockedMessage} */ - Optional> findAllByClientUUID(UUID clientUUID); + Optional findAllByClientUUID(UUID clientUUID); } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/repository/RequestHistoryRepository.java b/Backend/mocked-services/src/main/java/com/r11/tools/repository/RequestHistoryRepository.java index 2df27d5..9927937 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/repository/RequestHistoryRepository.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/repository/RequestHistoryRepository.java @@ -14,7 +14,5 @@ import java.util.List; @Repository @Transactional public interface RequestHistoryRepository extends CrudRepository { - List findAllByClientUUIDAndMessageID( - String clientUUID, - Integer messageID); + List findAllByClientUUID(String clientUUID); } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausService.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausService.java index 917f878..1c5079a 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausService.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausService.java @@ -1,7 +1,8 @@ package com.r11.tools.service; import com.r11.tools.model.MockedMessageDto; -import java.util.List; + +import java.util.Optional; import java.util.UUID; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; @@ -12,8 +13,7 @@ import org.springframework.stereotype.Service; */ @Service public interface KlausService { - ResponseEntity deleteMockedResponse(UUID clientUUID, int mockedResponseId); - List getAllMockedResponses(UUID clientUUID); - MockedMessageDto getMockedResponse(UUID clientUUID, int mockedResponseId); + Optional getMockedMessageByClientUUID(UUID clientUUID); + MockedMessageDto getMockedResponse(UUID clientUUID); ResponseEntity setMockedResponse(MockedMessageDto mockedMessageDto); } diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java index ce16bb2..08f3569 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/KlausServiceImpl.java @@ -13,16 +13,15 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; -import java.util.List; import java.util.Optional; import java.util.UUID; -import java.util.stream.Collectors; /** * Service for {@link com.r11.tools.controller.MockController} and {@link com.r11.tools.controller.MockController} * Allows for performing CRUD operations on {@link MockedMessageDto} * @author Rafał Żukowicz * @author Gabriel Modzelewski + * @author Mikołaj Widła */ @Service @AllArgsConstructor @@ -31,20 +30,6 @@ public class KlausServiceImpl implements KlausService { private final Logger log = LogManager.getRootLogger(); private final MockedResponseRepository mockedResponseRepository; - /** - * Removes message of given id in given key-uuid set - * @param clientUUID the key-uuid of given set of messages - * @param mockedResponseId unique id of given message - * @return confirmation and status 200 OK - */ - @Override - public ResponseEntity deleteMockedResponse(UUID clientUUID, int mockedResponseId) { - String key = clientUUID.toString() + "_" + mockedResponseId; - mockedResponseRepository.deleteById(key); - log.info("Message: "+mockedResponseId+" has been removed."); - return new ResponseEntity<>("MockedResponse has been removed successfully", - new HttpHeaders(), HttpStatus.ACCEPTED); - } /** * Returns all messages of given key-uuid @@ -52,28 +37,23 @@ public class KlausServiceImpl implements KlausService { * @return List of {@link MockedMessageDto} */ @Override - public List getAllMockedResponses(UUID clientUUID){ - Optional> listOptional = mockedResponseRepository.findAllByClientUUID(clientUUID); - log.info("Messages for UUID: "+clientUUID+" has been fetched from DB."); - return listOptional.map(mockedMessages -> mockedMessages.stream() - .map(mockedMessageMapper::mockedMessageToMockedMessageDto) - .collect(Collectors.toList())).orElse(List.of()); + public Optional getMockedMessageByClientUUID(UUID clientUUID){ + Optional mockedMessageOptional = mockedResponseRepository.findAllByClientUUID(clientUUID); + log.info("Message for UUID: "+clientUUID+" has been fetched from DB."); + return mockedMessageMapper.optionalMockedMessageToOptionalMockedMessageDTO(mockedMessageOptional); } /** * Returns {@link MockedMessageDto} of given id and key-uuid. If message doesn't then empty message is returned * @param clientUUID the key-uuid of given set of messages - * @param mockedResponseId unique id of given message * @return {@link MockedMessageDto} object */ @SneakyThrows @Override - public MockedMessageDto getMockedResponse(UUID clientUUID, int mockedResponseId){ - String key = clientUUID.toString() + "_" + mockedResponseId; - Optional optionalMockedMessage = mockedResponseRepository.findById(key); + public MockedMessageDto getMockedResponse(UUID clientUUID){ + Optional optionalMockedMessage = mockedResponseRepository.findById(clientUUID); MockedMessageDto mockedMessageDto = MockedMessageDto.builder() .clientUUID(clientUUID) - .mockedResponseId(mockedResponseId) .build(); if (optionalMockedMessage.isPresent()) { mockedMessageDto = mockedMessageMapper.mockedMessageToMockedMessageDto(optionalMockedMessage.get()); diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java index ffe3ed5..e784676 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java @@ -33,9 +33,8 @@ public class RequestHistoryServiceImpl implements RequestHistoryService { */ @Override public List getHistoryRecordsBetweenDatesAndByUUIDAndMessageId(HistoryRequestModel historyRequestModel) { - List history = repository.findAllByClientUUIDAndMessageID( - historyRequestModel.getClientUUID().toString(), - historyRequestModel.getMockedResponseId() + List history = repository.findAllByClientUUID( + historyRequestModel.getClientUUID().toString() ); Collections.sort(history); diff --git a/Frontend/assets/css/tools/mock/r11tool.css b/Frontend/assets/css/tools/mock/r11tool.css index 9368b0b..9fafa2b 100644 --- a/Frontend/assets/css/tools/mock/r11tool.css +++ b/Frontend/assets/css/tools/mock/r11tool.css @@ -62,10 +62,6 @@ body { width: 90%; } -.tool.extended .tool-context { - width: 75%; -} - .tool.extended .tool-extention { width: 20%; padding-top: 2%; diff --git a/Frontend/assets/scripts/tools/mock/datatransfer.js b/Frontend/assets/scripts/tools/mock/datatransfer.js index 34945a2..7d002e2 100644 --- a/Frontend/assets/scripts/tools/mock/datatransfer.js +++ b/Frontend/assets/scripts/tools/mock/datatransfer.js @@ -217,19 +217,19 @@ function initializeMock(index){ clearMock(); fillStaticFields(json[index].clientUUID , json[index].mockedResponseId - , json[index].mediaType + , json[index].contentType , json[index].messageBody , json[index].httpStatus); fillHeaderTable(json[index].httpHeaders); } -function fillStaticFields(uuid, id, mediaType, body, httpStatus){ +function fillStaticFields(uuid, id, contentType, body, httpStatus){ let link = createLink(uuid,id); let linkHtml = ''+link+''; $('#messageLink').html(linkHtml); $('#httpStatus').val(httpStatus); $('#uuid-input').val(uuid); - $('#typeSelector').val(mediaType); + $('#typeSelector').val(contentType); $('#bodyEditor').val(body); $('#mockedMessageId').html(id); @@ -401,7 +401,7 @@ function fillMessageList(){ $("#listItems").html(''); var innerHTML = ''; for(let i=0; i' + '
    ' + @@ -515,8 +515,7 @@ function generateJson(){ var newJson = { clientUUID: json[jsonIndex].clientUUID, - mockedResponseId: json[jsonIndex].mockedResponseId, - mediaType: $('#typeSelector').val(), + contentType: $('#typeSelector').val(), messageBody: $('#bodyEditor').val(), httpStatus: $('#httpStatus').val(), httpHeaders: {}, diff --git a/Frontend/tools/mock.html b/Frontend/tools/mock.html index 837c834..e0c26b0 100644 --- a/Frontend/tools/mock.html +++ b/Frontend/tools/mock.html @@ -43,36 +43,9 @@

    MockedServices

    -
    - -
    -
    - - -
    -
    - - -
    -
    - -
    - - - - - - - -
    - -
    -

    Your Message

    -

    Messaged id: 1

    +

    Your Message

    @@ -195,18 +168,6 @@
    -
    - -
    -

    Message List

    -
    - -
    -
    -
    - -
    -
    From 5b69fd1de0b5d188645b0d816625e6b58ca01b8c Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Tue, 23 May 2023 08:59:09 +0200 Subject: [PATCH 45/59] Every service meant to be public work now on port 80 (#205) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/205 Reviewed-by: Mikolaj Widla --- Backend-libXML/main.py | 10 ++++---- .../assets/scripts/tools/mock/datatransfer.js | 2 +- .../assets/scripts/tools/mock/uianimation.js | 8 ++++--- Frontend/assets/scripts/tools/scripts.js | 23 +++++++++---------- Frontend/nginx.conf | 18 +++++++++++++++ Frontend/tools/jsonFormatter.html | 2 +- Samples/minimize/minimize.curl | 2 +- Samples/prettify/prettify.curl | 2 +- Samples/xpath/non-ns.curl | 4 ++-- Samples/xpath/ns.curl | 4 ++-- Samples/xsd/xsd.curl | 4 ++-- Samples/xslt/xslt.curl | 4 ++-- docker-compose.yml | 2 +- 13 files changed, 52 insertions(+), 33 deletions(-) diff --git a/Backend-libXML/main.py b/Backend-libXML/main.py index 4445cab..e4fefe5 100644 --- a/Backend-libXML/main.py +++ b/Backend-libXML/main.py @@ -9,11 +9,11 @@ import Parser app = Flask(__name__) CORS(app) -cors = CORS(app, resource={ - r"/*":{ - "origins":"*" - } -}) +# cors = CORS(app, resource={ +# r"/*":{ +# "origins":"*" +# } +# }) def process_xml(request: request, type: str) -> str: """Function to process diff --git a/Frontend/assets/scripts/tools/mock/datatransfer.js b/Frontend/assets/scripts/tools/mock/datatransfer.js index 34945a2..f1f0811 100644 --- a/Frontend/assets/scripts/tools/mock/datatransfer.js +++ b/Frontend/assets/scripts/tools/mock/datatransfer.js @@ -4,7 +4,7 @@ var json = {}; var jsonIndex = 0; var lastId = 1; var htable_row = 0; -var host = window.location.protocol + "//" + window.location.hostname + ":8097"; +var host = window.location.protocol + "//" + window.location.hostname + "/mock"; var dataModified = false; const addMessageName = 'addMessage'; const loadMessageName = 'changeMessage'; diff --git a/Frontend/assets/scripts/tools/mock/uianimation.js b/Frontend/assets/scripts/tools/mock/uianimation.js index 7340b83..66b6625 100644 --- a/Frontend/assets/scripts/tools/mock/uianimation.js +++ b/Frontend/assets/scripts/tools/mock/uianimation.js @@ -78,7 +78,8 @@ function showHeadersHistory(element){ } async function formatJSON(json) { - const address = window.location.protocol + "//" + window.location.hostname + ":" + 8081 + "/json/formatting"; + const backend = "java"; + const address = window.location.protocol + "//" + window.location.hostname + "/" + backend + "/json/formatting"; var init = { body: json, @@ -98,7 +99,8 @@ async function formatJSON(json) { } async function formatXML(xml) { - const address = window.location.protocol + "//" + window.location.hostname + ":" + 8082 + "/prettify"; + const backend = "libxml"; + const address = window.location.protocol + "//" + window.location.hostname + "/" + backend + "/prettify"; var data = { data: xml, process: "", @@ -140,7 +142,7 @@ function showRequestBody(element){ }); break; } - case "application/xml":{ + case "application/xml": { formatXML(historyRequestBody).then(function(result) { if (result.status == "OK") { popupContent.innerText = result.result; diff --git a/Frontend/assets/scripts/tools/scripts.js b/Frontend/assets/scripts/tools/scripts.js index 3532208..729ee8e 100644 --- a/Frontend/assets/scripts/tools/scripts.js +++ b/Frontend/assets/scripts/tools/scripts.js @@ -76,7 +76,7 @@ function clearDataField() { */ function fillDefaultXML(element) { if (element.classList.contains("active")) { - const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; + const serverAddress = window.location.protocol + "//" + window.location.hostname; clearDefaultContent(document.getElementById("xmlArea"), "Insert XML here"); fetch(serverAddress + "/assets/samples/sampleXml.xml") .then(response => response.text()) @@ -100,7 +100,7 @@ function fillDefaultXML(element) { * @returns {void} */ function fillDefaultXSD(){ - const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; + const serverAddress = window.location.protocol + "//" + window.location.hostname; fetch(serverAddress + "/assets/samples/sampleXSD.xsd") .then( response => response.text() ) .then( (XSDSchema) => { @@ -126,7 +126,7 @@ function fillDefaultXSD(){ * @returns {void} */ function fillDefaultXSLT() { - const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; + const serverAddress = window.location.protocol + "//" + window.location.hostname; fetch(serverAddress + "/assets/samples/XSLTTemplate.xslt") .then( response => response.text() ) .then( (XSTLTemplate) => { @@ -277,9 +277,9 @@ function performRequest(endpoint, checkXML, checkTransform) { var xmlData = document.getElementById(sourceId).innerText.trim(); var transformData = document.getElementById(transformId).innerText.trim(); - var port = 8081; + var backend = "java"; if (getProcessor() == "libxml") { - port = 8082; + backend = "libxml"; } var empty = false; @@ -293,7 +293,7 @@ function performRequest(endpoint, checkXML, checkTransform) { empty = true; } if (!empty) { - restRequest(port, endpoint, xmlData, transformData).then(function (result) { + restRequest(backend, endpoint, xmlData, transformData).then(function (result) { document.getElementById("resultArea").innerText = result.result; highlightSyntax("resultArea"); document.getElementById("procinfo").innerText = ' Computed using ' + result.processor; @@ -333,7 +333,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) { const sourceElement = document.getElementById(sourceId); const targetElement = document.getElementById(targetId); const infoElement = document.getElementById("formatinfo"); - const port = 8082; + const backend = "libxml"; var xmlData = sourceElement.innerText.trim(); var empty = false; @@ -344,7 +344,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) { } if (!empty) { - restRequest(port, endpoint, xmlData, "").then(function (result) { + restRequest(backend, endpoint, xmlData, "").then(function (result) { if (result.status == "OK") { targetElement.innerText = result.result.trim(); highlightSyntax(targetElement.id); @@ -374,16 +374,15 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) { * @function * @name restRequest * @kind function -* @param {any} port of target service +* @param {any} backend target backend * @param {any} endpoint of target service * @param {any} xmlData XML that will be sent * @param {any} transformData data used to transform given XML * @returns {Promise} */ -async function restRequest(port, endpoint, xmlData, transformData) { - const escapeChar = "specialEscapeChar"; +async function restRequest(backend, endpoint, xmlData, transformData) { - const addr = window.location.protocol + "//" + window.location.hostname + ":" + port + "/" + endpoint; + const addr = window.location.protocol + "//" + window.location.hostname + "/" + backend + "/" + endpoint; if (defaultStrings.includes(xmlData)) { xmlData = ""; diff --git a/Frontend/nginx.conf b/Frontend/nginx.conf index e52fbb2..74e93e6 100644 --- a/Frontend/nginx.conf +++ b/Frontend/nginx.conf @@ -12,8 +12,26 @@ server { add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; } + location /java/ { + proxy_pass http://xmltools-backend:8081/; + proxy_set_header Host $host; + } + + location /libxml/ { + proxy_pass http://xmltools-libxml-backend/; + proxy_set_header Host $host; + } + + location /mock/ { + proxy_pass http://xmltools-mocked-services:8097/; + proxy_set_header Host $host; + proxy_set_header Content-Type $http_content_type; + } + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; diff --git a/Frontend/tools/jsonFormatter.html b/Frontend/tools/jsonFormatter.html index 8081f02..59eee48 100644 --- a/Frontend/tools/jsonFormatter.html +++ b/Frontend/tools/jsonFormatter.html @@ -31,7 +31,7 @@ + onclick="insertDefaultJson()">Insert default JSON
    diff --git a/Samples/minimize/minimize.curl b/Samples/minimize/minimize.curl
    index 3a74ae5..3a94a93 100644
    --- a/Samples/minimize/minimize.curl
    +++ b/Samples/minimize/minimize.curl
    @@ -1,3 +1,3 @@
    -url = "http://localhost:5000/minimize"
    +url = "http://localhost/libxml/minimize"
     data = "@minimize.json"
     request = POST
    diff --git a/Samples/prettify/prettify.curl b/Samples/prettify/prettify.curl
    index a10aa88..fc3ab49 100644
    --- a/Samples/prettify/prettify.curl
    +++ b/Samples/prettify/prettify.curl
    @@ -1,3 +1,3 @@
    -url = "http://localhost:5000/prettify"
    +url = "http://localhost:5000/libxml/prettify"
     data = "@prettify.json"
     request = POST
    diff --git a/Samples/xpath/non-ns.curl b/Samples/xpath/non-ns.curl
    index b54c5b6..e6af844 100644
    --- a/Samples/xpath/non-ns.curl
    +++ b/Samples/xpath/non-ns.curl
    @@ -1,4 +1,4 @@
    -#url = "localhost:8081/xpath"
    -url = "localhost:5000/xpath"
    +url = "localhost/java/xpath"
    +#url = "localhost/libxml/xpath"
     request = "POST"
     data = "@data.json"
    diff --git a/Samples/xpath/ns.curl b/Samples/xpath/ns.curl
    index 46c6341..c55e0fe 100644
    --- a/Samples/xpath/ns.curl
    +++ b/Samples/xpath/ns.curl
    @@ -1,4 +1,4 @@
    -#url = "localhost:8081/xpath"
    -url = "localhost:5000/xpath"
    +url = "localhost/java/xpath"
    +#url = "localhost/libxml/xpath"
     request = "POST"
     data = "@dataNS.json"
    diff --git a/Samples/xsd/xsd.curl b/Samples/xsd/xsd.curl
    index 922856c..8de3bdd 100644
    --- a/Samples/xsd/xsd.curl
    +++ b/Samples/xsd/xsd.curl
    @@ -1,4 +1,4 @@
    -#url = "http://localhost:8081/xsd"
    -url = "http://localhost:5000/xsd"
    +url = "localhost/java/xsd"
    +#url = "localhost/libxml/xsd"
     data = "@xsd.json"
     request = POST
    diff --git a/Samples/xslt/xslt.curl b/Samples/xslt/xslt.curl
    index 712c82c..22adc0f 100644
    --- a/Samples/xslt/xslt.curl
    +++ b/Samples/xslt/xslt.curl
    @@ -1,4 +1,4 @@
    -#url = "http://localhost:8081/xslt"
    -url = "http://localhost:5000/xslt"
    +url = "localhost/java/xslt"
    +#url = "localhost/libxml/xslt"
     data = "@xslt.json"
     request = POST
    diff --git a/docker-compose.yml b/docker-compose.yml
    index c9e1120..eea1c0c 100644
    --- a/docker-compose.yml
    +++ b/docker-compose.yml
    @@ -10,7 +10,7 @@ services:
             container_name: xmltools-frontend
             image: xmltools-frontend
             ports:
    -            - 8086:80
    +            - 80:80
     
         xmltools-backend:
             build: ./Backend/tools-services
    
    From 02c10b8354470ee98155ba69d4a8bf42be86aec8 Mon Sep 17 00:00:00 2001
    From: Adam Bem 
    Date: Tue, 23 May 2023 13:48:22 +0200
    Subject: [PATCH 46/59] Fixed not working JSON arrays (#206)
    
    Co-authored-by: Adam Bem 
    Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/206
    Reviewed-by: Mikolaj Widla 
    ---
     .../com/r11/tools/controller/JsonController.java     | 12 ++++++------
     1 file changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java b/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java
    index 8574c3b..e42f277 100644
    --- a/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java
    +++ b/Backend/tools-services/src/main/java/com/r11/tools/controller/JsonController.java
    @@ -1,8 +1,7 @@
     package com.r11.tools.controller;
     
    -import com.google.gson.Gson;
    +import com.google.gson.*;
     //import com.google.gson.GsonBuilder;
    -import com.google.gson.JsonObject;
     import com.r11.tools.controller.internal.GlobalControllerManifest;
     import com.r11.tools.controller.internal.HandlerType;
     import com.r11.tools.controller.internal.RestController;
    @@ -11,6 +10,9 @@ import spark.Request;
     import spark.Response;
     import org.apache.logging.log4j.Logger;
     
    +import java.util.List;
    +import java.util.Map;
    +
     @GlobalControllerManifest(path = "/json")
     public class JsonController implements RestController {
     
    @@ -32,9 +34,7 @@ public class JsonController implements RestController {
             JsonObject responseJson = new JsonObject();
     
             try {
    -            JsonObject requestJson = this.gson.fromJson(request.body(), JsonObject.class);
    -
    -            response.status(200);
    +            Object requestJson = this.gson.fromJson(request.body(), Object.class);
     
                 responseJson.addProperty("data", this.prettyGson.toJson(requestJson));
                 responseJson.addProperty("time", System.currentTimeMillis() - startProcess);
    @@ -61,7 +61,7 @@ public class JsonController implements RestController {
             JsonObject responseJson = new JsonObject();
     
             try {
    -            JsonObject requestJson = this.prettyGson.fromJson(request.body(), JsonObject.class);
    +            Object requestJson = this.prettyGson.fromJson(request.body(), Object.class);
     
                 response.status(200);
     
    
    From f9b426bb305f848c8706c2cff8a7c41c1c07f6e8 Mon Sep 17 00:00:00 2001
    From: Adam Bem 
    Date: Wed, 24 May 2023 10:33:00 +0200
    Subject: [PATCH 47/59] Every tool can now be accessed from URL
    
    ---
     Frontend/assets/scripts/frame.js | 23 ++++++++++-------------
     1 file changed, 10 insertions(+), 13 deletions(-)
    
    diff --git a/Frontend/assets/scripts/frame.js b/Frontend/assets/scripts/frame.js
    index 00f61c6..7de1e74 100644
    --- a/Frontend/assets/scripts/frame.js
    +++ b/Frontend/assets/scripts/frame.js
    @@ -1,17 +1,5 @@
     const tools = new Map();
     
    -/**
    - * Get address of Mock Services
    - * 
    - * @function
    - * @name getMockHost
    - * @kind function
    - * @returns {string}
    - */
    -function getMockHost() {
    -    return window.location.protocol + "//" + window.location.hostname + ":8097";
    -}
    -
     /**
      * Function called after page is loaded
      * 
    @@ -30,7 +18,15 @@ function init() {
         tools.set("mock", "tools/mock.html");
     
         changeActiveTools('XML');
    -    loadLastPage();
    +    var toolUrl = window.location.search.substring(1);
    +    if (toolUrl == "") {
    +        loadLastPage();
    +    }
    +    else if (tools.has(toolUrl)) {
    +        changeTool(toolUrl);
    +
    +    }
    +    
     }
     
     /**
    @@ -81,6 +77,7 @@ function changeTool(tool) {
         const url = tools.get(tool);
         localStorage.setItem("lastPage", tool);
         document.getElementById("iframe").src = url;
    +    window.location.search = tool;
     }
     
     /**
    
    From ecafb17f05fcb5dd65840aa80b05de5794c8c742 Mon Sep 17 00:00:00 2001
    From: Adam Bem 
    Date: Wed, 24 May 2023 11:06:50 +0200
    Subject: [PATCH 48/59] revert f9b426bb305f848c8706c2cff8a7c41c1c07f6e8
    
    revert Every tool can now be accessed from URL
    ---
     Frontend/assets/scripts/frame.js | 23 +++++++++++++----------
     1 file changed, 13 insertions(+), 10 deletions(-)
    
    diff --git a/Frontend/assets/scripts/frame.js b/Frontend/assets/scripts/frame.js
    index 7de1e74..5202eef 100644
    --- a/Frontend/assets/scripts/frame.js
    +++ b/Frontend/assets/scripts/frame.js
    @@ -1,5 +1,17 @@
     const tools = new Map();
     
    +/**
    + * Get address of Mock Services
    + *
    + * @function
    + * @name getMockHost
    + * @kind function
    + * @returns {string}
    + */
    +function getMockHost() {
    +    return window.location.protocol + "//" + window.location.hostname + ":8097";
    +}
    +
     /**
      * Function called after page is loaded
      * 
    @@ -18,15 +30,7 @@ function init() {
         tools.set("mock", "tools/mock.html");
     
         changeActiveTools('XML');
    -    var toolUrl = window.location.search.substring(1);
    -    if (toolUrl == "") {
    -        loadLastPage();
    -    }
    -    else if (tools.has(toolUrl)) {
    -        changeTool(toolUrl);
    -
    -    }
    -    
    +    loadLastPage();
     }
     
     /**
    @@ -77,7 +81,6 @@ function changeTool(tool) {
         const url = tools.get(tool);
         localStorage.setItem("lastPage", tool);
         document.getElementById("iframe").src = url;
    -    window.location.search = tool;
     }
     
     /**
    
    From 8815f657e07c213cd18ec4ce91abc0139c852a0b Mon Sep 17 00:00:00 2001
    From: widlam 
    Date: Wed, 24 May 2023 11:08:15 +0200
    Subject: [PATCH 49/59] Clean frontend code
    
    ---
     .../controller/RequestHistoryController.java  |   6 +-
     .../tools/service/RequestHistoryService.java  |   2 +-
     .../service/RequestHistoryServiceImpl.java    |   2 +-
     .../assets/scripts/tools/mock/datatransfer.js | 331 ++----------------
     .../scripts/tools/mock/historyloader.js       |   5 +-
     .../assets/scripts/tools/mock/uianimation.js  |   4 +-
     Frontend/tools/mock.html                      |  37 --
     7 files changed, 42 insertions(+), 345 deletions(-)
    
    diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java b/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java
    index 74a63c9..0a0c114 100644
    --- a/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java
    +++ b/Backend/mocked-services/src/main/java/com/r11/tools/controller/RequestHistoryController.java
    @@ -37,7 +37,7 @@ public class RequestHistoryController {
         @PostMapping
         public ResponseEntity> filterHistory(@RequestBody HistoryRequestModel historyRequestModel){
             return ResponseEntity.ok(
    -                service.getHistoryRecordsBetweenDatesAndByUUIDAndMessageId(historyRequestModel)
    +                service.getHistoryRecordsBetweenDatesAndByUUID(historyRequestModel)
                             .stream()
                             .map(mapper::requestHistoryToRequestHistoryDTO)
                             .collect(Collectors.toList())
    @@ -49,11 +49,11 @@ public class RequestHistoryController {
          * @param uuid unique id of message list
          * @return list of {@link RequestHistory}
          */
    -    @GetMapping(path = "/{uuid}/{messageId}")
    +    @GetMapping(path = "/{uuid}")
         public ResponseEntity> getLastDay(@PathVariable UUID uuid){
             LocalDateTime requestTime = LocalDateTime.now();
             LocalDateTime dayBeforeRequest = requestTime.minusDays(1L);
    -        List requestHistory = service.getHistoryRecordsBetweenDatesAndByUUIDAndMessageId(
    +        List requestHistory = service.getHistoryRecordsBetweenDatesAndByUUID(
                     HistoryRequestModel.builder()
                             .localDateTimeFrom(dayBeforeRequest)
                             .localDateTimeTo(requestTime)
    diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryService.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryService.java
    index 1f8042a..f3d492d 100644
    --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryService.java
    +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryService.java
    @@ -18,6 +18,6 @@ public interface RequestHistoryService {
          * @param historyRequestModel object containing required data for request
          * @return list of {@link RequestHistory}
          */
    -    List getHistoryRecordsBetweenDatesAndByUUIDAndMessageId(HistoryRequestModel historyRequestModel);
    +    List getHistoryRecordsBetweenDatesAndByUUID(HistoryRequestModel historyRequestModel);
         void saveRequest(RequestHistoryDTO requestDTO);
     }
    diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java
    index e784676..f327679 100644
    --- a/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java
    +++ b/Backend/mocked-services/src/main/java/com/r11/tools/service/RequestHistoryServiceImpl.java
    @@ -32,7 +32,7 @@ public class RequestHistoryServiceImpl implements RequestHistoryService {
          * @return list of {@link RequestHistory}
          */
         @Override
    -    public List getHistoryRecordsBetweenDatesAndByUUIDAndMessageId(HistoryRequestModel historyRequestModel) {
    +    public List getHistoryRecordsBetweenDatesAndByUUID(HistoryRequestModel historyRequestModel) {
             List history = repository.findAllByClientUUID(
                     historyRequestModel.getClientUUID().toString()
                     );
    diff --git a/Frontend/assets/scripts/tools/mock/datatransfer.js b/Frontend/assets/scripts/tools/mock/datatransfer.js
    index 7d002e2..2824d76 100644
    --- a/Frontend/assets/scripts/tools/mock/datatransfer.js
    +++ b/Frontend/assets/scripts/tools/mock/datatransfer.js
    @@ -2,16 +2,11 @@ var clientUUID = '';
     var advancedDisplayed = false;
     var json = {};
     var jsonIndex = 0;
    -var lastId = 1;
     var htable_row = 0;
     var host = window.location.protocol + "//" + window.location.hostname + ":8097";
     var dataModified = false;
    -const addMessageName = 'addMessage';
    -const loadMessageName = 'changeMessage';
    -const removeMessageName = 'removeMessage';
     
     const C_UUID = 'mock-uuid';
    -const C_ID = 'last-displayed-id';
     const C_ADV = 'advanced-mode';
     
     const color_red = "#ff8f8f";
    @@ -30,24 +25,29 @@ const getUpdate = function(){
     const dataRefresh = function(){
         getData();
     }
    -$('#btn-newtile').click(function(){callAddMessage()});
    -// $('#btn-addRow').click(function(){addRow()});
    -// $('#btn-save').click(getUpdate);
     
     function getData(){
         $.getJSON(host + '/api/mock/'+clientUUID, function(data) {
    +        console.log(data)
             json = data;
    -        checkUuid();
    -        
    -        
    -        refreshData();
    +        initializeUUID();
    +        loadMessage();
         });
     }
     
    +function loadCookies(){
    +    clientUUID = getCookie(C_UUID);
    +    advancedDisplayed = getCookie(C_ADV) == 'true';
    +}
     
    -function checkUuid(){
    +function setCookie(){
    +    document.cookie = C_UUID + '=' +clientUUID;
    +    document.cookie = C_ADV + '=' + advancedVisibility;
    +}
    +
    +function initializeUUID(){
         if(clientUUID == null || clientUUID == undefined || clientUUID == ''){
    -        clientUUID = json[0].clientUUID;
    +        clientUUID = json.clientUUID;
             setCookie();
         }
     }
    @@ -86,43 +86,6 @@ function setDataOrigin(){
         $('#btn-save').off();
     }
     
    -const idToDisplay = function(){
    -    let defaultId = json[0].mockedResponseId;
    -    if(lastId == undefined || lastId == null) return defaultId;
    -    for(let i=0; i 0){
    -        jsonIndex -= 1;
    -        return json[jsonIndex].mockedResponseId;
    -    } 
    -    return defaultId;
    -}
    -
    -function refreshData(){
    -    $("#uuid-input").val(clientUUID);
    -    fillMessageList();
    -    
    -    let id = idToDisplay();
    -    
    -    loadMessage(id);
    -    
    -}
    -
    -function setCookie(){
    -    document.cookie = C_UUID + '=' +clientUUID;
    -    document.cookie = C_ID + '=' + lastId;
    -    document.cookie = C_ADV + '=' + advancedVisibility;
    -}
    -
    -function loadCookies(){
    -    clientUUID = getCookie(C_UUID);
    -    lastId = getCookie(C_ID);
    -    advancedDisplayed = getCookie(C_ADV) == 'true';
    -}
    -
     function getCookie(cname) {
         var name = cname + '=';
         var decodedCookie = decodeURIComponent(document.cookie);
    @@ -139,28 +102,11 @@ function getCookie(cname) {
         return '';
     }
     
    -function callMethodByName(methodObject){
    -    let name = methodObject.name;
    -    let id = methodObject.id;
    -    switch(name){
    -        case addMessageName: 
    -            addMessage();
    -            break;
    -        case loadMessageName:
    -            loadMessage(id);
    -            break;
    -        case removeMessageName:
    -            removeMessage(id);
    -            break;
    -    }
    -}
    -
    -
     function updateData(){
         var updatedJson = generateJson();
         const dataSaved = function () {
             setDataOrigin();
    -        refreshData();
    +        loadMessage();
             savedModalDisplay();
         }
         $.ajax({
    @@ -171,156 +117,33 @@ function updateData(){
         }).done(dataSaved);
     }
     
    -function callAddMessage(){
    -    if(dataModified){
    -        setMethodToCall(addMessageName, null);
    -        dataLossModalDisplay();
    -    }
    -    else {
    -        addMessage();
    -    }
    -}
    -
    -function addMessage(){
    -    $.ajax({
    -        url: host + '/api/mock/'+clientUUID,
    -        type: 'POST',
    -    }).done(dataRefresh);
    -}
    -
    -function callRemoveMessage(id){
    -    if(dataModified){
    -        setMethodToCall(removeMessageName, id);
    -        dataLossModalDisplay();
    -    }
    -    else {
    -        removeMessage(id);
    -    }
    -}
    -
    -function removeMessage(id){
    -    var jsonObject = findJsonById(id);
    -    $.ajax({
    -        url: host + '/api/mock/'+clientUUID + '/' + id,
    -        type: 'DELETE',
    -    }).done(dataRefresh);
    -}
    -
    -
     function clearMock(){
         fillStaticFields('','','','');
         htable_row = 0;
         $('#httpStatusValues').html('');
     }
     
    -function initializeMock(index){
    +function initializeMock(){
             clearMock();
    -        fillStaticFields(json[index].clientUUID
    -            , json[index].mockedResponseId
    -            , json[index].contentType
    -            , json[index].messageBody
    -            , json[index].httpStatus);
    -        fillHeaderTable(json[index].httpHeaders);
    +        fillStaticFields(
    +            json.clientUUID,
    +            json.contentType,
    +            json.messageBody,
    +            json.httpStatus);
    +        fillHeaderTable(json.httpHeaders);
     }
     
    -function fillStaticFields(uuid, id, contentType, body, httpStatus){
    -    let link = createLink(uuid,id);
    +function fillStaticFields(uuid, contentType, body, httpStatus){
    +    let link = createLink(uuid);
         let linkHtml = ''+link+'';
         $('#messageLink').html(linkHtml);
         $('#httpStatus').val(httpStatus);
    -    $('#uuid-input').val(uuid);
         $('#typeSelector').val(contentType);
         $('#bodyEditor').val(body);
    -    $('#mockedMessageId').html(id);
    -
     }
     
    -function changeEditionOfUUID(element){
    -
    -    var inputFieldId= "#uuid-input"
    -    var inputFieldDiv = "#uuid-edit-field"
    -    if(element.checked){
    -        $(inputFieldId).removeAttr('disabled');
    -        $(inputFieldDiv).removeClass('disabled');
    -    } else{
    -        $(inputFieldId).attr('disabled', true);
    -        $(inputFieldDiv).addClass('disabled');
    -    }
    -}
    -
    -function copyUUIDToClipboard(){
    -    navigator.clipboard.writeText( document.getElementById('uuid-input').value );
    -}
    -
    -
    -async function fetchUUIDCheck(givenUUID , strategy){
    -    var newUUID = "UUID" ;
    -    url = host + "/api/mock/check/";
    -
    -    switch(strategy){
    -        case "new":{
    -            await fetch(url + givenUUID+ "/", { method : "GET" })
    -                .then ( response => response.text() )
    -                .then ( data => {
    -                    newUUID = data;
    -                    
    -                } )
    -            break;
    -        }
    -        case "restore":{
    -            await fetch(url + givenUUID + "/" + clientUUID + "/" , { method: "GET" })
    -                .then (response => response.text() )
    -                .then (data => {
    -                    newUUID = data;
    -                    
    -                } )
    -            break;
    -        }
    -    }
    -    return newUUID ;
    -}
    -
    -function checkUUIDChars(uuid) {
    -    uuid.replace(/ /g,'')
    -    const regex = new RegExp("^[A-z0-9-]+$");
    -    
    -    if(regex.test(uuid) && uuid != ""){
    -        return uuid ;
    -    } 
    -    return "invalid";
    - }
    -
    -function changeUUID(element){
    -
    -    const uuidStrategy = $('input[name="uuid-validation-type"]:checked').val();
    -    const givenUUID = checkUUIDChars(element.value);
    -
    -    if( givenUUID == clientUUID ){
    -        $("#uuid-input").attr("disabled", true);
    -        uuidChangeModalDisplay("noChg");
    -        return;
    -    }
    -
    -    var newUUID = fetchUUIDCheck(givenUUID , uuidStrategy);
    -    var changeMessage = uuidStrategy;
    -    newUUID
    -    .then( data => {
    -        if (givenUUID == data) { 
    -            changeMessage = "success";
    -        }
    -        clientUUID = data;
    -        $("#editable").attr("checked", false);
    -        
    -        uuidChangeModalDisplay(changeMessage);
    -        document.cookie = C_UUID + '=' + data ;
    -    } )
    -    loadCookies();
    -    refreshData();
    -}
    -
    -
    -function createLink(uuid, id){
    -    var link =  host + '/api/mock/r/'+uuid+'/'+id;
    +function createLink(uuid){
    +    var link =  host + '/api/mock/r/'+uuid;
         return link;
     }
     
    @@ -396,105 +219,19 @@ function buildRowHtml(key, value){
         '';
     }
     
    -
    -function fillMessageList(){
    -    $("#listItems").html('');
    -    var innerHTML = '';
    -    for(let i=0; i' +
    -        '
    ' + - '
    ' + - '
    ' + - '

    Id: ' + id + '

    ' + - '

    Status: ' + httpStatus + '

    ' + - '
    ' + - '
    ' + - '' + - '
    ' + - '
    ' + - '
    ' + - '
    '; - return innerHTML; -} - - - const onbuild = function(){ loadCookies(); getData(); @@ -509,12 +246,10 @@ function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } - - function generateJson(){ var newJson = { - clientUUID: json[jsonIndex].clientUUID, + clientUUID: json.clientUUID, contentType: $('#typeSelector').val(), messageBody: $('#bodyEditor').val(), httpStatus: $('#httpStatus').val(), @@ -522,7 +257,7 @@ function generateJson(){ }; newJson['httpHeaders'] = convertTableToJson(); - json[jsonIndex] = newJson; + json = newJson; return newJson; } @@ -537,4 +272,4 @@ function convertTableToJson(){ obj[key] = rows.eq(i).children().eq(1).children().eq(0).val(); } return obj; -} \ No newline at end of file +} diff --git a/Frontend/assets/scripts/tools/mock/historyloader.js b/Frontend/assets/scripts/tools/mock/historyloader.js index 4c54671..2ddfabe 100644 --- a/Frontend/assets/scripts/tools/mock/historyloader.js +++ b/Frontend/assets/scripts/tools/mock/historyloader.js @@ -17,10 +17,9 @@ $('#btn-searchHistory').click(startSearch); function loadHistory(dateFrom, dateTo){ var eventRequest = { - clientUUID : json[jsonIndex].clientUUID, + clientUUID : json.clientUUID, localDateTimeFrom : dateFrom, localDateTimeTo : dateTo, - mockedResponseId : json[jsonIndex].mockedResponseId }; $.ajax({ url: host + '/api/event', @@ -34,7 +33,7 @@ function loadHistory(dateFrom, dateTo){ } function getLast24hHistoryData(){ - $.getJSON(host + '/api/event/' + clientUUID + '/' + lastId, function(data){ + $.getJSON(host + '/api/event/' + clientUUID, function(data){ historyJson = data; displayHistory(); }); diff --git a/Frontend/assets/scripts/tools/mock/uianimation.js b/Frontend/assets/scripts/tools/mock/uianimation.js index 7340b83..9e1751a 100644 --- a/Frontend/assets/scripts/tools/mock/uianimation.js +++ b/Frontend/assets/scripts/tools/mock/uianimation.js @@ -60,9 +60,9 @@ function showHeaders(){ $('#headersTab').off('click'); } -function showHeadersHistory(element){ +function showHeadersHistory(record){ historyTable = ''; - headers = parseHeaders(element.id) + headers = parseHeaders(record.id) headers.forEach( (value,key) => { historyTable += diff --git a/Frontend/tools/mock.html b/Frontend/tools/mock.html index e0c26b0..371b5ed 100644 --- a/Frontend/tools/mock.html +++ b/Frontend/tools/mock.html @@ -68,7 +68,6 @@
    @@ -187,30 +186,6 @@

    To save message, the message must be changed!

    -
    -
    -

    Add new message

    -

    This button adds new message.

    -
    -
    -
    -
    -

    UUID

    -

    UUID is an Unique ID that represents you in API. By UUID your messages is saved in database. You can change it to access your previous configuration of mocked messages

    -
    -
    -
    -
    -

    UUID Checking Strategy

    -

    When you provide invalid UUID you can choose what do with it. You can generate new UUID or restore previous.

    -
    -
    -
    -
    -

    UUID Edition

    -

    Unlocks you ability to edit UUID

    -
    -
    @@ -258,16 +233,6 @@
    - From 97042faaa317c9ecb951155fdfd45325238acb7e Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 24 May 2023 14:40:07 +0200 Subject: [PATCH 50/59] Tools can be selected through URL (solves #161) (#207) Co-authored-by: Adam Bem Reviewed-on: https://gitea.release11.com/R11/release11-tools/pulls/207 Reviewed-by: Mikolaj Widla --- Frontend/assets/scripts/frame.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Frontend/assets/scripts/frame.js b/Frontend/assets/scripts/frame.js index 5202eef..3e2e867 100644 --- a/Frontend/assets/scripts/frame.js +++ b/Frontend/assets/scripts/frame.js @@ -30,7 +30,14 @@ function init() { tools.set("mock", "tools/mock.html"); changeActiveTools('XML'); - loadLastPage(); + var toolUrl = window.location.search.substring(1); + if (toolUrl == "") + loadLastPage(); + else if (tools.has(toolUrl)) + changeTool(toolUrl); + else + loadLastPage(); + } /** @@ -81,6 +88,7 @@ function changeTool(tool) { const url = tools.get(tool); localStorage.setItem("lastPage", tool); document.getElementById("iframe").src = url; + document.location.search = tool; } /** From b733e1e344c1d4ff8d28a39f8d304267ddd204e2 Mon Sep 17 00:00:00 2001 From: widlam Date: Thu, 25 May 2023 14:49:16 +0200 Subject: [PATCH 51/59] Fixed history problem, and improve mock services frontend --- .../com/r11/tools/model/RequestHistory.java | 4 +- .../assets/scripts/tools/mock/datatransfer.js | 137 ++++++++---------- .../assets/scripts/tools/mock/uianimation.js | 16 +- Frontend/tools/mock.html | 2 +- 4 files changed, 62 insertions(+), 97 deletions(-) diff --git a/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java index fe43393..1c17387 100644 --- a/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java +++ b/Backend/mocked-services/src/main/java/com/r11/tools/model/RequestHistory.java @@ -25,11 +25,11 @@ import java.util.Map; @AllArgsConstructor @RedisHash("mockHistory") public class RequestHistory implements Comparable, Serializable { - + @Id + private String id; @DateTimeFormat(pattern = "yyyy-MM-ddTHH:mm:ss") private LocalDateTime dateTimeStamp; @Indexed - @Id private String clientUUID; private Map headers; private HttpMethod httpMethod; diff --git a/Frontend/assets/scripts/tools/mock/datatransfer.js b/Frontend/assets/scripts/tools/mock/datatransfer.js index 2824d76..98f56b2 100644 --- a/Frontend/assets/scripts/tools/mock/datatransfer.js +++ b/Frontend/assets/scripts/tools/mock/datatransfer.js @@ -2,9 +2,7 @@ var clientUUID = ''; var advancedDisplayed = false; var json = {}; var jsonIndex = 0; -var htable_row = 0; var host = window.location.protocol + "//" + window.location.hostname + ":8097"; -var dataModified = false; const C_UUID = 'mock-uuid'; const C_ADV = 'advanced-mode'; @@ -15,9 +13,6 @@ const color_grey = "#6b6b6b"; const setModified = function(){ setDataModified(); } -const setOrigin = function(){ - setDataOrigin(); -} const getUpdate = function(){ updateData(); @@ -26,12 +21,50 @@ const dataRefresh = function(){ getData(); } +/* + Listeners segment +*/ + +$(document).on('change', '.data-field', setModified); + +$('#btn-save').click( + () => { + disableSaveButton(); + } + ); + +$('#btn-newRow').click( + ()=> { + newRowInput(); + setDataModified(); + } + ); + +/* + Functions segment +*/ + +function disableSaveButton(){ + $('#btn-save').removeClass('active'); + $('#btn-save').off(); +} + +function createLink(uuid){ + var link = host + '/api/mock/r/'+uuid; + return link; +} + + +function onLoad(){ + loadCookies(); + getData(); +} + function getData(){ $.getJSON(host + '/api/mock/'+clientUUID, function(data) { - console.log(data) json = data; + loadFetchedMessage(); initializeUUID(); - loadMessage(); }); } @@ -52,13 +85,6 @@ function initializeUUID(){ } } -function getDomain(){ - var url = window.location.href; - var arr = url.split("/"); - var result = arr[0] + "//" + arr[2]; - return result; -} - function httpStatusInvalid(){ value = $('#httpStatus').val(); return value == ''; @@ -71,19 +97,9 @@ function setDataModified(){ document.getElementById("httpStatus").style.backgroundColor = color_red; return; } - dataModified = true; - $('#btn-save').addClass('active'); - $('#btn-save').click(getUpdate); - document.getElementById("httpStatus").style.backgroundColor = null; -} - -//Adding change listener to fields -$('.data-field').change(setModified); - -function setDataOrigin(){ - dataModified = false; - $('#btn-save').removeClass('active'); - $('#btn-save').off(); + $('#btn-save').addClass('active'); + $('#btn-save').click(getUpdate); + document.getElementById("httpStatus").style.backgroundColor = null; } function getCookie(cname) { @@ -103,10 +119,9 @@ function getCookie(cname) { } function updateData(){ - var updatedJson = generateJson(); + var updatedJson = createRequestBody(); const dataSaved = function () { - setDataOrigin(); - loadMessage(); + loadFetchedMessage(); savedModalDisplay(); } $.ajax({ @@ -115,22 +130,18 @@ function updateData(){ data: JSON.stringify(updatedJson, null, 2), contentType: "application/json", }).done(dataSaved); + disableSaveButton(); } -function clearMock(){ - fillStaticFields('','','',''); - htable_row = 0; - $('#httpStatusValues').html(''); -} - -function initializeMock(){ - clearMock(); - fillStaticFields( - json.clientUUID, - json.contentType, - json.messageBody, - json.httpStatus); - fillHeaderTable(json.httpHeaders); +function loadFetchedMessage(){ + fillStaticFields( + json.clientUUID, + json.contentType, + json.messageBody, + json.httpStatus); + fillHeaderTable(json.httpHeaders); + initializeHistory(); + refreshHeaderTable(document.innerHTML); } function fillStaticFields(uuid, contentType, body, httpStatus){ @@ -142,11 +153,6 @@ function fillStaticFields(uuid, contentType, body, httpStatus){ $('#bodyEditor').val(body); } -function createLink(uuid){ - var link = host + '/api/mock/r/'+uuid; - return link; -} - function fillHeaderTable(headers){ var innerHTML = buildHeaderMapHtml(headers); refreshHeaderTable(innerHTML); @@ -154,10 +160,9 @@ function fillHeaderTable(headers){ function refreshHeaderTable(html){ $('#headerMapTable').html(html); - $('.table-map').change(function(){setDataModified()}); $('.btn-hashmap').click(function(){ - $(this).closest('tr').remove(); setDataModified(); + $(this).closest('tr').remove(); }) } @@ -176,19 +181,16 @@ function addRow(key, value){ refreshHeaderTable(headersMapHtml); } -const newRowInput = function(){ +function newRowInput(){ const hName = $('#headerKeyInput'); const hValue = $('#headerValueInput'); if(checkIfInputValid(hName.val()) && checkIfInputValid(hValue.val())){ addRow(hName.val(), hValue.val()); hName.val(null); hValue.val(null); - setDataModified(); } } -$('#btn-newRow').click(newRowInput); - function checkIfInputValid(input){ return !(input == '' || input == null || input == undefined); } @@ -219,34 +221,11 @@ function buildRowHtml(key, value){ ''; } -function loadMessage(){ - setCookie(); - setDataOrigin(); - initializeMock(); - selectMessage(); -} - - -function selectMessage(){ - initializeHistory(); - refreshHeaderTable(document.innerHTML); -} - -const onbuild = function(){ - loadCookies(); - getData(); - if(advancedDisplayed) { - changeAdvancedVisibility(); - } -} - -$(document).ready(onbuild); - function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } -function generateJson(){ +function createRequestBody(){ var newJson = { clientUUID: json.clientUUID, diff --git a/Frontend/assets/scripts/tools/mock/uianimation.js b/Frontend/assets/scripts/tools/mock/uianimation.js index 9e1751a..5c297b6 100644 --- a/Frontend/assets/scripts/tools/mock/uianimation.js +++ b/Frontend/assets/scripts/tools/mock/uianimation.js @@ -227,19 +227,5 @@ $('#btnSave').focusin(function(){focusInTip('btnSaveTip')}); $('#btnSave').mouseleave(function(){hidTip('btnSaveTip')}); $('#btnSave').focusout(function(){focusOutTip('btnSaveTip')}); -$('#new-tile').mouseover(function(){showTip('btn-newTileTip');}); -$('#new-tile').mouseleave(function(){hidTip('btn-newTileTip')}); -$('#new-tile').focusout(function(){focusOutTip('btn-newTileTip')}); - $('#listItems').mouseover(function(){showTip('messagesTip');}); -$('#listItems').mouseleave(function(){hidTip('messagesTip')}); - - -$('#uuid-edit-field').mouseover(function(){ showTip('UUIDFieldTip') }); -$('#uuid-edit-field').mouseleave(function(){ hidTip('UUIDFieldTip') }); - -$('#uuid-validation-strategy').mouseover(function(){ showTip('UUIDValidationStrategyTip') }); -$('#uuid-validation-strategy').mouseleave(function(){ hidTip('UUIDValidationStrategyTip') }); - -$('#editableBlock').mouseover( function(){ showTip('UUIDEditionTip') } ); -$('#editableBlock').mouseleave(function(){ hidTip('UUIDEditionTip') }); \ No newline at end of file +$('#listItems').mouseleave(function(){hidTip('messagesTip')}); \ No newline at end of file diff --git a/Frontend/tools/mock.html b/Frontend/tools/mock.html index 371b5ed..8805a5d 100644 --- a/Frontend/tools/mock.html +++ b/Frontend/tools/mock.html @@ -8,7 +8,7 @@ - +