From 82e8fdb32c980ae87131dc28f034c5c872e7baa0 Mon Sep 17 00:00:00 2001 From: widlam Date: Wed, 5 Apr 2023 14:19:12 +0200 Subject: [PATCH] in progress: writing documentation --- Frontend/tools/xpath.html | 3069 ++++++++++++++++++++++++++++++------- 1 file changed, 2507 insertions(+), 562 deletions(-) diff --git a/Frontend/tools/xpath.html b/Frontend/tools/xpath.html index a7e30d1..85469af 100644 --- a/Frontend/tools/xpath.html +++ b/Frontend/tools/xpath.html @@ -29,7 +29,7 @@

- -
- - - fn:boolean(object) + + +
+ + + 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 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
  • +
  • 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: @@ -353,40 +355,49 @@
W3C Documentation reference: Boolean-Functions -
+
- fn:not() -
+ fn:not() +
The not function returns true if its argument is false, and false otherwise.

W3C Documentation reference: Boolean-Functions -
+
- fn:true() -
+ fn:true() +
The true function returns true.

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

W3C Documentation reference: Boolean-Functions -
+
- 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.
+ 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: @@ -398,12 +409,12 @@
Language that will be looked for in context node
Examples: Look W3C documentation
-
+
W3C Documentation reference: Boolean-Functions +
+ +
- - -
@@ -413,18 +424,18 @@
- - + + fn:last()
- Returns the position of the last node in the context list
-
- W3C Documentation reference: Node-Set-Functions + Returns the position of the last node in the context list
+
+ W3C Documentation reference: Node-Set-Functions
- - - + + +
@@ -432,49 +443,51 @@
- - + + 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
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 and return type: + + + + + + + + + +
TypeDescription
objectThe object to convert to a boolean
Examples:
+ + + + + + + + + + + + + +
ExpressionResult
boolean("Release11")true
boolean("")false

+ W3C Documentation reference: Boolean-Functions
- - - + + +
@@ -482,42 +495,42 @@
- - + + 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
- - - + + +
@@ -525,49 +538,54 @@
- - + 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 + 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
- - + +
@@ -575,33 +593,33 @@
- + fn:avg((arg,arg,...))
- 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 + 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
@@ -611,59 +629,59 @@
- - 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: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:error() +
+ https://www.w3.org/TR/xpath-functions/#func-error
+
+ W3C Documentation reference: #func-error +
+ +
@@ -671,40 +689,173 @@
- - fn:nilled(node) -
- Returns a Boolean value indicating whether the argument node is nilled
-
- W3C Documentation reference: #func-nilled -
- - + fn:nilled(node) +
+ + Returns a Boolean value indicating whether the argument node is nilled
+
+ W3C Documentation reference: #func-nilled +
+ +
- +
- - + + + + 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:last()
- Returns the position of the last node in the context list
-
- W3C Documentation reference: Node-Set-Functions + 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
- - - +
@@ -712,48 +863,159 @@
- - + fn:boolean(object) + class="hyperlink collapsible collapsibleMini collapseTrigger">fn:not($arg as item()*) as xs: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 + 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() as xs:boolean +
+ 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() as xs:boolean +
+ 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($arg as item()*) as xs:boolean +
+ 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 +
+ +
@@ -761,12 +1023,1474 @@
- - + + fn:escape-html-uri($uri as xs:string?) as 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($iri as xs:string?) as 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($uriPart as xs:string?) as 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($relative as xs:string?, $base as xs:string?) as xs:anyURI? +
+ 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($input as xs:string?, $pattern as xs:string, $flags as xs:string?) as element(fn:analyze-string-result) +
+ 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($input as xs:string?, $pattern as xs:string, $flags as xs:string?) as 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($input as xs:string?, $pattern as xs:string, $replacement as xs:string, $flags as xs:string?) as 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($input as xs:string?, $pattern as xs:string, $flags as xs:string?) as xs:boolean +
+ 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($arg1 as xs:string?, $arg2 as xs:string?) as 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($arg1 as xs:string?, $arg2 as xs:string?) as 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($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean +
+ 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($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean +
+ 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($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean +
+ 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($arg as xs:string?, $mapString as xs:string, $transString as xs:string) as 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($arg as xs:string?) as 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($arg as xs:string?) as 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($arg as xs:string?, $normalizationForm as xs:string) as 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($arg as xs:string?) as 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($arg as xs:string?) as xs:integer +
+ 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($sourceString as xs:string?, $startingLoc as xs:double) as xs:string +
+ 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($arg1 as xs:string*, $separator as xs:string) as 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($arg1 as xs:anyAtomicType?, $arg2 as xs:anyAtomicType?, ...) as xs:string +
+ 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($comparand1 as xs:string?, $comparand2 as xs:string?) as xs:boolean? +
+ 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($comparand1 as xs:string?, $comparand2 as xs:string?) as xs:integer? +
+ 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($arg as xs:string?) as xs:integer* +
+ 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($arg as xs:integer*) as xs:string +
+ 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
+ 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($value as numeric?, $picture as xs:string, $decimal-format-name as xs:string?) as xs:string +
+ 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($value as xs:integer?, $picture as xs:string) as 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($arg as numeric?) as 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($arg as numeric?) as 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($arg as numeric?) as 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($arg as numeric?) as 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($arg as numeric?) as 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: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:dateTime($arg1 as xs:date?, $arg2 as xs:time?) as xs:dateTime? +
+ Constructs an xs:dateTime value from an xs:date and an xs:time value
Arguments and return type: @@ -774,8 +2498,257 @@ - - + + + + + + + +
Description
stringThe object to convert to a stringxs: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($arg as xs:duration?) as xs:decimal? +
+ 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($arg as xs:duration?) as xs:integer? +
+ 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($arg as xs:duration?) as xs:integer? +
+ 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($arg as xs:duration?) as xs:integer? +
+ 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($arg as xs:duration?) as xs:integer? +
+ 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($arg as xs:duration?) as xs:integer? +
+ 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: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:
@@ -784,38 +2757,31 @@ - - - - - - + +
Result
string((1<0))false
string(.11)0.11adjust-date-to-timezone(xs:date('2011-11-15'), + xs:dayTimeDuration("PT10H"))2011-11-15+10:00

- W3C Documentation reference: String-Functions + W3C Documentation reference: #func-adjust-date-to-timezone +
+ + + + +
- -
-
-
- - - -
- - - 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
  • -
- + + fn:trace($value as item()*, $label as xs:string) as item()* +
+ Outputs the provided label and value for diagnostic purposes and returns the value + unchanged
Arguments and return type: @@ -823,141 +2789,120 @@ - - + + + + + +
Description
objectThe object to convert to a numberitem()*Value to be traced
xs:stringLabel to be output along with the value
- Examples:
+ Examples:
- - + + - - + +
Expression Result
boolean("Release11")truefn:trace(42, 'The value is:')Outputs "The value is: 42" for diagnostic purposes and returns 42
boolean("")falsefn:trace(/library/book/title, 'Book title:')Outputs "Book title: [book title]" for diagnostic purposes and returns + the book title

- W3C Documentation reference: Numeric-Functions + W3C Documentation reference: Trace +
+ + + fn:error($error as xs:QName?, $description as xs:string?, $error-object as item()*) +
+ 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: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 - + 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 + Applies function item to every element in sequence
+
+ W3C Documentation reference: #func-for-each
- - - + + + +
-
@@ -1004,14 +2949,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")); @@ -1029,7 +2974,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") { @@ -1039,7 +2984,7 @@ } - + if (collapsibleData.style.maxHeight > "0px") { collapsibleData.style.maxHeight = "0px"; @@ -1074,7 +3019,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 => { @@ -1113,4 +3058,4 @@ - + \ No newline at end of file