diff --git a/Frontend/src/assets/tooltips/xpath/xpath1.json b/Frontend/src/assets/tooltips/xpath/xpath1.json new file mode 100644 index 0000000..899f8c9 --- /dev/null +++ b/Frontend/src/assets/tooltips/xpath/xpath1.json @@ -0,0 +1,548 @@ +[ + { + "name": "Node-Set", + "entries": [ + { + "name": "position()", + "description": "Returns the position of the current context node.", + "arguments": [], + "output": "number", + "examples": [ + { + "command": "position()", + "output": "3" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" + }, + { + "name": "last()", + "description": "The position function returns a number equal to the context position from the expression evaluation context.", + "arguments": [], + "output": "number", + "examples": [], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" + }, + { + "name": "count()", + "description": "Returns the number of nodes in the node-set", + "arguments": [ + { + "type": "node-set", + "description": "Node-set to count nodes in" + } + ], + "output": "number", + "examples": [ + { + "command": "count(/u:root/u:UserList/u:User)", + "output": "10" + }, + { + "command": "count(/u:root/u:UserList[@Id = 'b']/u:User)", + "output": "1" + } + + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" + }, + { + "name": "id()", + "description": "Returns the element specified by it's unique id, requires DTD", + "arguments": [], + "output": "node-set", + "examples": [], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" + }, + { + "name": "local-name()", + "description": "Returns the number of nodes in the node-set", + "arguments": [ + { + "type": "node-set", + "description": "Extract first node and return its local name" + } + ], + "output": "string", + "examples": [ + { + "command": "local-name(/u:root)", + "output": "root" + }, + { + "command": "local-name(/u:root/u:UserList)", + "output": "UserList" + } + + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" + }, + { + "name": "namespace-uri()", + "description": "Returns the namespace-uri for the first node in the node-set", + "arguments": [ + { + "type": "node-set", + "description": "Extract first node and return the namespace URI" + } + ], + "output": "string", + "examples": [ + { + "command": "namespace-uri(/u:root)", + "output": "http://www.release11.com/schemas/Sample.xsd" + } + + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" + }, + { + "name": "name()", + "description": "Returns the number of nodes in the node-set", + "arguments": [ + { + "type": "node-set? (Optional)", + "description": "Extract first node and return QName" + } + ], + "output": "string", + "examples": [ + { + "command": "name(/u:root)", + "output": "u:root" + }, + { + "command": "name(/u:root/u:UserList)", + "output": "u:UserList" + } + + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" + }, + { + "name": "lang()", + "description": "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.", + "arguments": [ + { + "type": "string", + "description": "Language that will be looked for in context node" + } + ], + "output": "boolean", + "examples": [], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions" + } + ] + }, + { + "name": "Boolean", + "entries": [ + { + "name": "boolean()", + "description": "The boolean function converts its argument to a boolean", + "arguments": [ + { + "type": "object", + "description": "The object to convert to a boolean" + } + ], + "output": "boolean", + "examples": [ + { + "command": "boolean('Release11')", + "output": "true" + }, + { + "command": "boolean('')", + "output": "false" + }, + { + "command": "boolean(2334)", + "output": "true" + } + + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions" + }, + { + "name": "not()", + "description": "The not function returns true if its argument is false, and false otherwise.", + "arguments": [], + "output": "boolean", + "examples": [ + { + "command": "not('text')", + "output": "false" + }, + { + "command": "not('')", + "output": "true" + } + + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions" + }, + { + "name": "true()", + "description": "The true function returns true.", + "arguments": [], + "output": "boolean", + "examples": [ + { + "command": "true()", + "output": "true" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions" + }, + { + "name": "false()", + "description": "The true function returns false.", + "arguments": [], + "output": "boolean", + "examples": [ + { + "command": "false()", + "output": "false" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions" + } + + ] + }, + { + "name": "String", + "entries": [ + { + "name": "string()", + "description": "The string function converts an object to a string", + "arguments": [ + { + "type": "object", + "description": "The object to convert to a string" + } + ], + "output": "string", + "examples": [ + { + "command": "string(10)", + "output": "10" + }, + { + "command": "string('Release11')", + "output": "Release11" + } + + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" + }, + { + "name": "concat()", + "description": "The concat function returns the concatenation of its arguments.", + "arguments": [ + { + "type": "string* (One or More)", + "description": "Strings to concatenate" + } + ], + "output": "string", + "examples": [ + { + "command": "concat('Release', 11)", + "output": "Release11" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" + } + , + { + "name": "starts-with()", + "description": "Returns true if the first argument string starts with the second argument string, and otherwise returns false.", + "arguments": [ + { + "type": "string", + "description": "String to test" + }, + { + "type": "string", + "description": "String that first string has to start from" + } + ], + "output": "boolean", + "examples": [ + { + "command": "starts-with('Release11', 'Rel'))", + "output": "true" + }, + { + "command": "starts-with('Release11', 'ease'))", + "output": "false" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" + } + , + { + "name": "contains()", + "description": "The contains function returns true if the first argument string contains the second argument string, and otherwise returns false.", + "arguments": [ + { + "type": "string", + "description": "String to test" + }, + { + "type": "string", + "description": "String that first string has to contain" + } + ], + "output": "boolean", + "examples": [ + { + "command": "contains('Release11', 'eas')", + "output": "true" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" + }, + { + "name": "substring-before()", + "description": "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": [ + { + "type": "string", + "description": "String to split" + }, + { + "type": "string", + "description": "String that splits first string" + } + ], + "output": "string", + "examples": [ + { + "command": "substring-before('Release11', '11')", + "output": "Release" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" + }, + { + "name": "substring-after()", + "description": "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": [ + { + "type": "string", + "description": "String to split" + }, + { + "type": "string", + "description": "String that splits first string" + } + ], + "output": "string", + "examples": [ + { + "command": "substring-after('Release11', 'le')", + "output": "ase11" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" + }, + { + "name": "substring()", + "description": "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": [ + { + "type": "string", + "description": "String to split" + }, + { + "type": "number", + "description": "Starting index" + }, + { + "type": "number? (Optional)", + "description": "Length of target substring" + } + ], + "output": "string", + "examples": [ + { + "command": "substring('12345',2)", + "output": "2345" + }, + { + "command": "substring('12345',2,3)", + "output": "234" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" + }, + { + "name": "string-length()", + "description": "The string-length returns the number of characters in the string.", + "arguments": [ + { + "type": "string? (Optional)", + "description": "String to test" + } + ], + "output": "number", + "examples": [ + { + "command": "string-length('abcdef')", + "output": "6" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" + }, + { + "name": "normalize-space(()", + "description": "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.", + "arguments": [ + { + "type": "string? (Optional)", + "description": "String to normalize" + } + ], + "output": "string", + "examples": [ + { + "command": "normalize-space(' abc def ')", + "output": "abc def" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" + }, + { + "name": "translate()", + "description": "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": [ + { + "type": "string", + "description": "String to process" + }, + { + "type": "string", + "description": "Characters to remove" + }, + { + "type": "string", + "description": "String to insert characters from second argument" + } + ], + "output": "string", + "examples": [ + { + "command": "translate('bar','abc','ABC')", + "output": "BAr" + }, + { + "command": "translate('--aaa--','abc-','ABC')", + "output": "AAA" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions" + } + ] + }, + { + "name": "Number", + "entries": [ + { + "name": "number()", + "description": "The number function converts its argument to a number", + "arguments": [ + { + "type": "object", + "description": "The object to convert to a number" + } + ], + "output": "number", + "examples": [ + { + "command": "number(10)", + "output": "10" + }, + { + "command": "number('')", + "output": "NaN" + } + + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions" + }, + { + "name": "sum()", + "description": "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": [ + { + "type": "node-set", + "description": "Node set to sum" + } + ], + "output": "number", + "examples": [ + { + "command": "sum(/someNode/value)", + "output": "78" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions" + }, + { + "name": "floor()", + "description": "The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.", + "arguments": [ + { + "type": "number", + "description": "Number to round" + } + ], + "output": "number", + "examples": [ + { + "command": "floor(3.1)", + "output": "3" + }, + { + "command": "floor(3.9)", + "output": "3" + }, + { + "command": "floor(3.5)", + "output": "3" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions" + }, + { + "name": "round()", + "description": "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.", + "arguments": [ + { + "type": "number", + "description": "Number to round" + } + ], + "output": "number", + "examples": [ + { + "command": "round(3.1)", + "output": "3" + }, + { + "command": "round(3.9)", + "output": "4" + }, + { + "command": "round(3.5)", + "output": "4" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions" + } + ] + } +] \ No newline at end of file diff --git a/Frontend/src/assets/tooltips/xpath/xpath2.json b/Frontend/src/assets/tooltips/xpath/xpath2.json new file mode 100644 index 0000000..2c5dfed --- /dev/null +++ b/Frontend/src/assets/tooltips/xpath/xpath2.json @@ -0,0 +1,1678 @@ +[ + { + "name": "Node-Set", + "entries": [ + { + "name": "name()", + "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?", + "description": "Node to display name" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "name(/u:root)", + "output": "u:root" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-name" + }, + { + "name": "local-name()", + "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?", + "description": "Node to display local-name" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "name(/u:root)", + "output": "root" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-local-name" + }, + { + "name": "nilled()", + "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?", + "description": "Node to test" + } + ], + "output": "xs:boolean", + "examples": [ + { + "command": "nilled(/u:root)", + "output": "false" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-nilled" + }, + { + "name": "base-uri()", + "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?", + "description": "Node which URI is looked for" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "base-uri(/u:root/u:UserList[1])", + "output": "" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-base-uri" + }, + { + "name": "document-uri()", + "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?", + "description": "Node which document-uri value needs to be returned." + } + ], + "output": "xs:string", + "examples": [ + { + "command": "document-uri(/u:root)", + "output": "" + }, + { + "command": "document-uri(/library/fiction:book[1])", + "output": "http://example.com/library.xml (assuming the document URI of the first fiction:book element is 'http://example.com/library.xml')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-document-uri" + }, + { + "name": "lang()", + "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?", + "description": "$testlang (Look description)" + }, + { + "type": "node?", + "description": "$node (Look description)" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "document-uri(/u:root)", + "output": "" + }, + { + "command": "document-uri(/library/fiction:book[1])", + "output": "http://example.com/library.xml (assuming the document URI of the first fiction:book element is 'http://example.com/library.xml')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-lang" + }, + { + "name": "root()", + "description": "Returns the root of the tree to which $arg belongs. This will usually, but not necessarily, be a document node.", + "arguments": [ + { + "type": "node?", + "description": "$arg (Look description)" + } + ], + "output": "node", + "examples": [ + { + "command": "root(//u:UserList[1])", + "output": "" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-root" + }, + { + "name": "count()", + "description": "Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.", + "arguments": [ + { + "type": "item()*", + "description": "$arg (Look description)" + } + ], + "output": "number", + "examples": [ + { + "command": "count(//u:UserList)", + "output": "3" + }, + { + "command": "count(//u:UserList/u:User)", + "output": "10" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-root" + } + ] + }, + { + "name": "Boolean", + "entries": [ + { + "name": "boolean()", + "description": "Computes the effective boolean value of the sequence $arg.", + "arguments": [ + { + "type": "item()*", + "description": "$arg" + } + ], + "output": "xs:boolean?", + "examples": [ + { + "command": "boolean(0)", + "output": "false" + }, + { + "command": "boolean(())", + "output": "false" + }, + { + "command": "boolean(1)", + "output": "true" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-boolean" + }, + { + "name": "true()", + "description": "Returns the xs:boolean value true. Equivalent to xs:boolean('1').", + "arguments": [], + "output": "xs:boolean", + "examples": [ + { + "command": "true()", + "output": "true" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-true" + }, + { + "name": "false()", + "description": "Returns the xs:boolean value false. Equivalent to xs:boolean('0').", + "arguments": [], + "output": "xs:boolean", + "examples": [ + { + "command": "false()", + "output": "false" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-false" + }, + { + "name": "not()", + "description": "$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": [ + { + "type": "item()", + "description": "$arg" + } + ], + "output": "xs:boolean", + "examples": [ + { + "command": "not(false())", + "output": "true" + }, + { + "command": "not(true())", + "output": "false" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-not" + } + ] + }, + { + "name": "String", + "entries": [ + { + "name": "string()", + "description": "Returns the value of $arg represented as a xs:string. If no argument is supplied, the context item (.) is used as the default argument.", + "arguments": [ + { + "type": "item()?", + "description": "$arg" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "string((1<0))", + "output": "false" + }, + { + "command": "string(.11)", + "output": "0.11" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-string" + }, + { + "name": "codepoints-to-string()", + "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*", + "description": "$arg" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "codepoints-to-string((2309, 2358, 2378, 2325))", + "output": "अशॊक" + }, + { + "command": "codepoints-to-string((40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41))", + "output": "( ͡° ͜ʖ ͡°)" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-codepoints-to-string" + }, + { + "name": "string-to-codepoints()", + "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*", + "description": "$arg" + } + ], + "output": "xs:integer*", + "examples": [ + { + "command": "string-to-codepoints('Thérèse')", + "output": "https://www.w3.org/TR/xquery-operators/#func-string-to-codepoints" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-min" + }, + { + "name": "compare()", + "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?", + "description": "$comparand1" + }, + { + "type": "xs:string?", + "description": "$comparand2" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "xs:integer?", + "examples": [ + { + "command": "compare('abc', 'abc')", + "output": "0" + }, + { + "command": "compare('abc', 'acc')", + "output": "-1" + }, + { + "command": "compare('abc', 'acc')", + "output": "1" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-compare" + }, + { + "name": "codepoint-equal()", + "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?", + "description": "$comparand1" + }, + { + "type": "xs:string?", + "description": "$comparand2" + }, + { + "type": "xs:string", + "description": "$collation" + } + ], + "output": "xs:boolean?", + "examples": [ + { + "command": "codepoint-equal('asdf', 'asdf')", + "output": "true" + }, + { + "command": "codepoint-equal('asdf', 'asdf ')", + "output": "false" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-codepoint-equal" + }, + { + "name": "concat()", + "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?", + "description": "$arg1" + }, + { + "type": "xs:anyAtomicType?", + "description": "$arg2" + }, + { + "type": "xs:anyAtomicType?", + "description": "$arg.." + } + ], + "output": "xs:string", + "examples": [ + { + "command": "concat('un', 'grateful')", + "output": "ungrateful" + }, + { + "command": "concat('Thy ', (), 'old ', 'groans', '', ' ring', ' yet', ' in', ' my', 'ancient',' ears.')", + "output": "Thy old groans ring yet in my ancient ears." + }, + { + "command": "concat('Ciao!',())", + "output": "Ciao!" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-concat" + }, + { + "name": "string-join()", + "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*", + "description": "$arg1" + }, + { + "type": "xs:string", + "description": "$arg2" + }, + { + "type": "xs:string", + "description": "$collation" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "string-join(('Now', 'is', 'the', 'time', '...'), ' ')", + "output": "Now is the time ..." + }, + { + "command": "string-join(('Blow, ', 'blow, ', 'thou ', 'winter ', 'wind!'), '')", + "output": "Blow, blow, thou winter wind!" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-string-join" + }, + { + "name": "substring()", + "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?", + "description": "$comparand1" + }, + { + "type": "xs:double", + "description": "$startingLoc" + }, + { + "type": "xs:double?", + "description": "$length" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "substring('motor car', 6)", + "output": "' car'" + }, + { + "command": "substring('metadata', 4, 3)", + "output": "ada" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-substring" + }, + { + "name": "string-length()", + "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?", + "description": "$arg" + } + ], + "output": "xs:integer", + "examples": [ + { + "command": "string-length('Harp not on that string, madam; that is past.')", + "output": "45" + }, + { + "command": "string-length(())", + "output": "0" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-string-length" + }, + { + "name": "normalize-space()", + "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?", + "description": "$arg" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "normalize-space(' The wealthy curled darlings of our nation. ')", + "output": "The wealthy curled darlings of our nation.'" + }, + { + "command": "normalize-space(())", + "output": "''" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-normalize-space" + }, + { + "name": "normalize-unicode()", + "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?", + "description": "$arg" + }, + { + "type": "xs:string?", + "description": "$normalizationForm" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "normalize-unicode('test ')", + "output": "'test'" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-normalize-unicode" + }, + { + "name": "upper-case()", + "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?", + "description": "$arg" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "upper-case('abCd0')", + "output": "ABCD0" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-upper-case" + }, + { + "name": "substring()", + "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?", + "description": "$arg" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "lower-case('abCd0')", + "output": "abcd0" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-lower-case" + }, + { + "name": "translate()", + "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?", + "description": "$arg" + }, + { + "type": "xs:string", + "description": "$mapString" + }, + { + "type": "xs:string", + "description": "$mapString" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "translate('bar','abc','ABC')", + "output": "BAr" + }, + { + "command": "translate('--aaa--','abc-','ABC')", + "output": "AAA" + }, + { + "command": "translate('abcdabc', 'abc', 'AB')", + "output": "ABdAB" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-translate" + }, + { + "name": "encode-for-uri()", + "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?", + "description": "$uri-part" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "encode-for-uri('https://www.google.com')", + "output": "https%3A%2F%2Fwww.google.com" + }, + { + "command": "concat('http://www.example.com/', encode-for-uri('~bébé'))", + "output": "http://www.example.com/~b%C3%A9b%C3%A9" + }, + { + "command": "concat('http://www.example.com/', encode-for-uri('100% organic'))", + "output": "http://www.example.com/100%25%20organic" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-encode-for-uri" + }, + { + "name": "iri-to-uri()", + "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?", + "description": "$iri" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "iri-to-uri ('http://www.example.com/00/Weather/CA/Los%20Angeles#ocean')", + "output": "http://www.example.com/00/Weather/CA/Los%20Angeles#ocean" + }, + { + "command": "iri-to-uri ('http://www.example.com/~bébé')", + "output": "http://www.example.com/~b%C3%A9b%C3%A9" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-iri-to-uri" + }, + { + "name": "escape-html-uri()", + "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?", + "description": "$uri" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "escape-html-uri('http://www.example.com/00/Weather/CA/Los Angeles#ocean')", + "output": "http://www.example.com/00/Weather/CA/Los Angeles#ocean'" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-escape-html-uri" + }, + { + "name": "contains()", + "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?", + "description": "$arg1" + }, + { + "type": "xs:string?", + "description": "$arg2" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "xs:boolean", + "examples": [ + { + "command": "contains( 'tattoo', 'tat')", + "output": "true" + }, + { + "command": "contains( 'tattoo', 'ttt')", + "output": "false" + }, + { + "command": "contains ( '', ())", + "output": "true" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-contains" + }, + { + "name": "starts-with(()", + "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?", + "description": "$arg1" + }, + { + "type": "xs:string?", + "description": "$arg2" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "xs:boolean", + "examples": [ + { + "command": "starts-with('tattoo', 'tat')", + "output": "true" + }, + { + "command": "starts-with('tattoo', 'ttt')", + "output": "false" + }, + { + "command": "starts-with ( '', ())", + "output": "true" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-starts-with" + }, + { + "name": "ends-with(()", + "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?", + "description": "$arg1" + }, + { + "type": "xs:string?", + "description": "$arg2" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "xs:boolean", + "examples": [ + { + "command": "ends-with('tattoo', 'too')", + "output": "true" + }, + { + "command": "ends-with( 'tattoo', 'tatoo')", + "output": "false" + }, + { + "command": "ends-with ( '', ())", + "output": "true" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-ends-with" + }, + { + "name": "substring-before(()", + "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?", + "description": "$arg1" + }, + { + "type": "xs:string?", + "description": "$arg2" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "substring-before( 'tattoo', 'too')", + "output": "tat" + }, + { + "command": "substring-before( 'tattoo', 'tat')", + "output": "''" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-substring-before" + }, + { + "name": "substring-after()", + "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?", + "description": "$arg1" + }, + { + "type": "xs:string?", + "description": "$arg2" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "substring-after( 'tattoo', 'too')", + "output": "''" + }, + { + "command": "substring-after( 'tattoo', 'tat')", + "output": "too" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-substring-after" + }, + { + "name": "matches()", + "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?", + "description": "$input" + }, + { + "type": "xs:string?", + "description": "$pattern" + }, + { + "type": "xs:string?", + "description": "$flags" + } + ], + "output": "xs:boolean", + "examples": [ + { + "command": "matches('abracadabra', 'bra')", + "output": "true" + }, + { + "command": "matches('abracadabra', '^a.*a$')", + "output": "false" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-matches" + }, + { + "name": "replace()", + "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?", + "description": "$comparand1" + }, + { + "type": "xs:string", + "description": "$startingLoc" + }, + { + "type": "xs:string", + "description": "$replacement" + }, + { + "type": "xs:string?", + "description": "$flags" + } + ], + "output": "xs:string", + "examples": [ + { + "command": "replace('abracadabra', 'bra', '*')", + "output": "a*cada*" + }, + { + "command": "replace('abracadabra', 'a.*a, '*')", + "output": "ada" + }, + { + "command": "replace('AAAA', 'A+', 'b')", + "output": "b" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-replace" + }, + { + "name": "tokenize()", + "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?", + "description": "$comparand1" + }, + { + "type": "xs:string", + "description": "$pattern" + }, + { + "type": "xs:string?", + "description": "$flags" + } + ], + "output": "xs:string*", + "examples": [ + { + "command": "tokenize('The cat sat on the mat', '\\s+')", + "output": "('The', 'cat', 'sat', 'on', 'the', 'mat')" + }, + { + "command": "tokenize('1, 15, 24, 50', '\\s*')", + "output": "('1', '15', '24', '50')" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-tokenize" + } + ] + }, + { + "name": "Number", + "entries": [ + { + "name": "number()", + "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?", + "description": "Value to convert to number" + } + ], + "output": "xs:double", + "examples": [ + { + "command": "number(123)", + "output": "123" + }, + { + "command": "number('Release11')", + "output": "NaN" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-number" + }, + { + "name": "avg()", + "description": "Returns the number of items in the value of $arg. Returns 0 if $arg is the empty sequence.", + "arguments": [ + { + "type": "xs:anyAtomicType*", + "description": "$arg" + } + ], + "output": "xs:anyAtomicType", + "examples": [ + { + "command": "avg(//u:User/@Id)", + "output": "2.6" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-avg" + }, + { + "name": "max()", + "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*", + "description": "$arg" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "xs:anyAtomicType", + "examples": [ + { + "command": "max(//u:User/@Id)", + "output": "5" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-max" + }, + { + "name": "min()", + "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*", + "description": "$arg" + }, + { + "type": "xs:string?", + "description": "$collation" + } + ], + "output": "xs:anyAtomicType", + "examples": [ + { + "command": "min(//u:User/@Id)", + "output": "1" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-min" + }, + { + "name": "sum()", + "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*", + "description": "$arg" + }, + { + "type": "xs:anyAtomicType?", + "description": "$zero" + } + ], + "output": "xs:anyAtomicType", + "examples": [ + { + "command": "sum(//u:User/@Id)", + "output": "26" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-sum" + }, + { + "name": "abs()", + "description": "Returns the absolute value of $arg.", + "arguments": [ + { + "type": "numeric?", + "description": "$arg" + } + ], + "output": "numeric?", + "examples": [ + { + "command": "abs(25)", + "output": "25" + }, + { + "command": "abs(-25)", + "output": "25" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-abs" + }, + { + "name": "ceiling()", + "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?", + "description": "$arg" + } + ], + "output": "numeric?", + "examples": [ + { + "command": "ceiling(10.5)", + "output": "11" + }, + { + "command": "ceiling(-10.5)", + "output": "10" + }, + { + "command": "ceiling(10.1)", + "output": "11" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-ceiling" + }, + { + "name": "floor()", + "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?", + "description": "$arg" + } + ], + "output": "numeric?", + "examples": [ + { + "command": "floor(10.5)", + "output": "10" + }, + { + "command": "floor(-10.5)", + "output": "-11" + }, + { + "command": "floor(10.1)", + "output": "10" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-floor" + }, + { + "name": "round()", + "description": "Returns the number with no fractional part that is closest to the argument.", + "arguments": [ + { + "type": "numeric?", + "description": "$arg" + } + ], + "output": "numeric?", + "examples": [ + { + "command": "round(10.5)", + "output": "11" + }, + { + "command": "round(-10.5)", + "output": "-10" + }, + { + "command": "round(10.1)", + "output": "10" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#func-round" + }, + { + "name": "round-half-to-even()", + "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?", + "description": "$arg" + }, + { + "type": "numeric?", + "description": "$precision" + } + ], + "output": "numeric?", + "examples": [ + { + "command": "round-half-to-even(0.5)", + "output": "0" + }, + { + "command": "round-half-to-even(1.5)", + "output": "2" + }, + { + "command": "round-half-to-even(2.5)", + "output": "2" + }, + { + "command": "round-half-to-even(2.6)", + "output": "3" + } + ], + "documentationReferenceURL": "https://www.w3.org/TR/xquery-operators/#round-half-to-even" + } + ] + }, + { + "name": "Collections", + "entries": [ + { + "name": "data()", + "description": "Takes a sequence of items and returns a sequence of atomic values.", + "arguments": [ + { + "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:boolean", + "examples": [ + { + "command": "exists(remove(('hello'), 1))", + "output": "false" + } + ], + "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" + } + ] + } +] \ No newline at end of file diff --git a/Frontend/src/assets/tooltips/xpath/xpath3.json b/Frontend/src/assets/tooltips/xpath/xpath3.json new file mode 100644 index 0000000..3f696bb --- /dev/null +++ b/Frontend/src/assets/tooltips/xpath/xpath3.json @@ -0,0 +1,40 @@ +[ + { + "name": "Number", + "entries": [ + { + "name": "sum", + "description": "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": [ + { + "name": "$arg", + "type": "node-set", + "description": "Data to sum" + } + ], + "output": "number", + "examples": [], + "documentationReferenceURL": "wwww.google.pl" + }, + { + "name": "floor", + "description": "The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.", + "arguments": [ + { + "name": "$arg", + "type": "number", + "description": "Data to round" + } + ], + "output": "number", + "examples": [ + { + "command": "floor(3.6)", + "output": "3" + } + ], + "documentationReferenceURL": "wwww.google.pl" + } + ] + } +] \ No newline at end of file diff --git a/Frontend/src/assets/tooltips/xpath/xpath31.json b/Frontend/src/assets/tooltips/xpath/xpath31.json new file mode 100644 index 0000000..3f696bb --- /dev/null +++ b/Frontend/src/assets/tooltips/xpath/xpath31.json @@ -0,0 +1,40 @@ +[ + { + "name": "Number", + "entries": [ + { + "name": "sum", + "description": "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": [ + { + "name": "$arg", + "type": "node-set", + "description": "Data to sum" + } + ], + "output": "number", + "examples": [], + "documentationReferenceURL": "wwww.google.pl" + }, + { + "name": "floor", + "description": "The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.", + "arguments": [ + { + "name": "$arg", + "type": "number", + "description": "Data to round" + } + ], + "output": "number", + "examples": [ + { + "command": "floor(3.6)", + "output": "3" + } + ], + "documentationReferenceURL": "wwww.google.pl" + } + ] + } +] \ No newline at end of file diff --git a/Frontend/src/components/mock/HeadersComponent.vue b/Frontend/src/components/mock/HeadersComponent.vue index b5af03a..cd0ce2b 100644 --- a/Frontend/src/components/mock/HeadersComponent.vue +++ b/Frontend/src/components/mock/HeadersComponent.vue @@ -15,12 +15,20 @@ const headerData = ref(props.headersObject) const newHeaderName = ref(''); const newHeaderValue = ref(''); +function setAddButtonStyle() { + return isNewHeaderEmpty() ? "inactive-button" : "tool-button"; +} + +function isNewHeaderEmpty() { + return newHeaderName.value.trim().length == 0; +} + function isHeaderEssential(headerName : string){ return headerName == "Keep-Alive" || headerName == "Connection" || headerName == "Date" } function setEssentialHeaderStyle(headerName : string){ - return isHeaderEssential(headerName) ? "text-gray-400" : "tool-button text-red-400"; + return isHeaderEssential(headerName) ? "inactive-button" : "tool-button"; } function deleteHeader(index : string){ @@ -31,32 +39,36 @@ function deleteHeader(index : string){ } function addNewHeader(name : string, value : string){ - if (headerData.value != undefined){ - headerData.value[name] = value; - newHeaderName.value = ""; - newHeaderValue.value = ""; - emit('update:httpHeaders',headerData.value) - } + if (headerData.value == undefined) + return; + + if (isNewHeaderEmpty()) return; + + headerData.value[name] = value; + newHeaderName.value = ""; + newHeaderValue.value = ""; + emit('update:httpHeaders',headerData.value); } \ No newline at end of file diff --git a/Frontend/src/components/mock/HistoryComponent.vue b/Frontend/src/components/mock/HistoryComponent.vue index f0b693d..89050cc 100644 --- a/Frontend/src/components/mock/HistoryComponent.vue +++ b/Frontend/src/components/mock/HistoryComponent.vue @@ -35,7 +35,7 @@ function showHeaders(headers: object, index: number){