If statement in UFFE
AnsweredHi,
I have an optional part in an XML I'm trying to create through an UFFE.
The documentation on the file exporters mention one may use IF-THEN-ELSE statments to achieve this.
So I tried the following:
<TEST>
#IF (@Get('cnt') > 0)
#BEGIN
<val>Yes it's there</val>
#END
#ELSE
#BEGIN
<val>Nope, not there</val>
#END
#END
<ELEMENTX>Just another text</ELEMENTX>
</TEST>
It works partially: the "<val>Yes it's there</val>" part is there, but the remainder of the XML gets cut off. So the output (having 'cnt' = 1) is:
<TEST>
<waarde>ja</waarde>
Should the statement be worded differently?
-
Official comment
Hi Marc,
You have one additional #END in the end of your IF clause. If removing that doesn't help, please share the whole configuration and also what comes out of it, now the configuration and result isn't from the same setup.
Thanks,
Thomas
-
Thanks Thomas,
I must have completey overlooked that additional statement in simplyfing the example. But removing it did actually solve it.
Thanks for your comment! -
Hehe, everyone need the extra pair of eyes sometimes. :-)
-
Is there a list of all commands that can be used in UFFE? I know the @Get, #foreeach, #if - is there a complete list?
Please sign in to leave a comment.
Comments
4 comments