Skip to content

Clarify handling of empty arguments in xpath function contains#10814

Merged
MarkvanMents merged 5 commits intomendix:developmentfrom
pijuskri:dat/contains-empty
Mar 12, 2026
Merged

Clarify handling of empty arguments in xpath function contains#10814
MarkvanMents merged 5 commits intomendix:developmentfrom
pijuskri:dat/contains-empty

Conversation

@pijuskri
Copy link
Contributor

No description provided.

@pijuskri
Copy link
Contributor Author

Needs team review

@basdebakker
Copy link
Member

The same things hold for starts-with and ends-with. This should be clarified as well.


### attribute

`attribute` specifies the attribute to test in. Attribute must be of the **String** type.
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't have to be a simple attribute, it can also be a long path ending at an attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about mentioning that, but the entire xpath constraint documentation never explicitly mentions paths and always refers to attributes. I don't know if this distinction is necessary to highlight.

Copy link
Member

Choose a reason for hiding this comment

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

I'll leave this for @MarkvanMents to consider.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@pijuskri
So you are saying that I can specify an attribute by either
[Sales.Customer_Address/Sales.Address[contains(City, 'otterda')]]
or
[Sales.Customer_Address[contains(Sales.Address/City, 'otterda')]]
?

In that case, I think we should add a general point about what we mean by attribute in https://docs.mendix.com/refguide/xpath-constraint-functions/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is how i understood it. It would be ideal to clarify this like you mention.,

Copy link
Collaborator

Choose a reason for hiding this comment

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

@pijuskri
I've added this in c2d76bb but I'm not sure I've got the syntax right. I might need to have Sales.Order_Customer/Customer/Name?

Can you test and confirm how I can use a path correctly in the attribute?
Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delayed review, the path indeed should be different, added a comment on the correction

@basdebakker
Copy link
Member

Approved by datastorage team.

Copy link
Collaborator

@MarkvanMents MarkvanMents left a comment

Choose a reason for hiding this comment

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

@pijuskri
Thanks for the correction. Looks good to me. Are you happy with my updates? If so, I'll merge.

@pijuskri
Copy link
Contributor Author

pijuskri commented Mar 12, 2026

@MarkvanMents LGTM, we can merge

@MarkvanMents MarkvanMents merged commit aadbe73 into mendix:development Mar 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants