Open PaulKalbitzer opened 2 weeks ago
Hi,
the schema validation is the validation of XSD schema file using the meta-schema (a schema built once using the XSD files in the directory xmlschema/schemas/XSD_1.1), and only checking the syntax of XSD definitions/declarations, without parsing the validity of the values (e.g. if a baseType
value points to a valid type and if it's compatible with the parsed type), so it's normal that a schema is checked as valid by the meta-schema but an invalidity is found when you try to build a schema instance from it.
The schema that you use is valid with XSD 1.0, but is invalid with XSD 1.1. Taking the comments above the code that raises the exception:
def _parse_complex_content_extension(self, elem: ElementType, base_type: Any) -> None:
# Complex content extension with simple base is forbidden XSD 1.1.
# For the detailed rule refer to XSD 1.1 documentation:
# https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/#sec-cos-ct-extends
if base_type.is_simple() or base_type.has_simple_content():
msg = _("base %r is simple or has a simple content")
self.parse_error(msg % base_type, elem)
base_type = self.any_type
There is also a case of XSD W3C tests that is valid with XSD 1.0 and invalid with XSD 1.1.
Comparing the matching rule 1.4 for XSD 1.0 and XSD 1.1 the latest is more strict.
Best regards
I experience an Error in XMLSchema11, this problem seem not to occure in XMLSchema10
Validating the schema works without any issue, but parsing it results in the xmlschema.validators.exceptions.XMLSchemaParseError shown below
Code used
Schema used
https://schemas.liquid-technologies.com/NewsML/Core/2.24/
Errortrace