How to retrieve first non-empty element using Xpath

0
Hi, I’d like to retrieve the first non-empty element using a xpath. How can I go about doing so? Thanks​​​​​​​
asked
1 answers
3

Hi Alejandro,

What do you define your element as?

  • If it is an attribute then it is
    [attr1 != empty]
  • If it is an association then it is
    [MyFirstModule.EntityA_EntityB/MyFirstModule.EntityB]
    (to find where the association is empty then it is
    [not(MyFirstModule.EntityA_EntityB/MyFirstModule.EntityB)])
  • If it is an entity in general, you can simply retrieve the first object (no XPath needed)

To obtain the “first” you can apply the relevant sorting with your retrieve action

answered