Menu

Minimum Length Check

jcamnewbie
2009-11-12
2012-09-22
  • jcamnewbie

    jcamnewbie - 2009-11-12

    Can I please no how to specify a MinLength check? I have been using setLength
    but it can be used for Max or range.

     
  • drrwebber

    drrwebber - 2009-11-12

    Some examples:

    setLength(,1-1)
    setLength(,2-15)

    etc

     
  • jcamnewbie

    jcamnewbie - 2009-11-13

    ok this is a range check and not minlength check.

    setLength(,1-1) indicates that length of the string must be 1 character

    setLength(,2-15) indicates that length of the string must be between 2 to 15
    characters.

    I am looking for a minlength check. It is a common requirement in XML world to
    create an element which must possess a value.

    Along with Mandatory, Not Nillable, an additional check is required that the
    length must be atleast 1 character long.

    How do I achieve this?

     
  • drrwebber

    drrwebber - 2009-11-13

    You can use a condition in the XPath of string-length(.) < 1 combined with
    setLength(1-999) that way the string length check will only be applied if
    there is no data.

     
  • Martin Roberts

    Martin Roberts - 2009-11-13

    There is a bug in this area. I believe that you should be able to specify a
    length as 1- meaning at least one. This is common behaviour. sadly CAMV insist
    on either 1 or 1-999 where a number on its own is regarded as a maxLength and
    the number with a dash is regarded as a range. I will raise a bug and get a
    new release out by next Monday.

    Martin

     
  • jcamnewbie

    jcamnewbie - 2009-11-13

    Thanks Martin. Yes I agree setLength should be able to work with "1-" such
    that it does not checks for Max. Length.
    regards

     

Log in to post a comment.