relaxng validation: specify range limit for integer

If you want to specify range limit for integers, you may be interested in the following parameters:

  • minInclusive
  • maxInclusive
  • minExclusive
  • maxExclusive

Note that ‘min’ and ‘max’ parameters do NOT exist, you must specify whether boundaries are included or not.

Example

<define name="mytype.content">
 <data type="positiveInteger">
  <param name="minInclusive">1</param>
  <param name="maxInclusive">31</param>
 </data>
</define>

With above example, validation will fail on any input that’s not an integer or that’s not within [1:31] range.

sources

Post a Comment

Your email is never published nor shared. You're allow to say what you want...


Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/remydamo/websites/qc4blog/www/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81

Warning: fsockopen() [function.fsockopen]: unable to connect to www.sweetcaptcha.com:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /home/remydamo/websites/qc4blog/www/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81