enhancement/implement_tooltips_for_xpath3 (#242)

Co-authored-by: widlam <mikolaj.widla@gmail.com>
Reviewed-on: #242
This commit is contained in:
2023-08-21 14:15:07 +02:00
parent 6319d7c427
commit a78f3bd52b
9 changed files with 9194 additions and 2749 deletions

View File

@@ -1,152 +1,15 @@
[
{
"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",
"description": "The boolean function converts its argument to a boolean",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions",
"examples": [
{
"command": "boolean('Release11')",
@@ -160,132 +23,305 @@
"command": "boolean(2334)",
"output": "true"
}
],
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions"
"name": "boolean()",
"output": "boolean"
},
{
"name": "not()",
"description": "The not function returns true if its argument is false, and false otherwise.",
"arguments": [],
"output": "boolean",
"description": "The true function returns false.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions",
"examples": [
{
"command": "not('text')",
"output": "false"
"output": "false",
"command": "false()"
}
],
"name": "false()",
"output": "boolean"
},
{
"arguments": [],
"description": "The not function returns true if its argument is false, and false otherwise.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions",
"examples": [
{
"output": "false",
"command": "not('text')"
},
{
"command": "not('')",
"output": "true"
}
],
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions"
"name": "not()",
"output": "boolean"
},
{
"name": "true()",
"arguments": [],
"description": "The true function returns true.",
"arguments": [],
"output": "boolean",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions",
"examples": [
{
"command": "true()",
"output": "true"
"output": "true",
"command": "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": "true()",
"output": "boolean"
}
]
],
"name": "Boolean"
},
{
"name": "String",
"entries": [
{
"name": "string()",
"description": "The string function converts an object to a string",
"arguments": [
{
"type": "node-set",
"description": "Node-set to count nodes in"
}
],
"description": "Returns the number of nodes in the node-set",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions",
"examples": [
{
"output": "10",
"command": "count(/u:root/u:UserList/u:User)"
},
{
"output": "1",
"command": "count(/u:root/u:UserList[@Id = 'b']/u:User)"
}
],
"name": "count()",
"output": "number"
},
{
"arguments": [],
"description": "Returns the element specified by it's unique id, requires DTD",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions",
"examples": [],
"name": "id()",
"output": "node-set"
},
{
"arguments": [
{
"description": "Language that will be looked for in context node",
"type": "string"
}
],
"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.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions",
"examples": [],
"name": "lang()",
"output": "boolean"
},
{
"arguments": [],
"description": "The position function returns a number equal to the context position from the expression evaluation context.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions",
"examples": [],
"name": "last()",
"output": "number"
},
{
"arguments": [
{
"description": "Extract first node and return its local name",
"type": "node-set"
}
],
"description": "Returns the number of nodes in the node-set",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions",
"examples": [
{
"command": "local-name(/u:root)",
"output": "root"
},
{
"command": "local-name(/u:root/u:UserList)",
"output": "UserList"
}
],
"name": "local-name()",
"output": "string"
},
{
"arguments": [
{
"description": "Extract first node and return QName",
"type": "node-set? (Optional)"
}
],
"description": "Returns the number of nodes in the node-set",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions",
"examples": [
{
"command": "name(/u:root)",
"output": "u:root"
},
{
"command": "name(/u:root/u:UserList)",
"output": "u:UserList"
}
],
"name": "name()",
"output": "string"
},
{
"arguments": [
{
"description": "Extract first node and return the namespace URI",
"type": "node-set"
}
],
"description": "Returns the namespace-uri for the first node in the node-set",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions",
"examples": [
{
"output": "http://www.release11.com/schemas/Sample.xsd",
"command": "namespace-uri(/u:root)"
}
],
"name": "namespace-uri()",
"output": "string"
},
{
"arguments": [],
"description": "Returns the position of the current context node.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions",
"examples": [
{
"output": "3",
"command": "position()"
}
],
"name": "position()",
"output": "number"
}
],
"name": "Node-Set"
},
{
"entries": [
{
"arguments": [
{
"type": "number",
"description": "Number to round"
}
],
"description": "The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions",
"examples": [
{
"output": "3",
"command": "floor(3.1)"
},
{
"output": "3",
"command": "floor(3.9)"
},
{
"output": "3",
"command": "floor(3.5)"
}
],
"name": "floor()",
"output": "number"
},
{
"arguments": [
{
"type": "object",
"description": "The object to convert to a string"
"description": "The object to convert to a number"
}
],
"output": "string",
"description": "The number function converts its argument to a number",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions",
"examples": [
{
"command": "string(10)",
"output": "10"
"output": "10",
"command": "number(10)"
},
{
"command": "string('Release11')",
"output": "Release11"
"output": "NaN",
"command": "number('')"
}
],
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions"
"name": "number()",
"output": "number"
},
{
"name": "concat()",
"description": "The concat function returns the concatenation of its arguments.",
"arguments": [
{
"type": "number",
"description": "Number to 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.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions",
"examples": [
{
"output": "3",
"command": "round(3.1)"
},
{
"output": "4",
"command": "round(3.9)"
},
{
"output": "4",
"command": "round(3.5)"
}
],
"name": "round()",
"output": "number"
},
{
"arguments": [
{
"description": "Node set to sum",
"type": "node-set"
}
],
"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.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions",
"examples": [
{
"output": "78",
"command": "sum(/someNode/value)"
}
],
"name": "sum()",
"output": "number"
}
],
"name": "Number"
},
{
"entries": [
{
"arguments": [
{
"type": "string* (One or More)",
"description": "Strings to concatenate"
}
],
"output": "string",
"description": "The concat function returns the concatenation of its arguments.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions",
"examples": [
{
"command": "concat('Release', 11)",
"output": "Release11"
}
],
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions"
}
,
"name": "concat()",
"output": "string"
},
{
"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",
@@ -296,62 +332,102 @@
"description": "String that first string has to contain"
}
],
"output": "boolean",
"description": "The contains function returns true if the first argument string contains the second argument string, and otherwise returns false.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions",
"examples": [
{
"command": "contains('Release11', 'eas')",
"output": "true"
}
],
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions"
"name": "contains()",
"output": "boolean"
},
{
"arguments": [
{
"description": "String to normalize",
"type": "string? (Optional)"
}
],
"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.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions",
"examples": [
{
"output": "abc def",
"command": "normalize-space(' abc def ')"
}
],
"name": "normalize-space(()",
"output": "string"
},
{
"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"
"description": "String to test"
},
{
"type": "string",
"description": "String that splits first string"
"description": "String that first string has to start from"
}
],
"output": "string",
"description": "Returns true if the first argument string starts with the second argument string, and otherwise returns false.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions",
"examples": [
{
"command": "substring-before('Release11', '11')",
"output": "Release"
"command": "starts-with('Release11', 'Rel'))",
"output": "true"
},
{
"output": "false",
"command": "starts-with('Release11', 'ease'))"
}
],
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions"
"name": "starts-with()",
"output": "boolean"
},
{
"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"
"type": "object",
"description": "The object to convert to a string"
}
],
"output": "string",
"description": "The string function converts an object to a string",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions",
"examples": [
{
"command": "substring-after('Release11', 'le')",
"output": "ase11"
"output": "10",
"command": "string(10)"
},
{
"output": "Release11",
"command": "string('Release11')"
}
],
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions"
"name": "string()",
"output": "string"
},
{
"arguments": [
{
"description": "String to test",
"type": "string? (Optional)"
}
],
"description": "The string-length returns the number of characters in the string.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions",
"examples": [
{
"output": "6",
"command": "string-length('abcdef')"
}
],
"name": "string-length()",
"output": "number"
},
{
"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",
@@ -362,187 +438,100 @@
"description": "Starting index"
},
{
"type": "number? (Optional)",
"description": "Length of target substring"
"description": "Length of target substring",
"type": "number? (Optional)"
}
],
"output": "string",
"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.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions",
"examples": [
{
"command": "substring('12345',2)",
"output": "2345"
"output": "2345",
"command": "substring('12345',2)"
},
{
"command": "substring('12345',2,3)",
"output": "234"
"output": "234",
"command": "substring('12345',2,3)"
}
],
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions"
"name": "substring()",
"output": "string"
},
{
"name": "string-length()",
"description": "The string-length returns the number of characters in the string.",
"arguments": [
{
"type": "string? (Optional)",
"description": "String to test"
"type": "string",
"description": "String to split"
},
{
"type": "string",
"description": "String that splits first string"
}
],
"output": "number",
"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.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions",
"examples": [
{
"command": "string-length('abcdef')",
"output": "6"
"output": "ase11",
"command": "substring-after('Release11', 'le')"
}
],
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions"
"name": "substring-after()",
"output": "string"
},
{
"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"
"type": "string",
"description": "String to split"
},
{
"type": "string",
"description": "String that splits first string"
}
],
"output": "string",
"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.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions",
"examples": [
{
"command": "normalize-space(' abc def ')",
"output": "abc def"
"output": "Release",
"command": "substring-before('Release11', '11')"
}
],
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions"
"name": "substring-before()",
"output": "string"
},
{
"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"
"description": "Characters to remove",
"type": "string"
},
{
"type": "string",
"description": "String to insert characters from second argument"
}
],
"output": "string",
"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.",
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions",
"examples": [
{
"command": "translate('bar','abc','ABC')",
"output": "BAr"
"output": "BAr",
"command": "translate('bar','abc','ABC')"
},
{
"command": "translate('--aaa--','abc-','ABC')",
"output": "AAA"
"output": "AAA",
"command": "translate('--aaa--','abc-','ABC')"
}
],
"documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions"
"name": "translate()",
"output": "string"
}
]
},
{
"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"
}
]
],
"name": "String"
}
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
{
"universalInfo":
[
{
"category":"What is XPath",
"description":"XPath is a query language used for selecting nodes from XML and processing them. It may perform operations on strings, numbers and boolean values."
}
],
"VersionDiffs":
[
{
"version":"2.0",
"diffs":
[
"Added support for all XML simple types",
"Many new functions (tripled instruction count)",
"All expressions evaluate to sequence",
"Introduces conditional expressions and for-loops"
]
},
{
"version":"3.0",
"diffs":
[
"Dynamic function calls (function may be called without being referenced by name (find function in collection and call)",
"Inline functions",
"Namespace literals - Namespace may be embedded into function name",
"Support for union types - collections containing elements of different types",
"Mapping operator - '!' performs evaluation for each element in sequence and concatenates results",
"Introduced maps"
]
},
{
"version":"3.1",
"diffs":
[
"New operator for function chaining '=>' ",
"Introduced maps that store data in pair 'key:value' - 'map{ key : value, key : value }'",
"Introduced arrays - they differ from sequences in that they can be nested 'array{1, 5, 7, (10 to 20)}'"
]
}
]
}

