Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmlschema 2.5 not working for validation #221

Open
tlambert03 opened this issue Sep 24, 2023 · 0 comments
Open

xmlschema 2.5 not working for validation #221

tlambert03 opened this issue Sep 24, 2023 · 0 comments

Comments

@tlambert03
Copy link
Owner

not sure what happened upstream, but xmlschema 2.5 breaks tests:

    def validate_xml_with_xmlschema(
        xml: XMLSource, schema: Path | str | None = None, warn_on_schema_update: bool = True
    ) -> AnyElementTree:
        """Validate XML against an XML Schema using xmlschema."""
        from xmlschema.exceptions import XMLSchemaException

        tree = ensure_2016(xml, warn_on_schema_update=warn_on_schema_update, as_tree=True)
        xmlschema = _get_XMLSchema(schema or OME_2016_06_XSD)
        try:
            xmlschema.validate(tree)  # type: ignore[arg-type]
        except XMLSchemaException as e:
>           raise ValidationError(str(e)) from None
E           ome_types._conversion.ValidationError: failed validating <Element {http://www.openmicroscopy.org/Schemas/OME/2016-06}OME at 0x11df99a00> with XsdElement(name='OME:OME', occurs=[1, 1]):
E
E           Reason: value ('urn:lsid:loci.wisc.edu:LightSource:OWS1',) not found for XsdKey(name='OME:LightSourceIDKey') (2 times)
E
E           Schema:

it's not critical, since most people are likely using lxml anyway. but should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant