I want to filter a set of Items whether an attribute is empty or not. I Have tried using matches:
@ATTR.Matches('^$') that is supposed to identify empty strings(?). I want to do this both for an enumeration attribute and a string attribute.
How can I do this?
It does. I thought I tried that yesterday without success. Thanks!
Hello, I have similar question here: is there any way I can check if <List> object is empty?
Hi Jakub,
You can use .Count which counts the number of object in a list.
Example:
<If test="/SID1/SID2.Count=0">
........
</If>
Best regards,
Bashar
There is a rather elegant, but possibly a bit abstract, example in the Help manual, on the "[ ] Operator":
/IRRS[/ISSE=[]]
Returns all report sections without any subsection.
SystemWeaver
I want to filter a set of Items whether an attribute is empty or not. I Have tried using matches:
@ATTR.Matches('^$') that is supposed to identify empty strings(?). I want to do this both for an enumeration attribute and a string attribute.
How can I do this?
[@ATTR='']
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstJan Söderberg
[@ATTR='']
SystemWeaver
It does. I thought I tried that yesterday without success. Thanks!
Bashar Nassar
/part::ARPP[@AREP='']
ERROR: No '=' operator on (Boolean, String) could be found
But if you add ".ToString" it will work
/part::ARPP[@AREP.ToString='']
Magnus W
In your case Bashar you have a boolean attribute: AREP, while Fredrik possibly had a string attribute.
1 person likes this
Bashar Nassar
Inactive VCC contacts
Hello, I have similar question here: is there any way I can check if <List> object is empty?
Bashar Nassar
Hi Jakub,
You can use .Count which counts the number of object in a list.
Example:
<If test="/SID1/SID2.Count=0">
........
</If>
Best regards,
Bashar
Jan Söderberg
There is a rather elegant, but possibly a bit abstract, example in the Help manual, on the "[ ] Operator":
/IRRS[/ISSE=[]]
Returns all report sections without any subsection.
-
Comparing two versions of a structure
-
Context and path language
-
Overview of meta model
-
Importing old data
-
Cannot find multiple version items
-
Accumulated bar chart
-
Cannot remove part - is referenced
-
View of non accessable data
-
List and path language
See all 33 topics