From 653caa8675064662d5bb1b3e4f83fee7457d2832 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Wed, 28 Jun 2023 09:22:08 +0200 Subject: [PATCH] Added Boolean category --- .../src/assets/tooltips/xpath/xpath1.json | 26 +++--- .../src/assets/tooltips/xpath/xpath2.json | 79 +++++++++++++++++++ 2 files changed, 92 insertions(+), 13 deletions(-) diff --git a/Frontend/src/assets/tooltips/xpath/xpath1.json b/Frontend/src/assets/tooltips/xpath/xpath1.json index bd2c829..899f8c9 100644 --- a/Frontend/src/assets/tooltips/xpath/xpath1.json +++ b/Frontend/src/assets/tooltips/xpath/xpath1.json @@ -118,6 +118,19 @@ ], "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" } ] }, @@ -194,19 +207,6 @@ } ], "documentationReferenceURL": "https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-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" } ] diff --git a/Frontend/src/assets/tooltips/xpath/xpath2.json b/Frontend/src/assets/tooltips/xpath/xpath2.json index f8e1d02..600be89 100644 --- a/Frontend/src/assets/tooltips/xpath/xpath2.json +++ b/Frontend/src/assets/tooltips/xpath/xpath2.json @@ -164,6 +164,85 @@ } ] }, + { + "name": "Boolean", + "entries": [ + { + "name": "boolean()", + "description": "Computes the effective boolean value of the sequence $arg.", + "arguments": [ + { + "type": "item()* (One or more)", + "description": "$arg" + } + ], + "output": "xs:boolean? (Optional)", + "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": "Number", "entries": [