diff --git a/xmlschema/validators/facets.py b/xmlschema/validators/facets.py index 6d9b8b1b..2d6f3edc 100644 --- a/xmlschema/validators/facets.py +++ b/xmlschema/validators/facets.py @@ -242,9 +242,9 @@ def _parse_value(self, elem: ElementType) -> None: primitive_type = getattr(self.base_type, 'primitive_type', None) if primitive_type is None or primitive_type.name not in {XSD_QNAME, XSD_NOTATION_TYPE}: # See: https://www.w3.org/Bugs/Public/show_bug.cgi?id=4009 - self._validator = self._min_length_validator # type: ignore[assignment] + self._validator = self._max_length_validator # type: ignore[assignment] - def _min_length_validator(self, value: Any) -> None: + def _max_length_validator(self, value: Any) -> None: if len(value) > self.value: reason = "value length cannot be greater than {!r}".format(self.value) raise XMLSchemaValidationError(self, value, reason)