MIR-1540 migrate xeditor files to saxon compatibility#1283
Conversation
e34bc20 to
add46e1
Compare
4f1a511 to
bcfb6ba
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9080dcc3d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed6931c150
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
mir-module/src/main/resources/xslt/functions/mireditorutils.xsl
Outdated
Show resolved
Hide resolved
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06ff8fd934
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
we should put generic xslt functions to mycore in a next step 🚢 |
There was a problem hiding this comment.
Pull request overview
This PR migrates MIR’s XEditor-related XSLT/XED resources from Xalan/XSLT 1.0 patterns to Saxon-compatible XSLT 3.0 by replacing Java extension calls with pure XSLT function modules and updating editor include URIs/configuration.
Changes:
- Added new XSLT 3.0 function libraries (date conversion, editor utils, classification mapping/validation) and wired them via
xslInclude:functions. - Updated editor transforms/templates (e.g.,
mods2xeditor,xeditor2mods, xeditor templates) to use the new functions and XSLT 3.0 constructs. - Added JUnit-based XSLT regression tests plus minimal classification fixtures to validate the new functions and key editor behaviors.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| mir-module/src/test/resources/xslt/functions/mirvalidationhelper-test.xsl | XSLT harness to exercise mirvalidationhelper functions in tests. |
| mir-module/src/test/resources/xslt/functions/mirmapper-test.xsl | XSLT harness to exercise mirmapper functions in tests. |
| mir-module/src/test/resources/xslt/functions/mireditorutils-test.xsl | XSLT harness to exercise mireditorutils functions in tests. |
| mir-module/src/test/resources/xslt/functions/mirdateconverter-test.xsl | XSLT harness to exercise mirdateconverter functions in tests. |
| mir-module/src/test/resources/classification/SDNB.xml | Test classification fixture for SDNB mapping/validation. |
| mir-module/src/test/resources/classification/MIRTestClassification.xml | Test classification fixture for URI/category mapping scenarios. |
| mir-module/src/test/java/org/mycore/mir/xslt/XEditor2ModsXSLTest.java | Regression tests for editor-save transform (xeditor2mods.xsl) behavior. |
| mir-module/src/test/java/org/mycore/mir/xslt/MIRXSLTFunctionTestCase.java | Shared test base for XSLT transforms and result extraction. |
| mir-module/src/test/java/org/mycore/mir/xslt/MIRValidationHelperXSLTest.java | Unit tests for mirvalidationhelper function module. |
| mir-module/src/test/java/org/mycore/mir/xslt/MIRMapperXSLTest.java | Unit tests for mirmapper function module. |
| mir-module/src/test/java/org/mycore/mir/xslt/MIREditorUtilsXSLTest.java | Unit tests for mireditorutils function module. |
| mir-module/src/test/java/org/mycore/mir/xslt/MIRDateConverterXSLTest.java | Unit tests for mirdateconverter function module. |
| mir-module/src/main/resources/xslt/xeditor-mir-templates.xsl | Migrates xeditor templates XSLT to 3.0 and integrates default params/functions. |
| mir-module/src/main/resources/xslt/functions/mirvalidationhelper.xsl | New XSLT 3.0 validation helper functions (classification existence, SDNB validation). |
| mir-module/src/main/resources/xslt/functions/mirmapper.xsl | New XSLT 3.0 classification mapping functions and SDNB/DDC mapping logic. |
| mir-module/src/main/resources/xslt/functions/mireditorutils.xsl | New XSLT 3.0 editor utility functions (serialize, object-id validation, extent parsing). |
| mir-module/src/main/resources/xslt/functions/mirdateconverter.xsl | New XSLT 3.0 date conversion and timezone normalization functions. |
| mir-module/src/main/resources/xslt/editor/xeditor2mods.xsl | Migrates editor-save transform to XSLT 3.0 and new function modules. |
| mir-module/src/main/resources/xslt/editor/mods2xeditor.xsl | Migrates editor-load transform to XSLT 3.0 and new function modules. |
| mir-module/src/main/resources/xslt/editor/mods-node-utils.xsl | Replaces old Java-based escaping/stripping utilities with Saxon-compatible functions. |
| mir-module/src/main/resources/xslt/editor/mir2xeditor.xsl | Updates editor UI transform to use new i18n/functions includes. |
| mir-module/src/main/resources/xslt/editor/derivate2xeditor.xsl | Adjusts namespaces/excluded prefixes for Saxon/XSLT migration. |
| mir-module/src/main/resources/config/mir/mycore.properties | Updates transformer stylesheets/includes to XSLT paths and adds xslIncludes.functions. |
| mir-module/src/main/resources/META-INF/resources/editor/editor-includes.xed | Updates encoding and rewrites XEditor URIs/post-processor config for Saxon pipeline. |
| mir-module/src/main/resources/META-INF/resources/editor/editor-dynamic.xed | Rewrites preload URI syntax for Saxon-compatible XEditor resolution. |
| mir-module/src/main/resources/META-INF/resources/editor/editor-derivate.xed | Rewrites include URI syntax for Saxon-compatible XEditor resolution. |
| mir-module/src/main/resources/META-INF/resources/editor/editor-derivate-includes.xed | Rewrites source/include URIs and post-processor config for Saxon pipeline. |
| mir-module/src/main/resources/META-INF/resources/editor/editor-admins.xed | Rewrites preload URI syntax for Saxon-compatible XEditor resolution. |
| mir-module/src/main/resources/META-INF/resources/editor/change_genre.xed | Rewrites source/include URI syntax for Saxon-compatible XEditor resolution. |
Comments suppressed due to low confidence (2)
mir-module/src/main/resources/xslt/editor/mir2xeditor.xsl:12
default-parameters.xslis included via a relative path, unlike the other XSLTs which useresource:xslt/default-parameters.xsl. Sincedefault-parameters.xslis not located in this directory, this include is likely to fail at runtime (missing resource). Use the sameresource:xslt/default-parameters.xslURI (or a correct relative path) to ensure the stylesheet can be compiled.
mir-module/src/main/resources/xslt/editor/mods2xeditor.xsl:224- This
mods:typeOfResourcetemplate copies only attributes and conditionally addsmcr:categId, but it never copies the element’s text/child nodes. That means the originaltypeOfResourcevalue will be lost in the editor output, even whenmcrmods:to-category(.)returns empty. Preserve the existing content (e.g., apply templates tonode()and/or only override text when a category mapping exists).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| <xsl:function name="mirmapper:getSDNBfromDDC" as="xs:string"> | ||
| <xsl:param name="ddc-string" as="xs:string?" /> | ||
| <xsl:variable name="normalized" select="replace(normalize-space($ddc-string), '[^0-9.]', '')" /> | ||
| <xsl:variable name="ddc" select="if ($normalized != '') then xs:decimal($normalized) else ()" /> |
mir-module/src/main/resources/xslt/functions/mirdateconverter.xsl
Outdated
Show resolved
Hide resolved
rsteph-de
left a comment
There was a problem hiding this comment.
some smaller issues after first reading ...
Link to jira.
Work in progress: