Skip to content

Instantly share code, notes, and snippets.

@ebruchez
Created March 21, 2012 05:10
Show Gist options
  • Select an option

  • Save ebruchez/2144633 to your computer and use it in GitHub Desktop.

Select an option

Save ebruchez/2144633 to your computer and use it in GitHub Desktop.
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xhtml:head>
<xforms:model>
<xforms:instance>
<form>
<sample>
<firstname/>
<lastname/>
</sample>
</form>
</xforms:instance>
<xforms:bind ref="sample">
<xforms:bind nodeset="firstname" type="xs:string" required="true()"
constraint="matches(.,'[A-Za-z]{6,15}')"/>
</xforms:bind>
</xforms:model>
</xhtml:head>
<xhtml:body>
<xforms:input ref="sample/firstname">
<xforms:alert>Incorrect value</xforms:alert>
</xforms:input>
</xhtml:body>
</xhtml:html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment