AnsweredAssumed Answered

How do I set maxLength of a string on an xforms template

Question asked by harrymoore on Feb 20, 2007
Latest reply on Feb 22, 2007 by arielb
Simple question: how do I set a limit on the lenth of an input string?

I found an example somewhere that showed how to use an xs:restriction but this does not appear to work:
<xs:simpleType name="string25">
    <xs:restriction base="xs:normalizedString">
         <xs:maxLength value="25"/>
    </xs:restriction>
</xs:simpleType>

<xs:element name="content_idx" type="string25" default="" minOccurs="1" maxOccurs="1">
     <xs:annotation>
         <xs:appinfo>
             <alf:alert>Content ID is required</alf:alert>
             <alf:label>Content ID</alf:label>
             <alf:appearance>minimal</alf:appearance>
        </xs:appinfo>
    </xs:annotation>
</xs:element>

Looks simple enough. Why doesn't it work?

Outcomes