E org.apache.commons.digester.Digester错误第196行第12行的分析错误:元素类型“field”的内容必须匹配“(msg | arg0 | arg1 | arg2 | arg3 | var)” 。 org.xml.sax.SAXParseException:元素类型“field”的内容必须匹配“(msg | arg0 | arg1 | arg2 | arg3 | var)”。
我的XML代码是
<formset>
<form name="groupCommForm">
<field property="groupId" depends="required">
<arg position="0" key="group.overCap.groupId"/>
</field>
<field property="subGroupId" depends="required">
<arg position="0" key="group.overCap.subgroupId"/>
</field>
<field property="productCat" depends="required">
<arg position="0" key="group.overCap.prodInd"/>
</field>
<field property="effDate" depends="required, date">
<arg position="0" key="group.overCap.effDate"/>
<var>
<var-name>datePattern</var-name>
<var-value>MM/dd/yyyy</var-value>
</var>
</field>
<field property="termDate" depends="required, date">
<arg position="0" key="group.overCap.termDate"/>
<var>
<var-name>datePattern</var-name>
<var-value>MM/dd/yyyy</var-value>
</var>
</field>
<field property="commType" depends="required">
<arg position="0" key="group.overCap.commTyp"/>
</field>
<field property="changeReason" depends="required, maxlength">
<arg position="0" key="group.overCap.comment"/>
<arg position="1" name="maxlength" key="${var:maxlength}" resource="false"/>
<var><var-name>maxlength</var-name><var-value>255</var-value></var>
</field>
</form>
<form name="asoForm">
<field property="groupId" depends="required">
<arg position="0" key="group.aso.groupId"/>
</field>
<field property="hlthDentInd" depends="required">
<arg position="0" key="group.aso.hTDentInd"/>
</field>
<field property="subScriberCount" depends="required, integer">
<arg position="0" key="group.aso.subscribCt"/>
</field>
<field property="premiumAmount" depends="required, float">
<arg position="0" key="group.aso.premAmt"/>
</field>
<field property="dependnetCount" depends="integer">
<arg position="0" key="group.aso.premAmt"/>
</field>
<field property="dueDate" depends="required, date">
<arg position="0" key="group.aso.dueDate"/>
<var>
<var-name>datePattern</var-name>
<var-value>MM/dd/yyyy</var-value>
</var>
</field>
<field property="changeReason" depends="required, maxlength">
<arg position="0" key="group.comm.comment"/>
<arg position="1" name="maxlength" key="${var:maxlength}" resource="false"/>
<var><var-name>maxlength</var-name><var-value>255</var-value></var>
</field>
<field property="asfProcCode" depends="required">
<arg position="0" key="group.comm.asf"/>
</field>
<field property="bmProcCode" depends="required">
<arg position="0" key="group.comm.bm"/>
</field>
<field property="commProcCode" depends="required">
<arg position="0" key="group.comm.comm"/>
</field>
</form>
<form name="otherAdjForm">
<field property="groupId" depends="required">
<arg position="0" key="group.otherAdj.groupId"/>
</field>
<field property="subGroupId" depends="required">
<arg position="0" key="group.otherAdj.subgroupId"/>
</field>
<field property="productCat" depends="required">
<arg position="0" key="group.otherAdj.prodCat"/>
</field>
<field property="productInd" depends="required">
<arg position="0" key="group.otherAdj.prodInd"/>
</field>
<field property="compMonth" depends="required, date">
<arg position="0" key="group.otherAdj.compMonth"/>
<var>
<var-name>datePattern</var-name>
<var-value>MM/dd/yyyy</var-value>
</var>
</field>
<field property="dueDate" depends="required, date">
<arg position="0" key="group.otherAdj.dueDate"/>
<var>
<var-name>datePattern</var-name>
<var-value>MM/dd/yyyy</var-value>
</var>
</field>
<field property="premium" depends="required, float">
<arg position="0" key="group.otherAdj.premAmt"/>
</field>
<field property="commissions" depends="required, float">
<arg position="0" key="group.otherAdj.comms"/>
</field>
<field property="asfProcCode" depends="required">
<arg position="0" key="group.comm.asf"/>
</field>
<field property="bmProcCode" depends="required">
<arg position="0" key="group.comm.bm"/>
</field>
<field property="commProcCode" depends="required">
<arg position="0" key="group.comm.comm"/>
</field>
<field property="changeReason" depends="required, maxlength">
<arg position="0" key="group.comm.comment"/>
<arg position="1" name="maxlength" key="${var:maxlength}" resource="false"/>
<var><var-name>maxlength</var-name><var-value>255</var-value></var>
</field>
</form>
<form name="premEquiForm">
<field property="groupId" depends="required">
<arg position="0" key="group.premEqui.groupId"/>
</field>
<field property="subGroupId" depends="required">
<arg position="0" key="group.premEqui.subgroupId"/>
</field>
<field property="productCat" depends="required">
<arg position="0" key="group.premEqui.prodInd"/>
</field>
<field property="startDate" depends="required, date">
<arg position="0" key="group.premEqui.startDate"/>
<var>
<var-name>datePattern</var-name>
<var-value>MM/dd/yyyy</var-value>
</var>
</field>
<field property="termDate" depends="required, date">
<arg position="0" key="group.premEqui.termDate"/>
<var>
<var-name>datePattern</var-name>
<var-value>MM/dd/yyyy</var-value>
</var>
</field>
<field property="monthlyPremEquiAmt" depends="required, float">
<arg position="0" key="group.premEqui.mnthlyPrem"/>
</field>
<field property="monthlyAccessFeeAmt" depends="required, float">
<arg position="0" key="group.premEqui.mnthlyFee"/>
</field>
<field property="asfProcCode" depends="required">
<arg position="0" key="group.comm.asf"/>
</field>
<field property="bmProcCode" depends="required">
<arg position="0" key="group.comm.bm"/>
</field>
<field property="commProcCode" depends="required">
<arg position="0" key="group.comm.comm"/>
</field>
<field property="changeReason" depends="required, maxlength">
<arg position="0" key="group.comm.comment"/>
<arg position="1" name="maxlength" key="${var:maxlength}" resource="false"/>
<var><var-name>maxlength</var-name><var-value>255</var-value></var>
</field>
</form>
<form name="usableForm">
<field property="groupId" depends="required">
<arg position="0" key="group.usable.groupId"/>
</field>
<field property="subGroupId" depends="required">
<arg position="0" key="group.usable.subgroupId"/>
</field>
<field property="lifeDentInd" depends="required">
<arg position="0" key="group.usable.lifeDentInd"/>
</field>
<field property="productInd" depends="required">
<arg position="0" key="group.usable.prodInd"/>
</field>
<field property="methodologyType" depends="required">
<arg position="0" key="group.usable.methType"/>
</field>
<field property="subScriberCount" depends="required, integer">
<arg position="0" key="group.usable.subscribCt"/>
</field>
<field property="dependnetCount" depends="integer">
<arg position="0" key="group.usable.depenCt"/>
</field>
<field property="dueDate" depends="required, date">
<arg position="0" key="group.usable.dueDate"/>
<var>
<var-name>datePattern</var-name>
<var-value>MM/dd/yyyy</var-value>
</var>
</field>
<field property="premiumCashAmt" depends="required, float">
<arg position="0" key="group.usable.premAmt"/>
</field>
<field property="asfProcCode" depends="required">
<arg position="0" key="group.comm.asf"/>
</field>
<field property="bmProcCode" depends="required">
<arg position="0" key="group.comm.bm"/>
</field>
<field property="commProcCode" depends="required">
<arg position="0" key="group.comm.comm"/>
</field>
<field property="changeReason" depends="required, maxlength">
<arg position="0" key="group.comm.comment"/>
<arg position="1" name="maxlength" key="${var:maxlength}" resource="false"/>
<var><var-name>maxlength</var-name><var-value>255</var-value></var>
</field>
</form>
</formset>
答案 0 :(得分:0)
我相信你正在使用struts?如果是这样,请尝试最简单的示例(例如:https://www.owasp.org/index.php/Struts_Validation_in_validator.xml_using_an_ActionForm),然后尝试添加更多字段,满足您的需求并查看何时获得解析器异常。
无论如何你不能使用元素,你不能使用多个,你应该使用
<arg0>
<arg1>
而不仅仅是
<arg>
<arg>