Hi Stefan!
Before suggesting a concrete solution, it would help to understand what you’re ultimately trying to achieve.
For example:
Why do you need to stop after the third IRSI?
What will the current number be used for elsewhere in the script?
Is the goal to limit output, apply special handling to certain items, or something else?
If you can describe the end result you want, there’s a good chance this can be solved.
Best regards,
SystemWeaver Support
I tried to use some common SID's to reduce work without showing to much that is VBG speciffic.
Since VBG have implementeqd the Systemite BPSE model with some minor additions, templates etc needs to be updated accordingly.
So this specification template is using a baseline to check that selected component is part of baseline and it's component list.
What I'm trying to do is to check different ItemTemplates that should behave different depending on it's content.
If a SW ECU (SID=AREU) contains several parts of type ARSC and one of theese contains a part VP0080 (Diagnostics), the if this item have 2 or more lists it's a standar Diagnostic items that describes the diagnostics behaviour.
But if a SW ECU (SID=AREU) contains only one part of type ARSC and then the item ARCP only contains 1 part and it's part VP0080 (Diagnostics), the if this item only have one lists and it's a DID List, then it's the default calibration setting to be used when producing the ECU.
I've made an extraction of the XML definition and attached it.
I hope that this might explain it a litle more.
BR
/Stefan

Edvardsson, Stefan
I would like to be able to count how many times a ForEach have looped and brake after say the third time out of 5 possible times.
In addition I would be able to forward the current number in an variable to be used elsewhere in the script.
Example:
A section item of SID='SSSE' have 5 part of type IRSI.
Using /IRSE.Count the answer is 5.
But is it possible to count and keep track of how many parts are passed in a ForEach select="/IRSI"and maybe also store that in a variable?
Thanks
/Stefan