The constraint Property

https://www.w3.org/community/xformsusers/wiki/XForms_2.0#The_constraint_Property

Has this text:

"Note:
Specifying minimum and maximum occurrences for nodes in the instance data  
can be achieved by using the count() function within a constraint  
property."

I'd like to convert this note into an example.

So, I assume what is meant is that you can do something like this:

 <bind ref="wishes" constraint="count(wish)&lt;4"/>

However, I'm not sure when this would show up, except with a submit.

If you do a repeat:

 <repeat ref="wishes/wish">
     <input ref="."><label>What is your wish?</label></input>
 </repeat>

the repeat wouldn't stop you adding new wishes.

Can anybody think of a good example?

Steven

Received on Monday, 28 November 2016 09:39:36 UTC