Skip to content

TEDEFO-1854 Align toolkit to improved uniqueness testing#131

Open
rousso wants to merge 1 commit intodevelopfrom
TEDEFO-1854-improve-uniqueness-testing
Open

TEDEFO-1854 Align toolkit to improved uniqueness testing#131
rousso wants to merge 1 commit intodevelopfrom
TEDEFO-1854-improve-uniqueness-testing

Conversation

@rousso
Copy link
Contributor

@rousso rousso commented Feb 4, 2026

  • Implement typed uniqueness conditions (any value in any collection)
  • Fix: repeatable fields used as own context treated as scalar
  • Rename error code EXPECTED_SEQUENCE to EXPECTED_SCALAR

- Implement typed uniqueness conditions (any value in any collection)
- Fix: repeatable fields used as own context treated as scalar
- Rename error code EXPECTED_SEQUENCE to EXPECTED_SCALAR
void testUniqueValueCondition() {
testExpressionTranslationWithContext(
"count(for $x in PathNode/TextField, $y in /*/PathNode/TextField[. = $x] return $y) = 1",
"count(/*/PathNode/TextField/normalize-space(text())[. = PathNode/TextField/normalize-space(text())]) = 1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a valid XPath expression: /*/PathNode/TextField/normalize-space(text()) is not a node, it is a list of strings, so it cannot be used with a predicate.

In addition, the content of the predicate does not do what we need: the right hand-side of . = PathNode/TextField/normalize-space(text()) looks for a PathNode under the current TextField.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants