- From: Clark, John <CLARKJ2@ccf.org>
- Date: Wed, 17 Dec 2008 16:13:31 -0500
- To: xforms <www-forms@w3.org>
- Message-ID: <F122C25B4CD6F34BB119A9759367960104595C7C@CCHSCLEXMB59.cc.ad.cchs.net>
Laszlo, XForms 1.1 declares a set of additional datatypes that correspond to many of the XML Schema Datatypes, only they allow empty values[0]. Your example might look like the following, when using one of these XForms datatypes: <xforms:bind nodeset="/data/number" type="xforms:integer"/> Of course, your processor will need to support them for this to help you. Based on the implementation report[1], it looks like the Mozilla XForms Extension supports this datatype, but I haven't tested that myself. Take care, John L. Clark [0] http://www.w3.org/TR/2007/CR-xforms11-20071129/#empty-content-types [1] http://www.w3.org/MarkUp/Forms/2008/XForms11ImplReports/FFplugins/Results/XF11_05_Results.html -----Original Message----- From: www-forms-request@w3.org on behalf of Jabba Laci Sent: Wed 12/17/2008 4:04 PM To: xforms Subject: Re: validating an xform Hi, > In addition, for implementations that support it, you can also use XML > Schema types, which are quite powerful. Thanks for the answers. I have a difficulty with types. I have an input form, where I'd like to accept integers only. The field is optional. However, if I precise its type to be "xsd:integer", the field becomes required since an empty field is not an integer. So the field must be filled otherwise the form cannot be sent :( Here is what I tried: <xforms:bind nodeset="/data/number" type="xsd:integer" required="false()" /> However, required="false()" has no effect. How to set it optional? Thanks, Laszlo =================================== P Please consider the environment before printing this e-mail Cleveland Clinic is ranked one of the top hospitals in America by U.S. News & World Report (2008). Visit us online at http://www.clevelandclinic.org for a complete listing of our services, staff and locations. Confidentiality Note: This message is intended for use only by the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. Thank you.
Received on Wednesday, 17 December 2008 21:14:20 UTC