CSL Choose If - Test for multiple conditions with one negation
I would like to test for multiple conditions where one condition should NOT occur.
For example I would like to test if the variable "issue" is text, i.e. non-numeric.
That means it should exist (variable="issue") and it should be NOT numeric (is-numeric="issue" match="none").
As far as I understand CSL currently does not allow for such a test in a single if-statement because you have to mix a positive test with a negation.
You can stack tests like this:
<choose>
<if variable="issue">
<choose>
<if is-numeric="issue" match="none">
…
But then you have to repeat the stacked test in the <else> block.
For example I would like to test if the variable "issue" is text, i.e. non-numeric.
That means it should exist (variable="issue") and it should be NOT numeric (is-numeric="issue" match="none").
As far as I understand CSL currently does not allow for such a test in a single if-statement because you have to mix a positive test with a negation.
You can stack tests like this:
<choose>
<if variable="issue">
<choose>
<if is-numeric="issue" match="none">
…
But then you have to repeat the stacked test in the <else> block.
That said, in your example it is pretty likely that you don't actually have to test for the presence of the variable: remember that variables that don't exist are simply not printed and you can use groups to make sure that any terms/labels you have for them aren't printed either when you use them. (To be more specific I'd need the full example).