String exactExprString = validationRuleElement.getAttribute("exact");
String minExprString = validationRuleElement.getAttribute("min");
String maxExprString = validationRuleElement.getAttribute("max");
if (exactExprString.length() > 0) {
Expression expression = parseExpression(exactExprString, validationRuleElement, "exact");
rule.setExactExpr(expression);
} else if (minExprString.length() > 0 && maxExprString.length() > 0) {
Expression expression = parseExpression(minExprString, validationRuleElement, "min");
rule.setMinExpr(expression);
expression = parseExpression(maxExprString, validationRuleElement, "max");
rule.setMaxExpr(expression);
} else if (minExprString.length() > 0) {
Expression expression = parseExpression(minExprString, validationRuleElement, "min");
rule.setMinExpr(expression);
} else if (maxExprString.length() > 0) {
Expression expression = parseExpression(maxExprString, validationRuleElement, "max");
rule.setMaxExpr(expression);
} else {
throw new Exception("value-count validation rule requires a min and/or max, or exact attribute at " + DomHelper.getLocation(validationRuleElement));
}