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

[FEATURE] General reusable validation implementation and middleware for validating DOMDocument #1313

Open
wants to merge 47 commits into
base: master
Choose a base branch
from

Conversation

markusweigelt
Copy link
Contributor

@markusweigelt markusweigelt commented Aug 26, 2024

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 AbstractValidator of Extbase)
  • Implementation and tests of DOMDocumentValidationStack, XMLSchemesValidator and SaxonXslToSvrlValidator
  • Comprehensive documentation
  • Customisable DOMDocumentValidation middleware via TypoScript setting domDocumentValidationValidators

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"
    ],
    ...
  }
}

@markusweigelt markusweigelt marked this pull request as draft August 26, 2024 17:10
@markusweigelt markusweigelt changed the title Xml validator [FEATURE] Validation Aug 26, 2024
@sebastian-meyer sebastian-meyer added the ⚙ feature A new feature or enhancement. label Aug 27, 2024
@markusweigelt markusweigelt marked this pull request as ready for review August 29, 2024 16:29
@markusweigelt markusweigelt changed the title [FEATURE] Validation [FEATURE] General reusable validation implementation and middleware for validating DOMDocument Aug 29, 2024
Comment on lines 90 to 93
To learn about available options (e.g., to select the PHP version), check the usage info:

```bash
Build/Test/runTests.sh -h
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the removed command this makes no more sense. Was the removal intentional? Then this should be removed as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙ feature A new feature or enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants