Re: [Xsltforms-support] No support for xsi:nil
Brought to you by:
alain-couthures
From: Alain C. <ala...@ag...> - 2011-06-22 20:01:07
|
Hello Steve, As you suggested, I have modified the setting of the "notvalid" property in the XFInstance.prototype.validate_() method to support xsi:nil. Please have a look at rev. 508 It is my understanding that xsi:nil will not allow any value at all. For allowing both empty values and typed values, you have to use xforms types instead of xsd types. Thank you for your feedbacks! -Alain Le 21/06/2011 21:03, Steve Brown a écrit : > > 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...> > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |