-
Notifications
You must be signed in to change notification settings - Fork 187
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
Profile resolver compatibility with Saxon 11 (on top of other unmerged PRs) #1639
Conversation
* Separate before/after from starting/ending in modify phase * Enhance message-handler.xsl for pipeline usage and testability * Adapt XSLT to message handler returning PI * Enable saving intermediate XML files for debugging purposes * Add sample document for nonfatal errors/warnings Bug fixes: * Enable param to have insertions before/after AND have param set * Fix merge phase bug where descendant controls weren't being flattened
XSLT changes: * Pass $trace global param from top level to selection phase so it can be passed back to top level in recursion * When calling pipeline steps, output a trace message before and after, to make recursive operation clearer * Handle terminating errors during recursion, including circular references among profiles XSpec changes: * Update tests for match='profile' mode='o:select' template * Update tests for o:resolve-profile function Sample profile documents with their expected output: * import-profile_profile.xsl * import-profile2_profile.xsl, which is imported by the above profile and in turn imports another profile
Now that opr:oscal-version returns item()+ to accommodate error PI, output of $source should use xsl:sequence instead of xsl:value-of to retain string data type. XSpec tests for this function should expect PI, not error map.
Replace document-uri with base-uri. Saxon 10 and 11 can return different values from document-uri() function. For compatibility and to avoid errors when document-uri() returns empty with Saxon 11, use base-uri() instead.
Hi, @aj-stein-nist and @wendellpiez . I mentioned in the description that this PR builds on two earlier unmerged PRs. That seemed like the simplest approach, and it means that end users who want to try out the latest XSLT profile resolver can try it from this branch instead of having to merge code themselves. If you want me to rebase this code differently, let me know. |
I tested this (https://github.com/galtm/OSCAL/tree/saxon11) with Saxon-HE v11.5 and v12.0 and my tests succeeded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please to accept the PR! Much awesome work here. Going beyond the Saxon compatibility correction it includes more features for exception-handling and tracing as well as more/better tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDIT: Woops, I pressed the wrong button. These changes are still excellent, but I do want the PR fixed changed first. See below. 👇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First off, thank you very much for taking the time to do this, @galtm. I reviewed and focused on the Saxon 11 compatibility fixes and tests with the specific commit. I had to cherry-pick it to realize it was actually helpful to fix another big that is breaking our pipelines.
To that end, can you please update the PR to back out other changes and only include the 3c96945 work? I would like to test the feature improvements for profile resolution separate from this bug fix, and it is good we merge this sooner, not later. If you need my help with that or prefer I do it for myself, please let me know. Since it is your branch, I would like to ask for permission first, not forgiveness. :-)
@aj-stein-nist : The The commit on that branch is a little different from commit [3c96945] in this PR, because the work for #1549 and #1596 intersects with the Saxon 11 compatibility changes. I don't want to accidentally lose the updates in the intersecting code as a result of changing this PR, so I'm hesitant to change this PR immediately. Does staging it according to the following plan make sense?
|
I have already explained to AJ that it's my fault the stuff is all together. Planning for the wrong contingency. |
No worries. I don't see it as your fault and I don't think it even matters. We'll move forward in some fashion and get where we need to be. |
That plan is fine by me, thank you! And no worries, Wendell, we can help each other. If @galtm feels this course of action is better than cherry-picking or rebasing, we are good. In the future, I will be more clear about expectations around these things in advance. |
OK, great. I will redo the testing on the other branch before I make the new pull request, just to make sure. Look for the new pull request in the next couple of days. |
@aj-stein-nist : The new pull request is #1685. |
@aj-stein-nist , yes, this pull request can be closed without merging it. I'll update the other two PRs to bring them up to date with #1685. |
Done! |
Committer Notes
This PR addresses issue #1629 by replacing usage of
document-uri
withbase-uri
. Thedocument-uri
function is known to return different results in Saxon 10 vs. 11. Usingbase-uri
removes a difference in the XSLT profile resolver's behavior between Saxon 10 and 11.This PR builds on top of #1596, which in turn builds on #1549. What's new in this PR is commit 3c96945.
All Submissions:
"?
By submitting a pull request, you are agreeing to provide this contribution under the CC0 1.0 Universal public domain dedication.
Changes to Core Features:
Testing Done
.xspec
files in thetesting/
directory) with Oxygen 24.1, which uses Saxon 10.src/specifications/profile-resolution/profile-resolution-examples
. Diff'd the results, and they are the same except time stamps. The profiles that deliberately error out (e.g.,broken_profile.xml
) behave the same way in both Oxygen versions.