Pass metadataId to schematron#9418
Conversation
jodygarnett
left a comment
There was a problem hiding this comment.
So I can see the test, and metadataId being used in is xsl.
Q: Do any of the built-in schemas need to make use of metadataId?
Q: Or is this a change required for a regional schema plugin? If so perhaps we can link to a metadata101 issue
I don't think any of the built-in or plugin schemas require it currently. We have a custom schematron added to |
josegar74
left a comment
There was a problem hiding this comment.
Changes look fine. Maybe to document in the manual the case for external validation, where -1 value is passed for metadata id and trying to use it will return an empty metadata:
@josegar74 Added a comment and documentation in the latest push |
Schematron validations currently receive a limited set of parameters from the validation pipeline. Custom schematron rules may require additional metadata context to perform validation reliably, but the metadata ID is not currently available to them.
This PR aims to fix this issue by passing
metadataIdfromAbstractSchematronValidatorto the generated schematron XSLT as a parameter.This provides schematron implementations with a reliable way to identify the exact metadata record being validated and supports custom validation use cases that need access to record-specific context. In our case, this is used to distinguish between approved metadata and working copies when validating associated resources.
Checklist
mainbranch, backports managed with labelREADME.mdfilespom.xmldependency management. Update build documentation with intended library use and library tutorials or documentation