title: The content of element type "formset" must match "(constant*,form+)"
body: <p>I am getting error as </p>
  
  <blockquote>
    <p>The content of element type "formset" must match "(constant*,form+)"</p>
  </blockquote>
  
  <p>while I am executing my struts application it will give error as below:</p>
  
  <pre><code>2013-09-27 15:22:35  ERROR org.apache.commons.digester.Digester - Parse Error at line 203 column 15: The content of element type "formset" must match "(constant*,form+)".
  org.xml.sax.SAXParseException; lineNumber: 203; columnNumber: 15; The content of element type "formset" must match "(constant*,form+)".
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      at org.apache.commons.digester.Digester.parse(Digester.java:1666)
      at org.apache.commons.validator.ValidatorResources.&lt;init&gt;(ValidatorResources.java:159)
      at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)
      at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
      at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
      at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
      at javax.servlet.GenericServlet.init(GenericServlet.java:160)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5001)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5289)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>I have wriiten <strong>validation.xml</strong> file as below.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  
  &lt;!DOCTYPE form-validation PUBLIC
  "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
  "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd"&gt;
  
  
  &lt;form-validation&gt;   
      &lt;global&gt; 
      &lt;/global&gt; 
      &lt;formset&gt;        
          &lt;form name="logonForm"&gt;
              &lt;field
                  property="username"
                  depends="registerrequired"&gt;
                  &lt;arg key="logonForm.username"/&gt;
              &lt;/field&gt;
  
          &lt;/form&gt;
  
        &lt;form name="attachdynamicLookupForm"&gt;
              &lt;field 
                  property="theFile"
                  depends="registerrequired"&gt;
                  &lt;arg key="attachdynamicLookupForm.to"/&gt;
              &lt;/field&gt;
  
          &lt;/form&gt;
  
  
          &lt;form name="UserFormBean"&gt;
              &lt;field 
                  property="username"
                  depends="required"&gt;
                  &lt;arg key="userbean.username"/&gt;
              &lt;/field&gt;
              &lt;field
                  property="firstname"
                  depends="required"&gt;
                  &lt;arg key="userbean.firstname"/&gt;
              &lt;/field&gt;
              &lt;field
                  property="lastname"
                  depends="required"&gt;
                  &lt;arg key="userbean.lastname"/&gt;
              &lt;/field&gt;
              &lt;field
                  property="address"
                  depends="required"&gt;
                  &lt;arg key="userbean.address"/&gt;
              &lt;/field&gt;
              &lt;field
                  property="city"
                  depends="required"&gt;
                  &lt;arg key="userbean.city"/&gt;
              &lt;/field&gt;
              &lt;field
                  property="postcode"
                  depends="required,mask"&gt;
                  &lt;msg name="mask" key="userbean.postcode.mask"/&gt;
                  &lt;arg key="userbean.postcode"/&gt;
                  &lt;var&gt;
                      &lt;var-name&gt;mask&lt;/var-name&gt;
                      &lt;var-value&gt;^[0-9a-zA-Z]{6}&lt;/var-value&gt;
                  &lt;/var&gt;
              &lt;/field&gt;
              &lt;field
                  property="mobileno"
                  depends="required,mask"&gt;
                  &lt;msg name="mask" key="userbean.mobile.mask"/&gt;    
                  &lt;arg key="userbean.mobileno"/&gt;
                  &lt;var&gt;
                      &lt;var-name&gt;mask&lt;/var-name&gt;
                      &lt;var-value&gt;^[0-9]{12}&lt;/var-value&gt;
                  &lt;/var&gt;
              &lt;/field&gt;
              &lt;field
                  property="email"
                  depends="required,email"&gt;
                  &lt;arg key="userbean.email"/&gt;
              &lt;/field&gt;
          &lt;/form&gt;
  
          &lt;form name="DynaUpdateContactForm"&gt;
              &lt;field
                  property="contactName"
                  depends="registerrequired"&gt;
                  &lt;arg key="dynaupdatecontact.contactname"/&gt;
              &lt;/field&gt;
              &lt;field
                  property="contactNumber"
                  depends="registerrequired,phone"&gt;
                  &lt;arg key="dynaupdatecontact.contactnumber"/&gt;
              &lt;/field&gt;
          &lt;/form&gt;
             &lt;!--    resetpassword form   --&gt;
          &lt;form name="DynaResetPassActionForm"&gt;
              &lt;field
                  property="username"
                  depends="registerrequired"&gt;
                  &lt;arg key="resetpass.username"/&gt;
              &lt;/field&gt;
              &lt;field
                  property="newpass"
                  depends="registerrequired,mask"&gt;
                  &lt;arg key="resetpass.newpass"/&gt;
                  &lt;var&gt;
                      &lt;var-name&gt;mask&lt;/var-name&gt;
                      &lt;var-value&gt;^[0-9a-zA-Z]*$&lt;/var-value&gt;
                  &lt;/var&gt;
              &lt;/field&gt;
              &lt;field
                  property="conpass"
                  depends="registerrequired,mask"&gt;
                  &lt;arg key="resetpass.conpass"/&gt;
                  &lt;var&gt;
                      &lt;var-name&gt;mask&lt;/var-name&gt;
                      &lt;var-value&gt;^[0-9a-zA-Z]*$&lt;/var-value&gt;
                  &lt;/var&gt;
              &lt;/field&gt;
          &lt;/form&gt;
  
          &lt;!--    changepassword form   --&gt;
          &lt;form name="DynaChangePassActionForm"&gt;
              &lt;field
                  property="oldpassword"
                  depends="registerrequired"&gt;
                  &lt;arg key="changepass.oldpass"/&gt;
              &lt;/field&gt;
              &lt;field
                  property="newpass"
                  depends="registerrequired,mask"&gt;
                  &lt;arg key="changepass.newpass"/&gt;
                  &lt;var&gt;
                      &lt;var-name&gt;mask&lt;/var-name&gt;
                      &lt;var-value&gt;^[0-9a-zA-Z]*$&lt;/var-value&gt;
                  &lt;/var&gt;
              &lt;/field&gt;
              &lt;field
                  property="conpass"
                  depends="registerrequired,mask"&gt;
                  &lt;arg key="changepass.conpass"/&gt;
                  &lt;var&gt;
                      &lt;var-name&gt;mask&lt;/var-name&gt;
                      &lt;var-value&gt;^[0-9a-zA-Z]*$&lt;/var-value&gt;
                  &lt;/var&gt;
              &lt;/field&gt;
          &lt;/form&gt;
  
          &lt;form name="DynaUpdateSenderNameActionForm"&gt;
              &lt;field
                  property="newsendername"
                  depends="registerrequired"&gt;
                  &lt;arg key="dynaupdatesendername.newsender"/&gt;
              &lt;/field&gt;
  
          &lt;/form&gt;
  
          ///////////////////
          &lt;form name="DynaSMSRequestActionForm"&gt;
              &lt;field
                  property="req"
                  depends="registerrequired,mask"&gt;
                  &lt;arg key="smsrequest.request"/&gt;
                  &lt;var&gt;
                      &lt;var-name&gt;mask&lt;/var-name&gt;
                      &lt;var-value&gt;^[ 0-9]+$&lt;/var-value&gt;
                  &lt;/var&gt;
              &lt;/field&gt;    
          &lt;/form&gt;
  
      &lt;/formset&gt; 
  
      &lt;!-- An example formset for another locale --&gt;
      &lt;formset language="fr"&gt;
  
          &lt;constant&gt;
              &lt;constant-name&gt;postalCode&lt;/constant-name&gt;
              &lt;constant-value&gt;^[0-9a-zA-Z]*$&lt;/constant-value&gt;
          &lt;/constant&gt;
  
          &lt;!-- An example form --&gt;
          &lt;form name="logonForm"&gt;
              &lt;field
                  property="username"
                  depends="required"&gt;
                  &lt;arg key="logonForm.username"/&gt;
              &lt;/field&gt;
              &lt;field
                  property="password"
                  depends="required,mask"&gt;
                  &lt;arg key="logonForm.password"/&gt;
                  &lt;var&gt;
                      &lt;var-name&gt;mask&lt;/var-name&gt;
                      &lt;var-value&gt;^[0-9a-zA-Z]*$&lt;/var-value&gt;
                  &lt;/var&gt;
              &lt;/field&gt;
          &lt;/form&gt;
  
      &lt;/formset&gt;
  
  &lt;/form-validation&gt;
  </code></pre>