From 1ac875db35f377c2b29f6766e7a6a8e5862f2ec7 Mon Sep 17 00:00:00 2001 From: pijuskri Date: Fri, 27 Feb 2026 13:35:12 +0100 Subject: [PATCH] Clarify handling of empty arguments in xpath functions contains, starts-with and ends-with --- .../xpath-contains.md | 22 +++++++++++++++++++ .../xpath-ends-with.md | 22 +++++++++++++++++++ .../xpath-starts-with.md | 22 +++++++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-contains.md b/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-contains.md index 0b4662e5d2e..5e07acae340 100644 --- a/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-contains.md +++ b/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-contains.md @@ -13,6 +13,28 @@ The `contains()` function tests whether a string attribute contains a specific s String comparisons in XPath constraints are generally case-insensitive, but this can depend on the collation setting for some databases. See [Case-Sensitive Database Behavior](/refguide/case-sensitive-database-behavior/) for more information. {{% /alert %}} +## Syntax + +The syntax is as follows: + +``` +contains ( attribute, string_expression ) +``` + +### attribute + +`attribute` specifies the attribute to test in. Attribute must be of the **String** type. + +### expression + +`string_expression` specifies the value to test for being contained in the attribute. It can be a string literal or a string parameter. + +{{% alert color="info" %}} +In the case the `attribute` is an empty value or `NULL`, the function will always return `false`, independent of the value of `string_expression`. + +In the case the `string_expression` is empty, it is treated as an empty string. The function is then equivalent to ```attribute != empty```. +{{% /alert %}} + ## Example This query returns all the customers from which the name contains the string `an`: diff --git a/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-ends-with.md b/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-ends-with.md index 2bf8a3a62a9..ed3cec7d036 100644 --- a/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-ends-with.md +++ b/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-ends-with.md @@ -13,6 +13,28 @@ The `ends-with()` function checks whether a string attribute ends with a specifi String comparisons in XPath constraints are generally case-insensitive, but this can depend on the collation setting for some databases. See [Case-Sensitive Database Behavior](/refguide/case-sensitive-database-behavior/) for more information. {{% /alert %}} +## Syntax + +The syntax is as follows: + +``` +ends-with ( attribute, string_expression ) +``` + +### attribute + +`attribute` specifies the attribute to test in. Attribute must be of the **String** type. + +### expression + +`string_expression` specifies the value to test for being at the end of the attribute. It should be a string literal or a string parameter. + +{{% alert color="info" %}} +In the case the `attribute` is an empty value or `NULL`, the function will always return `false`, independent of the value of `string_expression`. + +In the case the `string_expression` is empty, it is treated as an empty string. The function is then equivalent to ```attribute != empty```. +{{% /alert %}} + ## Example This query returns all customers whose name ends with the sub-string `sen`: diff --git a/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-starts-with.md b/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-starts-with.md index 124230b06b0..cfd45c06f50 100644 --- a/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-starts-with.md +++ b/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-starts-with.md @@ -13,6 +13,28 @@ The `starts-with()` function tests whether a string attribute starts with a spec String comparisons in XPath constraints are generally case-insensitive, but this can depend on the collation setting for some databases. See [Case-Sensitive Database Behavior](/refguide/case-sensitive-database-behavior/) for more information. {{% /alert %}} +## Syntax + +The syntax is as follows: + +``` +starts-with ( attribute, string_expression ) +``` + +### attribute + +`attribute` specifies the attribute to test in. Attribute must be of the **String** type. + +### expression + +`string_expression` specifies the value to test for being at the start of the attribute. It should be a string literal or a string parameter. + +{{% alert color="info" %}} +In the case the `attribute` is an empty value or `NULL`, the function will always return `false`, independent of the value of `string_expression`. + +In the case the `string_expression` is empty, it is treated as an empty string. The function is then equivalent to ```attribute != empty```. +{{% /alert %}} + ## Example This query returns all the customers from which the name starts with the string "Jans":