View File

@@ -7,6 +7,8 @@ import xpath1 from '@/assets/tooltips/xpath/xpath1.json';
import xpath2 from '@/assets/tooltips/xpath/xpath2.json';
import xpath3 from '@/assets/tooltips/xpath/xpath3.json';
import xpath31 from '@/assets/tooltips/xpath/xpath31.json';
import TooltipDiffsComponent from './TooltipDiffsComponent.vue';
const props = defineProps({
version: {
@@ -39,10 +41,12 @@ function toggleTooltips() {
<template>
<div :class="areTooltipsHidden ? 'w-fit' : 'w-4/12'" class="hidden 2xl:flex shrink-0 items-stretch p-2 flex-row rounded-xl shadow-lg bg-gradient-to-r from-blue-400 to-blue-300 dark:from-sky-600 dark:to-sky-800 ">
<button :class="{'mr-2' : !areTooltipsHidden }" class="text-xl w-6 dark:text-slate-100 hover:font-bold" @click="toggleTooltips()">
<button :class="{'mr-2' : !areTooltipsHidden }" class="text-xl w-6 dark:text-slate-100" @click="toggleTooltips()">
T<br/>o<br/>o<br/>l<br/>t<br/>i<br/>p<br/>s
</button>
<div id="content" :class="{'hidden' : areTooltipsHidden}" class="w-full flex flex-col gap-4 p-2 overflow-scroll rounded-xl dark:text-white bg-indigo-50 dark:bg-slate-800" >
<TooltipDiffsComponent tool-name="XPath" :tool-version="props.version"></TooltipDiffsComponent>
<div class="w-full h-2"> </div>
<tooltipCategoryComponent v-for="category in selectXPathVersion()" :name="category.name">
<tooltipEntryComponent v-for="entry in category.entries" :entry-data="entry"></tooltipEntryComponent>
</tooltipCategoryComponent>

View File

@@ -0,0 +1,49 @@
<script setup lang="ts">
import xpathDiffs from '@/assets/tooltips/xpath/xpathdiffs.json';
import { ref } from 'vue';
import TooltipCategoryComponent from './TooltipCategoryComponent.vue';
const isEntryHidden = ref(true)
function getDiffEntry(toolVersion : String) : string[] {
switch(toolVersion){
case "2.0" : {
return xpathDiffs.VersionDiffs[0].diffs
}
case "3.0" : {
return xpathDiffs.VersionDiffs[1].diffs
}
case "3.1" : {
return xpathDiffs.VersionDiffs[2].diffs
}
default: {
return xpathDiffs.VersionDiffs[0].diffs
}
}
}
const props = defineProps({
toolName: {type: String, required: true},
toolVersion: {type: String, required: true}
})
</script>
<template>
<TooltipCategoryComponent :name="xpathDiffs.universalInfo[0].category">
<span class="text-center">
{{ xpathDiffs.universalInfo[0].description }}
</span>
</TooltipCategoryComponent>
<TooltipCategoryComponent v-if="toolVersion !== '1.0'" :name="'What\'s new in ' + toolName + ' ' + toolVersion ">
<span v-for=" diff in getDiffEntry(toolVersion)" v-bind:key="diff" class=" text-justify" >
* {{ diff }}
</span>
</TooltipCategoryComponent>
</template>

View File

@@ -24,8 +24,10 @@ function interpretXPathIndicators( elementType:string ):string {
switch (lastChar) {
case "*":
meaning = "Zero or more";
break;
case "?":
meaning = "Zero or one";
break;
case "+":
meaning = "One or more";
@@ -39,8 +41,8 @@ function interpretXPathIndicators( elementType:string ):string {
</script>
<template>
<div class="flex p-1 flex-col rounded-xl border border-slate-400 dark:border-slate-400 hover:font-bold">
<button :class="{ 'mb-2' : !isEntryHidden }" class="dark:text-slate-100" @click="toggleTooltips()">{{ props.entryData.name }}</button>
<div class="flex p-1 flex-col rounded-xl border border-slate-400 dark:border-slate-400">
<button :class="{ 'mb-2' : !isEntryHidden }" class="dark:text-slate-100 hover:font-bold" @click="toggleTooltips()">{{ props.entryData.name }}</button>
<div id="content" :class="{'hidden' : isEntryHidden}" class="w-full p-2 rounded-xl dark:text-white bg-indigo-50 dark:bg-slate-800" >
<h4 class="text-xl mb-2 font-bold text-justify">Description</h4>
<span class="text-justify">