xsi:nil and nillable [was RE: [FormsPlayer] Alert]
> These fields are empty on initiating. The binding is for input control.If you say in your schema that an item is a date or an integer (for example)
> Is it a problem if the fields are empty in the initiating XML instance?
then it *must* be a date or an integer. An empty string is obviously not a
date or an integer. One way round this is to redefine your schema to allow
an empty value, but this is a lot of work for each data type that you want,
and anyway, this may not fit with the logic of your schema. For example, the
integer 'how many years have you lived at your previous address', may be
allowed to be empty if the person has lived at their current address for
more than three years.
A better way then, would be to set the nillable attribute in your schema,
and then set the xsi:nil attribute to "true" on the instance data:
<previous xsi:nil="true" />
If your schema says that 'previous' is an integer then this would mean that
it also cannot be empty, but in this example we can see that the person has
been at their current address more than 3 years, so we set 'previous' to
nil. (Note that this is not the same as using the model item properties such
You could turn this value on and off using a <bind>:
calculate="/YearsAtAddress/current > 3" />
for more information.
4 Pear Tree Court
T: +44 (20) 7689 9232