From 9731625ecc8233812a650f6ac6b74f1ebb2d2db4 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 29 Jun 2023 09:24:57 +0200 Subject: [PATCH] Added Colletions category --- .../src/assets/tooltips/xpath/xpath2.json | 639 +++++++++++++++--- 1 file changed, 558 insertions(+), 81 deletions(-) diff --git a/Frontend/src/assets/tooltips/xpath/xpath2.json b/Frontend/src/assets/tooltips/xpath/xpath2.json index b201f65..2c5dfed 100644 --- a/Frontend/src/assets/tooltips/xpath/xpath2.json +++ b/Frontend/src/assets/tooltips/xpath/xpath2.json @@ -7,7 +7,7 @@ "description": "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.", "arguments": [ { - "type": "node? (Optional)", + "type": "node?", "description": "Node to display name" } ], @@ -25,7 +25,7 @@ "description": "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.", "arguments": [ { - "type": "node? (Optional)", + "type": "node?", "description": "Node to display local-name" } ], @@ -43,7 +43,7 @@ "description": "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": [ { - "type": "node? (Optional)", + "type": "node?", "description": "Node to test" } ], @@ -61,7 +61,7 @@ "description": "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.", "arguments": [ { - "type": "node? (Optional)", + "type": "node?", "description": "Node which URI is looked for" } ], @@ -79,7 +79,7 @@ "description": "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.", "arguments": [ { - "type": "node? (Optional)", + "type": "node?", "description": "Node which document-uri value needs to be returned." } ], @@ -101,11 +101,11 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$testlang (Look description)" }, { - "type": "node? (Optional)", + "type": "node?", "description": "$node (Look description)" } ], @@ -127,7 +127,7 @@ "description": "Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.", "arguments": [ { - "type": "node? (Optional)", + "type": "node?", "description": "$arg (Look description)" } ], @@ -145,7 +145,7 @@ "description": "Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.", "arguments": [ { - "type": "item()* (One or more)", + "type": "item()*", "description": "$arg (Look description)" } ], @@ -172,11 +172,11 @@ "description": "Computes the effective boolean value of the sequence $arg.", "arguments": [ { - "type": "item()* (One or more)", + "type": "item()*", "description": "$arg" } ], - "output": "xs:boolean? (Optional)", + "output": "xs:boolean?", "examples": [ { "command": "boolean(0)", @@ -273,7 +273,7 @@ "description": "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": [ { - "type": "xs:integer* (One or more)", + "type": "xs:integer*", "description": "$arg" } ], @@ -295,11 +295,11 @@ "description": "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": [ { - "type": "xs:string* (One or more)", + "type": "xs:string*", "description": "$arg" } ], - "output": "xs:integer* (One or more)", + "output": "xs:integer*", "examples": [ { "command": "string-to-codepoints('Thérèse')", @@ -313,19 +313,19 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$comparand1" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$comparand2" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$collation" } ], - "output": "xs:integer? (Optional)", + "output": "xs:integer?", "examples": [ { "command": "compare('abc', 'abc')", @@ -347,11 +347,11 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$comparand1" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$comparand2" }, { @@ -359,7 +359,7 @@ "description": "$collation" } ], - "output": "xs:boolean? (Optional)", + "output": "xs:boolean?", "examples": [ { "command": "codepoint-equal('asdf', 'asdf')", @@ -377,15 +377,15 @@ "description": " 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.", "arguments": [ { - "type": "xs:anyAtomicType? (Optional)", + "type": "xs:anyAtomicType?", "description": "$arg1" }, { - "type": "xs:anyAtomicType? (Optional)", + "type": "xs:anyAtomicType?", "description": "$arg2" }, { - "type": "xs:anyAtomicType? (Optional)", + "type": "xs:anyAtomicType?", "description": "$arg.." } ], @@ -411,7 +411,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string* (One or more)", + "type": "xs:string*", "description": "$arg1" }, { @@ -441,7 +441,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$comparand1" }, { @@ -449,7 +449,7 @@ "description": "$startingLoc" }, { - "type": "xs:double? (Optional)", + "type": "xs:double?", "description": "$length" } ], @@ -471,7 +471,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg" } ], @@ -493,7 +493,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg" } ], @@ -515,11 +515,11 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$normalizationForm" } ], @@ -537,7 +537,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg" } ], @@ -555,7 +555,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg" } ], @@ -573,7 +573,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg" }, { @@ -607,7 +607,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$uri-part" } ], @@ -633,7 +633,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$iri" } ], @@ -655,7 +655,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$uri" } ], @@ -673,15 +673,15 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg1" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg2" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$collation" } ], @@ -707,15 +707,15 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg1" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg2" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$collation" } ], @@ -741,15 +741,15 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg1" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg2" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$collation" } ], @@ -775,15 +775,15 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg1" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg2" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$collation" } ], @@ -805,15 +805,15 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg1" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$arg2" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$collation" } ], @@ -835,15 +835,15 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$input" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$pattern" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$flags" } ], @@ -865,7 +865,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$comparand1" }, { @@ -877,7 +877,7 @@ "description": "$replacement" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$flags" } ], @@ -903,7 +903,7 @@ "description": "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.", "arguments": [ { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$comparand1" }, { @@ -911,11 +911,11 @@ "description": "$pattern" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$flags" } ], - "output": "xs:string* (One or more)", + "output": "xs:string*", "examples": [ { "command": "tokenize('The cat sat on the mat', '\\s+')", @@ -938,7 +938,7 @@ "description": "Returns the value indicated by $arg or, if $arg is not specified, the context item after atomization, converted to an xs:double.", "arguments": [ { - "type": "xs:anyAtomicType? (Optional)", + "type": "xs:anyAtomicType?", "description": "Value to convert to number" } ], @@ -960,7 +960,7 @@ "description": "Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.", "arguments": [ { - "type": "xs:anyAtomicType* (One or more)", + "type": "xs:anyAtomicType*", "description": "$arg" } ], @@ -978,11 +978,11 @@ "description": "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": [ { - "type": "xs:anyAtomicType* (One or more)", + "type": "xs:anyAtomicType*", "description": "$arg" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$collation" } ], @@ -1000,11 +1000,11 @@ "description": "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": [ { - "type": "xs:anyAtomicType* (One or more)", + "type": "xs:anyAtomicType*", "description": "$arg" }, { - "type": "xs:string? (Optional)", + "type": "xs:string?", "description": "$collation" } ], @@ -1022,11 +1022,11 @@ "description": "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": [ { - "type": "xs:anyAtomicType* (One or more)", + "type": "xs:anyAtomicType*", "description": "$arg" }, { - "type": "xs:anyAtomicType? (Optional)", + "type": "xs:anyAtomicType?", "description": "$zero" } ], @@ -1044,7 +1044,7 @@ "description": "Returns the absolute value of $arg.", "arguments": [ { - "type": "numeric? (Optional)", + "type": "numeric?", "description": "$arg" } ], @@ -1066,7 +1066,7 @@ "description": "Returns the smallest (closest to negative infinity) number with no fractional part that is not less than the value of $arg.", "arguments": [ { - "type": "numeric? (Optional)", + "type": "numeric?", "description": "$arg" } ], @@ -1092,7 +1092,7 @@ "description": "Returns the largest (closest to positive infinity) number with no fractional part that is not greater than the value of $arg.", "arguments": [ { - "type": "numeric? (Optional)", + "type": "numeric?", "description": "$arg" } ], @@ -1118,7 +1118,7 @@ "description": "Returns the number with no fractional part that is closest to the argument.", "arguments": [ { - "type": "numeric? (Optional)", + "type": "numeric?", "description": "$arg" } ], @@ -1144,11 +1144,11 @@ "description": "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.", "arguments": [ { - "type": "numeric? (Optional)", + "type": "numeric?", "description": "$arg" }, { - "type": "numeric? (Optional)", + "type": "numeric?", "description": "$precision" } ], @@ -1179,22 +1179,499 @@ "name": "Collections", "entries": [ { - "name": "avg()", - "description": "Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.", + "name": "data()", + "description": "Takes a sequence of items and returns a sequence of atomic values.", "arguments": [ { - "type": "xs:anyAtomicType* (One or more)", + "type": "item*", + "description": "Items to convert." + } + ], + "output": "xs:anyAtomicType*", + "examples": [ + { + "command": "data(/u:root/u:UserList[1]/u:User[1])", + "output": "('John', 'Wick', '2023-10-10')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-data" + }, + { + "name": "index-of()", + "description": " Returns a sequence of positive integers giving the positions within the sequence $seqParam of items that are equal to $srchParam.", + "arguments": [ + { + "type": "xs:anyAtomicType", + "description": "$seqParam" + }, + { + "type": "xs:anyAtomicType", + "description": "$srchParam" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "xs:integer*", + "examples": [ + { + "command": "index-of((10, 20, 30, 40), 35)", + "output": "()" + }, + { + "command": "index-of((10, 20, 30, 30, 20, 10), 20)", + "output": "(2, 5)" + }, + { + "command": "index-of(('a', 'sport', 'and', 'a', 'pastime'), 'a')", + "output": "(1, 4)" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-index-of" + }, + { + "name": "empty()", + "description": "If the value of $arg is the empty sequence, the function returns true; otherwise, the function returns false.", + "arguments": [ + { + "type": "item*", + "description": "arg" + } + ], + "output": "xs:boolean", + "examples": [ + { + "command": "empty(('hello', 'world'))", + "output": "false" + }, + { + "command": "empty(())", + "output": "true" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-empty" + }, + { + "name": "exists()", + "description": "If the value of $arg is not the empty sequence, the function returns true; otherwise, the function returns false.", + "arguments": [ + { + "type": "item*", "description": "$arg" } ], - "output": "xs:anyAtomicType", + "output": "xs:boolean", "examples": [ { - "command": "avg(//u:User/@Id)", - "output": "2.6" + "command": "exists(remove(('hello'), 1))", + "output": "false" } ], - "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-avg" + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-exists" + }, + { + "name": "distinct-values()", + "description": "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.", + "arguments": [ + { + "type": "xs:anyAtomicType*", + "description": "$arg" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "xs:anyAtomicType*", + "examples": [ + { + "command": "distinct-values((1, 2.0, 3, 2))", + "output": "(1, 3, 2.0)" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-distinct-values" + }, + { + "name": "insert-before()", + "description": "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.", + "arguments": [ + { + "type": "item*", + "description": "$target" + }, + { + "type": "xs:integer", + "description": "$position" + }, + { + "type": "item()*", + "description": "$$inserts" + } + ], + "output": "item()*", + "examples": [ + { + "command": "insert-before($x, 0, 'z')", + "output": "('z', 'a', 'b', 'c')" + }, + { + "command": "insert-before($x, 1, 'z')", + "output": "('z', 'a', 'b', 'c')" + }, + { + "command": "insert-before($x, 2, 'z')", + "output": "('a', 'z', 'b', 'c')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-insert-before" + }, + { + "name": "remove()", + "description": "Returns a new sequence constructed from the value of $target with the item at the position specified by the value of $position removed.", + "arguments": [ + { + "type": "item*", + "description": "$target" + }, + { + "type": "xs:integer", + "description": "$position" + } + ], + "output": "item()*", + "examples": [ + { + "command": "remove($x, 0)", + "output": "('a', 'b', 'c')" + }, + { + "command": "remove($x, 1)", + "output": "('b', 'c')" + }, + { + "command": "remove($x, 6)", + "output": "('a', 'b', 'c')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-remove" + }, + { + "name": "reverse()", + "description": "Reverses the order of items in a sequence. If $arg is the empty sequence, the empty sequence is returned.", + "arguments": [ + { + "type": "item*", + "description": "$arg" + } + ], + "output": "item()*", + "examples": [ + { + "command": "reverse( ('a', 'b', 'c') )", + "output": "('c', 'b', 'a')" + }, + { + "command": "reverse( ('hello') )", + "output": "('hello')" + }, + { + "command": "reverse( ('') )", + "output": "('')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-reverse" + }, + { + "name": "subsequence()", + "description": "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.", + "arguments": [ + { + "type": "item*", + "description": "$sourceSeq" + }, + { + "type": "xs:double?", + "description": "$startingLoc" + }, + { + "type": "xs:double?", + "description": "$length" + } + ], + "output": "item()*", + "examples": [ + { + "command": "subsequence( ('a', 'b', 'c', 'd', 'e') , 4)", + "output": "('d', 'e')" + }, + { + "command": "subsequence( ('a', 'b', 'c', 'd', 'e'), 2, 3)", + "output": "('b', 'c', 'd')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-subsequence" + }, + { + "name": "unordered()", + "description": "Returns the items of $sourceSeq in an implementation dependent order.", + "arguments": [ + { + "type": "item*", + "description": "$sourceSeq" + } + ], + "output": "item()*", + "examples": [], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-unordered" + }, + { + "name": "zero-or-one()", + "description": "Returns $arg if it contains zero or one items. Otherwise, raises an error [err:FORG0003].", + "arguments": [ + { + "type": "item*", + "description": "$arg" + } + ], + "output": "item()*", + "examples": [ + { + "command": "zero-or-one(('a'))", + "output": "('a')" + }, + { + "command": "zero-or-one(('a', 'b'))", + "output": "A sequence of more than one item is not allowed as the first argument of fn:zero-or-one() ('a', 'b')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-zero-or-one" + }, + { + "name": "one-or-more()", + "description": "Returns $arg if it contains one or more items. Otherwise, raises an error [err:FORG0004].", + "arguments": [ + { + "type": "item*", + "description": "$arg" + } + ], + "output": "item()?", + "examples": [ + { + "command": "one-or-more(('a'))", + "output": "('a')" + }, + { + "command": "one-or-more(('a', 'b'))", + "output": "('a', 'b')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-one-or-more" + }, + { + "name": "exactly-one()", + "description": "Returns $arg if it contains exactly one item. Otherwise, raises an error [err:FORG0005].", + "arguments": [ + { + "type": "item*", + "description": "$arg" + } + ], + "output": "item()?", + "examples": [ + { + "command": "exactly-one(('a'))", + "output": "('a')" + }, + { + "command": "exactly-one(('a', 'b'))", + "output": "A sequence of more than one item is not allowed as the first argument of fn:exactly-one() ('a', 'b')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-exactly-one" + }, + { + "name": "deep-equal()", + "description": "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.", + "arguments": [ + { + "type": "item*", + "description": "$parameter1" + }, + { + "type": "item*", + "description": "$parameter2" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "xs:boolean", + "examples": [ + { + "command": "deep-equal(/u:root/u:UserList[1], /u:root/u:UserList[2])", + "output": "false" + }, + { + "command": "deep-equal(/u:root/u:UserList[1], /u:root/u:UserList[1])", + "output": "true" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-deep-equal" + }, + { + "name": "id()", + "description": "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": [ + { + "type": "xs:string*", + "description": "$arg" + }, + { + "type": "node()*", + "description": "$startingLoc" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "element()*", + "examples": [], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-id" + }, + { + "name": "idref()", + "description": "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": [ + { + "type": "xs:string*", + "description": "$arg" + }, + { + "type": "node()*", + "description": "$node" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "node()*", + "examples": [], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-idref" + }, + { + "name": "doc()", + "description": "Retrieves a document using a URI supplied as an xs:string, and returns the corresponding document node.", + "arguments": [ + { + "type": "xs:string", + "description": "$uri" + } + ], + "output": "document-node()?", + "examples": [ + { + "command": "doc('test.xml')", + "output": "" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-doc" + }, + { + "name": "doc-available()", + "description": "The function returns true if and only if the function call fn:doc($uri) would return a document node.", + "arguments": [ + { + "type": "xs:string", + "description": "$uri" + } + ], + "output": "item()*", + "examples": [ + { + "command": "doc('test.xml')", + "output": "true " + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-doc-available" + }, + { + "name": "collection()", + "description": "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", + "arguments": [ + { + "type": "xs:string?", + "description": "$arg" + } + ], + "output": "node()*", + "examples": [ + { + "command": "collection('')", + "output": "()" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-collection" + }, + { + "name": "element-with-id()", + "description": "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": [ + { + "type": "xs:string?", + "description": "$arg" + }, + { + "type": "xs:double?", + "description": "$startingLoc" + }, + { + "type": "xs:double?", + "description": "$length" + } + ], + "output": "node()*", + "examples": [ + { + "command": "subsequence( ('a', 'b', 'c', 'd', 'e') , 4)", + "output": "('d', 'e')" + }, + { + "command": "subsequence( ('a', 'b', 'c', 'd', 'e'), 2, 3)", + "output": "('b', 'c', 'd')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-subsequence" + }, + { + "name": "position()", + "description": "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.", + "arguments": [], + "output": "xs:integer", + "examples": [ + { + "command": "/u:root/u:UserList[@Id = 'b']/position()", + "output": "1" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-position" + }, + { + "name": "last()", + "description": "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": [], + "output": "xs:integer", + "examples": [ + { + "command": "/u:root/u:UserList/last()", + "output": "(3, 3, 3)" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-last" } ] }