From 6aa0faf18d65e92b289dd2eca7b54d91768cbb3f Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Mon, 6 Mar 2023 12:40:37 +0100 Subject: [PATCH 1/5] Added descriptions for boolean --- Frontend/tools/xpath.html | 127 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 9179a2f..bcdf577 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -342,6 +342,133 @@ + + +
+ + + +
+ + + [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
  • +
  • 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
booleanThe object to convert to a boolean
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
boolean("Release11")true
boolean("")false

+ W3C Documentation reference: String-Functions +
+
+ + + + [1.0] fn:not() +
+
+ The not function returns true if its argument is false, and false otherwise.
+
+ W3C Documentation reference: String-Functions +
+
+ + + [1.0] fn:true() +
+
+ The true function returns true.
+
+ W3C Documentation reference: String-Functions +
+
+ + + [1.0] fn:false() +
+
+ The true function returns false.
+
+ W3C Documentation reference: String-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. For example, lang("en") would return true if the context node is any of these five elements:
+ +
+ +
+ 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 +
+
+ +
-- 2.51.0 From 0c10b99c2a3e9a07ffce11359df34466bd6b1a7c Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Mon, 6 Mar 2023 14:10:23 +0100 Subject: [PATCH 2/5] Added Numeric functions --- Frontend/tools/xpath.html | 231 +++++++++++++++++++++++++++++++++----- 1 file changed, 200 insertions(+), 31 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index bcdf577..1996e0f 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -370,7 +370,7 @@ Description - boolean + object The object to convert to a boolean Examples:
@@ -388,7 +388,7 @@ false
- W3C Documentation reference: String-Functions + W3C Documentation reference: Boolean-Functions
@@ -400,7 +400,7 @@
The not function returns true if its argument is false, and false otherwise.

- W3C Documentation reference: String-Functions + W3C Documentation reference: Boolean-Functions
@@ -411,7 +411,7 @@
The true function returns true.

- W3C Documentation reference: String-Functions + W3C Documentation reference: Boolean-Functions
@@ -422,7 +422,7 @@
The true function returns false.

- W3C Documentation reference: String-Functions + W3C Documentation reference: Boolean-Functions
@@ -430,11 +430,7 @@ class="hyperlink collapsible collapsibleMini collapseTrigger">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. For example, lang("en") would return true if the context node is any of these five elements:
- -
- -
+ 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: @@ -443,28 +439,11 @@ - + - - - - -
stringString to be searchedLanguage that will be looked for in context node
stringString to be found
Examples:
- - - - - - - - - - - - - -
ExpressionResult
starts-with("aabb", "aa")true
starts-with("aabb", "cc")false

- W3C Documentation reference: String-Functions + Examples: Look W3C documentation
+
+ W3C Documentation reference: Boolean-Functions
@@ -1381,6 +1360,196 @@ + + +
+ + + +
+ + + [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 +
+
+ + + + [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:
+ Examples:
+ + + + + + + + + + + + + +
ExpressionResult
round(2.55)3
round(2.35)2

+ W3C Documentation reference: Numeric-Functions +
+
+ +
-- 2.51.0 From f859ed6849d3366d570f7737c150b5dfbc8791c7 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Mon, 6 Mar 2023 14:23:21 +0100 Subject: [PATCH 3/5] Fixes --- Frontend/tools/xpath.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 1996e0f..d291985 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -479,7 +479,7 @@ Result - string((1<0))< /td> + string((1<0)) false @@ -1530,7 +1530,6 @@ Examples:
- Examples:
-- 2.51.0 From e8dbc5b267cedd76d2a0a1aac9bb6a2666d638ba Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Mon, 6 Mar 2023 14:28:49 +0100 Subject: [PATCH 4/5] Fixes --- Frontend/tools/xpath.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index d291985..56ce96a 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -388,7 +388,7 @@
Expressionfalse

- W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions
@@ -411,7 +411,7 @@
The true function returns true.

- W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions
@@ -422,7 +422,7 @@
The true function returns false.

- W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions
@@ -443,7 +443,7 @@ Examples: Look W3C documentation

- W3C Documentation reference: Boolean-Functions + W3C Documentation reference: Boolean-Functions @@ -1407,7 +1407,7 @@ false
- W3C Documentation reference: Numeric-Functions + W3C Documentation reference: Numeric-Functions @@ -1441,7 +1441,7 @@ 12444
- W3C Documentation reference: Numeric-Functions + W3C Documentation reference: Numeric-Functions @@ -1474,7 +1474,7 @@ 2 - W3C Documentation reference: Numeric-Functions + W3C Documentation reference: Numeric-Functions @@ -1507,7 +1507,7 @@ 3 - W3C Documentation reference: Numeric-Functions + W3C Documentation reference: Numeric-Functions @@ -1544,7 +1544,7 @@ 2
- W3C Documentation reference: Numeric-Functions + W3C Documentation reference: Numeric-Functions -- 2.51.0 From 28ebfc7274fef006e698a6f9e838eeb3c145cc3f Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Mon, 6 Mar 2023 14:37:40 +0100 Subject: [PATCH 5/5] Fixes --- Frontend/tools/xpath.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index 56ce96a..b5451d3 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -1515,7 +1515,7 @@ class="hyperlink collapsible collapsibleMini collapseTrigger">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. + 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: -- 2.51.0