Skip to content

Clarify handling of empty arguments in xpath function contains#10814

Open
pijuskri wants to merge 4 commits intomendix:developmentfrom
pijuskri:dat/contains-empty
Open

Clarify handling of empty arguments in xpath function contains#10814
pijuskri wants to merge 4 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.

@basdebakker
Copy link
Member

Approved by datastorage team.

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