ropensci / emld

:package: JSON-LD representation of EML
https://docs.ropensci.org/emld
Other
13 stars 6 forks source link

Look into making use of schema catalogs to validate #55

Open amoeba opened 4 years ago

amoeba commented 4 years ago

Stems from #53:

The way eml_validate works now is that it chooses a root XML schema to validate the input document against based upon the root of the document. This results in the input being validated by a single XSD (and any of its locally-available imports, e.g., eml and eml-dataset, etc.) but isn't really full schema validation.

What we're doing now is good enough for 99% of use cases but we really oughta be taking a schema catalog approach to validate inputs dynamically depending on how they're structured by letting libxml2 figure it out instead of explicitly setting the schema.

As of yet, it's unclear if libxml2 or the xml2 package supports schema catalogs but we should look into this in the future to tidy up validation.

See @mbjones 's detailed comment at https://github.com/ropensci/emld/pull/53#issuecomment-581215557 for more info.