Alex,
Thanks so much for the multiple responses to my questions so far.
You have been VERY helpful in my efforts. I have another question
regarding the use of the regular expression in the constraint. It may not
have much to do with XForms or the presentation server but I'm not sure
how to get around it. Using my previous example
<xforms:bind nodeset="/form/user/email" constraint=". =
'A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+)*@
[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+)*'
"/>
Would in theory become
<xforms:bind nodeset="/form/user/email" constraint=" matches(. ,
"'A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+)*
@
[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+)*'
") "/>
The problem is the quotes ("). The regular expression contains single
quotes (') and the constraint is enclosed in double quotes (") so using
either one to enclose the regular expression is 'problematic' at best.
Any ideas how I would get around this?
Very Respectfully,
Gregory J Blajian
Message: 3
Date: Wed, 10 Nov 2004 11:08:48 -0800
From: Alessandro Vernet <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [orbeon-user] bindings & schemas
Reply-To: [EMAIL PROTECTED]
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