[Xsltforms-support] No support for xsi:nil
Brought to you by:
alain-couthures
From: Steve B. <ste...@co...> - 2011-06-21 19:15:37
|
Hello I am trying to get a sample form working which should allow numeric inputs that also allow nulls. The model looks like this: <xf:model> <xf:instance id="i0" src="formmodel/99"> <XFAnswers submitUri="formmodel/99"> <XFAnswer questionUserCode="firstNames"><Value>Fred</Value></XFAnswer> <XFAnswer questionUserCode="numberOfSiblings"><Value xsi:nil="true"></Value></XFAnswer> <XFAnswer questionUserCode="weightInKg"><Value xsi:nil="true"></Value></XFAnswer> </XFAnswers> </xf:instance> <xf:submission id="s01" method="put"> <xf:resource value="//XFAnswers/@submitUri"/> <xf:message ev:event="xforms-submit-error">A submission error (<output value="event('error-type')"/>) occurred.</xf:message> </xf:submission> <xf:bind nodeset="//XFAnswer[@questionUserCode='firstNames']/Value" type="xs:string" id="firstNames"/> <xf:bind nodeset="//XFAnswer[@questionUserCode='numberOfSiblings']/Value" type="xs:long" id="numberOfSiblings"/> <xf:bind nodeset="//XFAnswer[@questionUserCode='weightInKg']/Value" type="xs:decimal" id="weightInKg"/> </xf:model> Submission errors occur until the controls bound to the numeric types have numeric values, despite the model starting with nil attributes. I'm wondering, in the method XFInstance.prototype.validate_, should the "notvalid" property really be set for bound nodes when schema validation fails - if the field is empty and nillable? Regards Steve Brown Senior Developer Corelogic Limited Email: ste...@co... <mailto:ste...@bt...> |