Gregory Blajian wrote:
<xforms:bind nodeset="/form/user/email" constraint=". =
'A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+)*@
[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+)*'
"/>
In the "constraint" expression you can use the matches() function to check against a regular expression. For more on matches() see:
http://www.w3c.org/TR/2004/WD-xpath-functions-20041029/#func-matches
I know Micah Dubinko asked something about using schema before and that it is in the bizdoc example but I don't "necessarily" want to validate the entire instance against a schema just constrain an instance element or two to a few distinct patterns such as telephone numbers and e-mail addresses since the rest pretty much can be done with xforms:bind statements in the instance data.
Then using the matches() function in a <xforms:bind constraint="..."/> should do it.
It looks like the document is retrieved from the database (and placed in the instance document? What is the role of the instance document?) and on the output of the processor the retrieved data is validated against the XSD but that is where I get lost. What happens if the validation fails? What does the user see? Does the document simply get displayed using summary-view.xsl regardless of the outcome of the validation? Is the xxforms_valid attribute added to ALL the XSD elements? Would I even need this:
The summary page just lists the documents. The XForms validation with a schema is done on the detail page in detail/detail-xforms-model.xml. You will notice there the schema="form-schema.xsd" on the root element. With this, the instance will be validated against the schema, and invalid nodes will be marked with xxforms:valid="false" as usual. From the perspective of the view or the page flow, it doesn't matter if validation is done with a schema or with XForms model item properties.
Alex
------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ orbeon-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/orbeon-user
