I'm working with a schema that was built by a third party and I'd like to validate it with lxml. The problem is that such a schema is split over different xsd files, which reference themselves.
For example, a file called "extension.xsd" (which builds upon the "master" schema) has a line like:
<redefine schemaLocation="master.xsd">
If I try to validate it with lxml (parsing, then using XMLSchema
then validating another document which I know is valid already), I only get validation using "extension" and not "master": in other words, the validation fails (because in the XML file there are elements only present in "master" and not in "extension").
How can I solve (or work around) this issue? Thanks!
If lxml doesn't support "redefine", the best option would be to fix it and submit a patch. :)
Failing that, the workaround would be to parse the master.xsd file yourself, and then apply the changes from extension.xsd, and output a single xsd file with the combined schema.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With