kitodo-presentation
kitodo-presentation copied to clipboard
[FEATURE] General reusable validation implementation and middleware for validating DOMDocument
This PR provides abstract classes to derived from for custom validation and reusable implementations for validation of DOMDocument.
- Abstract validator and validation stack from which it can be derived (Can be handled as standalone validators as well, since they are derived from the
AbstractValidatorof Extbase) - Implementation and tests of
DOMDocumentValidationStack,XMLSchemesValidatorandSaxonXslToSvrlValidator - Comprehensive documentation
- Customisable
DOMDocumentValidationmiddleware via TypoScript settingdomDocumentValidationValidators
Example of middleware
URI Query: dlf/domDocumentValidation&url=https%3A%2F%2Fwww.example.com%2Fmetsmods.xml
JSON response
{
"valid": false,
"results": {
"XML-Schemes Validator": [
"Element '{http://www.loc.gov/METS/}mdWrap', attribute 'MDTYP': The attribute 'MDTYP' is not allowed.\n",
"Element '{http://www.loc.gov/METS/}mdWrap': The attribute 'MDTYPE' is required but missing.\n"
],
...
}
}