// specified at the same time, except for the case when
// the base type had the same value for 'minLength'/'maxLength'
// and the two values are consistent
XmlAnySimpleType baseMinMaxLength = baseImpl.getFacet(code);
if (!(baseMinMaxLength != null &&
baseMinMaxLength.valueEquals(mlen) &&
(code == SchemaType.FACET_MIN_LENGTH ?
baseMinMaxLength.compareTo(myFacets[SchemaType.FACET_LENGTH]) <= 0 :
baseMinMaxLength.compareTo(myFacets[SchemaType.FACET_LENGTH]) >= 0)))
{
state.error(XmlErrorCodes.DATATYPE_LENGTH, null, facet);