If you use the body form of an assert or discriminator the { } surrounding the expression must be the VERY FIRST characters, and VERY LAST characters.
Otherwise you get an unscrutible error about it being impossible to convert a string to a boolean.
This is too fussy and fragile.
First, if you do blow it on the syntax of the expression one should get a useful Schema Definition Error.
Second, we should be a little more tolerant i.e., any whitespace before the
{ and any after the }should be trimmed away. Otherwise you have no choice but to put in CDATA to prevent line wrapping from perhaps inserting whitespace that breaks things.
I.e., This doesn't work due to whitespace before the
{ and after the }:
<dfdl:discriminator>
{ if (../ex:presenceBit = 0) then false() else if (dfdl:occursIndex() = 1) then true() else if (..[dfdl:occursIndex()-1]/ex:repeatBit = 0) then false() else true() }</dfdl:discriminator>
You must use <![CDATA[ ... ]]> to prevent line wrapping from breaking this.