Skip to content

Conversation

@galtm
Copy link
Contributor

@galtm galtm commented Dec 30, 2022

Committer Notes

This PR implements support in the XSLT profile resolver for an XML profile importing an XML profile. This is a feature that the spec describes and that was partially implemented by @wendellpiez earlier.

This PR builds on top of #1549, so it might be simpler to merge that PR first. Let me know if I should create this PR in a different way when it depends on unmerged code. What's new in this PR are commits ccef4cf and 883e1f3, containing the following pieces.

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

Sample trace messages showing recursion

When I enabled tracing and ran the resolver on import-profile1_profile.xml which imports import-profile2_profile.xml which in turn imports base-test_profile.xml, the messages about steps in the pipeline were in the following sequence:

Start of step 1: XSLT oscal-profile-resolve-select.xsl, document import-profile1_profile.xml ... 
Start of step 1: XSLT oscal-profile-resolve-select.xsl, document import-profile2_profile.xml ... 
Start of step 1: XSLT oscal-profile-resolve-select.xsl, document base-test_profile.xml ... 
End of step 1: XSLT oscal-profile-resolve-select.xsl, document base-test_profile.xml ... 
Start of step 2: XSLT oscal-profile-resolve-metadata.xsl, document base-test_profile.xml ... 
End of step 2: XSLT oscal-profile-resolve-metadata.xsl, document base-test_profile.xml ... 
Start of step 3: XSLT oscal-profile-resolve-merge.xsl, document base-test_profile.xml ... 
End of step 3: XSLT oscal-profile-resolve-merge.xsl, document base-test_profile.xml ... 
Start of step 4: XSLT oscal-profile-resolve-modify.xsl, document base-test_profile.xml ... 
End of step 4: XSLT oscal-profile-resolve-modify.xsl, document base-test_profile.xml ... 
Start of step 5: XSLT oscal-profile-resolve-finish.xsl, document base-test_profile.xml ... 
End of step 5: XSLT oscal-profile-resolve-finish.xsl, document base-test_profile.xml ... 
Applying step 6: checking for severe errors ... 
Applying step 7: finalize ... 
End of step 1: XSLT oscal-profile-resolve-select.xsl, document import-profile2_profile.xml ... 
Start of step 2: XSLT oscal-profile-resolve-metadata.xsl, document import-profile2_profile.xml ... 
End of step 2: XSLT oscal-profile-resolve-metadata.xsl, document import-profile2_profile.xml ... 
Start of step 3: XSLT oscal-profile-resolve-merge.xsl, document import-profile2_profile.xml ... 
End of step 3: XSLT oscal-profile-resolve-merge.xsl, document import-profile2_profile.xml ... 
Start of step 4: XSLT oscal-profile-resolve-modify.xsl, document import-profile2_profile.xml ... 
End of step 4: XSLT oscal-profile-resolve-modify.xsl, document import-profile2_profile.xml ... 
Start of step 5: XSLT oscal-profile-resolve-finish.xsl, document import-profile2_profile.xml ... 
End of step 5: XSLT oscal-profile-resolve-finish.xsl, document import-profile2_profile.xml ... 
Applying step 6: checking for severe errors ... 
Applying step 7: finalize ... 
End of step 1: XSLT oscal-profile-resolve-select.xsl, document import-profile1_profile.xml ... 
Start of step 2: XSLT oscal-profile-resolve-metadata.xsl, document import-profile1_profile.xml ... 
End of step 2: XSLT oscal-profile-resolve-metadata.xsl, document import-profile1_profile.xml ... 
Start of step 3: XSLT oscal-profile-resolve-merge.xsl, document import-profile1_profile.xml ... 
End of step 3: XSLT oscal-profile-resolve-merge.xsl, document import-profile1_profile.xml ... 
Start of step 4: XSLT oscal-profile-resolve-modify.xsl, document import-profile1_profile.xml ... 
End of step 4: XSLT oscal-profile-resolve-modify.xsl, document import-profile1_profile.xml ... 
Start of step 5: XSLT oscal-profile-resolve-finish.xsl, document import-profile1_profile.xml ... 
End of step 5: XSLT oscal-profile-resolve-finish.xsl, document import-profile1_profile.xml ... 
Applying step 6: checking for severe errors ... 
Applying step 7: finalize ... 

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:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you included examples of how to use your new feature(s)?
  • Have you updated all OSCAL website and readme documentation affected by the changes you made? Changes to the OSCAL website can be made in the docs/content directory of your branch.

@galtm
Copy link
Contributor Author

galtm commented Dec 30, 2022

I didn't check the boxes about examples, the OSCAL website, or readme documentation. I'm willing to contribute to those things but will need some clarification on what I should do. @david-waltermire-nist , can you help guide me? Thanks!

@galtm galtm marked this pull request as ready for review December 30, 2022 15:25
@wendellpiez wendellpiez added the Profile Resolution Issues relating to profile resolution. label Jan 4, 2023
@wendellpiez
Copy link
Contributor

@galtm I admit I am a bit of a freak for legibility in tracebacks.

What about a rejigger of the reports format, maybe something like?

Step 4 start : document base-test_profile.xml, XSLT oscal-profile-resolve-modify.xsl ... 
Step 4 end   : document base-test_profile.xml, XSLT oscal-profile-resolve-modify.xsl ... 
Step 5 start : document base-test_profile.xml, XSLT oscal-profile-resolve-finish.xsl ... 
Step 5 end   : document base-test_profile.xml, XSLT oscal-profile-resolve-finish.xsl ... 
Step 6 APPLYING: checking for severe errors ... 
Step 7 APPLYING: finalize ... 

You get the idea - something that exploits the fixed-width font of most terminals for ASCII-artish improved display (human consumers) as well as possibly later parsing/polling (bot consumers). What do you think?

@galtm
Copy link
Contributor Author

galtm commented Jan 4, 2023

@galtm I admit I am a bit of a freak for legibility in tracebacks.

What about a rejigger of the reports format, maybe something like?

Step 4 start : document base-test_profile.xml, XSLT oscal-profile-resolve-modify.xsl ... 
Step 4 end   : document base-test_profile.xml, XSLT oscal-profile-resolve-modify.xsl ... 
Step 5 start : document base-test_profile.xml, XSLT oscal-profile-resolve-finish.xsl ... 
Step 5 end   : document base-test_profile.xml, XSLT oscal-profile-resolve-finish.xsl ... 
Step 6 APPLYING: checking for severe errors ... 
Step 7 APPLYING: finalize ... 

You get the idea - something that exploits the fixed-width font of most terminals for ASCII-artish improved display (human consumers) as well as possibly later parsing/polling (bot consumers). What do you think?

@wendellpiez : Good suggestion! I'll make some improvements and push them to this branch.

@galtm
Copy link
Contributor Author

galtm commented Jan 8, 2023

What about a rejigger of the reports format [...]

44cd74d updates messages to come out like the following instead. @wendellpiez what do you think? Having an "end" message for steps 6 and 7 didn't seem that worthwhile, so I left that out.

Step 1 start : document import-profile1_profile.xml, XSLT oscal-profile-resolve-select.xsl
Step 1 start : document import-profile2_profile.xml, XSLT oscal-profile-resolve-select.xsl
Step 1 start : document base-test_profile.xml, XSLT oscal-profile-resolve-select.xsl
Step 1 end   : document base-test_profile.xml, XSLT oscal-profile-resolve-select.xsl
Step 2 start : document base-test_profile.xml, XSLT oscal-profile-resolve-metadata.xsl
Step 2 end   : document base-test_profile.xml, XSLT oscal-profile-resolve-metadata.xsl
Step 3 start : document base-test_profile.xml, XSLT oscal-profile-resolve-merge.xsl
Step 3 end   : document base-test_profile.xml, XSLT oscal-profile-resolve-merge.xsl
Step 4 start : document base-test_profile.xml, XSLT oscal-profile-resolve-modify.xsl
Step 4 end   : document base-test_profile.xml, XSLT oscal-profile-resolve-modify.xsl
Step 5 start : document base-test_profile.xml, XSLT oscal-profile-resolve-finish.xsl
Step 5 end   : document base-test_profile.xml, XSLT oscal-profile-resolve-finish.xsl
Step 6       : document base-test_profile.xml, check for severe errors
Step 7       : document base-test_profile.xml, finalize
Step 1 end   : document import-profile2_profile.xml, XSLT oscal-profile-resolve-select.xsl
Step 2 start : document import-profile2_profile.xml, XSLT oscal-profile-resolve-metadata.xsl
Step 2 end   : document import-profile2_profile.xml, XSLT oscal-profile-resolve-metadata.xsl
Step 3 start : document import-profile2_profile.xml, XSLT oscal-profile-resolve-merge.xsl
Step 3 end   : document import-profile2_profile.xml, XSLT oscal-profile-resolve-merge.xsl
Step 4 start : document import-profile2_profile.xml, XSLT oscal-profile-resolve-modify.xsl
Step 4 end   : document import-profile2_profile.xml, XSLT oscal-profile-resolve-modify.xsl
Step 5 start : document import-profile2_profile.xml, XSLT oscal-profile-resolve-finish.xsl
Step 5 end   : document import-profile2_profile.xml, XSLT oscal-profile-resolve-finish.xsl
Step 6       : document import-profile2_profile.xml, check for severe errors
Step 7       : document import-profile2_profile.xml, finalize
Step 1 end   : document import-profile1_profile.xml, XSLT oscal-profile-resolve-select.xsl
Step 2 start : document import-profile1_profile.xml, XSLT oscal-profile-resolve-metadata.xsl
Step 2 end   : document import-profile1_profile.xml, XSLT oscal-profile-resolve-metadata.xsl
Step 3 start : document import-profile1_profile.xml, XSLT oscal-profile-resolve-merge.xsl
Step 3 end   : document import-profile1_profile.xml, XSLT oscal-profile-resolve-merge.xsl
Step 4 start : document import-profile1_profile.xml, XSLT oscal-profile-resolve-modify.xsl
Step 4 end   : document import-profile1_profile.xml, XSLT oscal-profile-resolve-modify.xsl
Step 5 start : document import-profile1_profile.xml, XSLT oscal-profile-resolve-finish.xsl
Step 5 end   : document import-profile1_profile.xml, XSLT oscal-profile-resolve-finish.xsl
Step 6       : document import-profile1_profile.xml, check for severe errors
Step 7       : document import-profile1_profile.xml, finalize

@wendellpiez
Copy link
Contributor

So awesome!

@aj-stein-nist
Copy link
Contributor

Hi @galtm, thanks for submitting yet another excellent PR. We had to rebase develop and that leads to the "This branch has conflicts that must be resolved" conflicts below. I can help you with that, please let me know if and when you need that help. Thanks.

@galtm galtm force-pushed the profiler-recursive branch from 44cd74d to 883e1f3 Compare January 13, 2023 00:17
@galtm
Copy link
Contributor Author

galtm commented Jan 13, 2023

@aj-stein-nist : I resolved the merge conflicts. If anything doesn't look right to you, let me know. Thanks.

@GaryGapinski
Copy link

I tested this recently and found some anomalies: https://gitter.im/usnistgov-OSCAL/nist-fedramp-collaboration?at=63cba0f88e760b51fdfea008

@galtm
Copy link
Contributor Author

galtm commented Jan 24, 2023

I tested this recently and found some anomalies

@GaryGapinski , thanks a lot for testing this. The link doesn't work for me, though. Would you be able to post your findings here?

@GaryGapinski
Copy link

GaryGapinski commented Jan 24, 2023

I have a truly marvelous demonstration of this proposition that this margin is too narrow to contain. — Fermat

Apologies: that was a Gitter link.

Since then, I realized I had not checked out the profiler-recursive branch before testing. The following uses that branch.

I've been using SaxonHE 12.0

I cloned [email protected]:galtm/OSCAL.git and checked out the profiler-recursive branch.

I created an alias for SaxonHE: xslt='java -cp ~/saxon/saxon-he-12.0.jar net.sf.saxon.Transform'.

I performed the transform xslt -xsl:oscal-profile-RESOLVE.xsl -s:https://raw.githubusercontent.com/GaryGapinski/ars-machine-readable/main/ODP-extract/ars-5.0-high-profile.xml -o:resolved-catalog.xml and received a resolved profile that appears topically correct except for an errant <link rel="resolution-source" href=""/> in metadata.

Previously, on the wrong (main) branch, I had performed a transform of a local copy of the profile (and the related catalog) and received a resolved catalog lacking all but the metadata.

Since then I updated the workstation I am using from macOS 12.6.2 to 12.6.3.

So, with the profiler-recursive branch and local copies of ars-5.0-high-profile.xml and ars-5.0-catalog.xml, the transform produces a different error:

gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % xslt -xsl:oscal-profile-RESOLVE.xsl -s:ars-5.0-high-profile.xml -o:resolved-catalog.xml 
Type error at char 50 in expression in xsl:variable/@select on line 49 column 89 of oscal-profile-resolve-metadata.xsl:
  XTTE0570  An empty sequence is not allowed as the value of variable $source-profile
at variable source-profile on line 49 column 89 of oscal-profile-resolve-metadata.xsl:
     invoked by global variable source-profile at file:/Users/gapinski/Projects/github/galtm/OSCAL/src/utils/util/resolver-pipeline/oscal-profile-resolve-metadata.xsl#49
  In template rule with match="profile/metadata" on line 69 of oscal-profile-resolve-metadata.xsl
     invoked by xsl:apply-templates at file:/Users/gapinski/Projects/github/galtm/OSCAL/src/utils/util/resolver-pipeline/oscal-profile-resolve-metadata.xsl#65
  In template rule with match="element(Q{http://csrc.nist.gov/ns/oscal/1.0}profile)" on line 57 of oscal-profile-resolve-metadata.xsl
     invoked by xsl:apply-templates at file:/Users/gapinski/Projects/github/galtm/OSCAL/src/utils/util/resolver-pipeline/oscal-profile-resolve-metadata.xsl#53
  In template rule with match="/" on line 51 of oscal-profile-resolve-metadata.xsl
An empty sequence is not allowed as the value of variable $source-profile
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % 

This is at odds with the examples in https://github.com/galtm/OSCAL/blob/profiler-recursive/src/utils/util/resolver-pipeline/readme.md.

If I try qualifying the source document using a URI scheme (and thus a relative URI but one with a scheme), I get

gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % xslt -xsl:oscal-profile-RESOLVE.xsl -s:file:ars-5.0-high-profile.xml -o:resolved-catalog.xml
Error at char 36 in expression in xsl:variable/@select on line 203 column 91 of oscal-profile-resolve-select.xsl:
  FORG0002  Base URI {file:ars-5.0-high-profile.xml} is a non-hierarchic URI
at function o:resource-or-error on line 200 column 58 of oscal-profile-resolve-select.xsl:
Base URI {file:ars-5.0-high-profile.xml} is a non-hierarchic URI
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % 

A couple of days ago (on the wrong branch and with a different OS version) I managed to produce a resolved catalog with just metadata and nothing else.

So current state implies it works with non-relative source document URIs.

I have not yet tried a profile importing a profile.

@galtm
Copy link
Contributor Author

galtm commented Jan 24, 2023

Thanks, @GaryGapinski . The Saxon error message definitely looks like an XSLT bug. I'll try to reproduce your steps in the next several days and get back to you. (This isn't my day job, so thanks in advance for your patience.)

PS - I love the Fermat quotation.

@wendellpiez
Copy link
Contributor

I can also help look. It is probably something simple and small maybe in the interface. Thanks @GaryGapinski this is exactly what we need.

δῶς μοι πᾶ στῶ καὶ τὰν γᾶν κινάσω (Archimedes)

@galtm
Copy link
Contributor Author

galtm commented Jan 28, 2023

@GaryGapinski , please try the following situation:

with the profiler-recursive branch and local copies of ars-5.0-high-profile.xml and ars-5.0-catalog.xml

but with one difference: try Saxon-HE version 10.8 (https://github.com/Saxonica/Saxon-HE/tree/main/10/Java) instead of version 11 or 12.

I am able to reproduce the error message with Saxon-HE 11.4, and I believe it is due to a Saxon incompatibility that was introduced in version 11. (There is some discussion of it at https://saxonica.plan.io/issues/5339 .) By contrast, when I use Saxon HE 10.8, I get a schema-valid catalog file that includes metadata, groups of controls, and back matter. There are no empty href attributes, either.

I logged issue #1629 and will plan to make the XSLT profile resolver compatible with Saxon 11 and up. Thanks for reporting this issue with the detail I needed to reproduce it.

@GaryGapinski
Copy link

GaryGapinski commented Jan 29, 2023

Works correctly with Saxon-HE 10.8. Thanks for finding the odd behavior change.

…@flexion-mac-C02FCBVSMD6N resolver-pipeline % pwd                                                                                                                                                
/Users/gapinski/Projects/github/galtm/OSCAL/src/utils/util/resolver-pipeline
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % curl -s -o ars-5.0-catalog.xml https://raw.githubusercontent.com/CMSgov/ars-machine-readable/main/ODP-extract/ars-5.0-catalog.xml                  
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % curl -s -o ars-5.0-moderate-profile.xml https://raw.githubusercontent.com/CMSgov/ars-machine-readable/main/ODP-extract/ars-5.0-moderate-profile.xml
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % alias xslt10.8='java -cp ~/saxon/10.8/saxon-he-10.8.jar net.sf.saxon.Transform' 
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % xslt10.8 -xsl:oscal-profile-RESOLVE.xsl -s:ars-5.0-moderate-profile.xml -o:resolved-catalog.xml
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % echo $?
0
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % head -n 13 resolved-catalog.xml 
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="http://csrc.nist.gov/ns/oscal/1.0"
         uuid="00000000-0000-4000-B000-000000000000">
   <metadata>
      <title>CMS ARS 5.0 Moderate Profile</title>
      <last-modified>2023-01-29T07:58:15.819648-05:00</last-modified>
      <version>2022-09-01T08:55:23.32281Z</version>
      <oscal-version>1.0.4</oscal-version>
      <prop name="resolution-tool"
            value="OSCAL Profile Resolver XSLT Pipeline OPRXP"/>
      <link href="file:/Users/gapinski/Projects/github/galtm/OSCAL/src/utils/util/resolver-pipeline/ars-5.0-moderate-profile.xml"
            rel="source-profile"/>
   </metadata>
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % head -n 13 resolved-catalog.xml
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="http://csrc.nist.gov/ns/oscal/1.0"
         uuid="00000000-0000-4000-B000-000000000000">
   <metadata>
      <title>CMS ARS 5.0 Moderate Profile</title>
      <last-modified>2023-01-29T07:58:15.819648-05:00</last-modified>
      <version>2022-09-01T08:55:23.32281Z</version>
      <oscal-version>1.0.4</oscal-version>
      <prop name="resolution-tool"
            value="OSCAL Profile Resolver XSLT Pipeline OPRXP"/>
      <link href="file:/Users/gapinski/Projects/github/galtm/OSCAL/src/utils/util/resolver-pipeline/ars-5.0-moderate-profile.xml"
            rel="source-profile"/>
   </metadata>
   <group class="family" id="ac">
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline %

Works with non-local source document:

gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % xslt10.8 -xsl:oscal-profile-RESOLVE.xsl -s:https://raw.githubusercontent.com/CMSgov/ars-machine-readable/main/ODP-extract/ars-5.0-moderate-profile.xml -o:resolved-catalog.xml
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline % head -n 13 resolved-catalog.xml                                                                                                                                               
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="http://csrc.nist.gov/ns/oscal/1.0"
         uuid="00000000-0000-4000-B000-000000000000">
   <metadata>
      <title>CMS ARS 5.0 Moderate Profile</title>
      <last-modified>2023-01-29T08:29:17.190658-05:00</last-modified>
      <version>2022-09-01T08:55:23.32281Z</version>
      <oscal-version>1.0.4</oscal-version>
      <prop name="resolution-tool"
            value="OSCAL Profile Resolver XSLT Pipeline OPRXP"/>
      <link href="https://raw.githubusercontent.com/CMSgov/ars-machine-readable/main/ODP-extract/ars-5.0-moderate-profile.xml"
            rel="source-profile"/>
   </metadata>
gapinski@flexion-mac-C02FCBVSMD6N resolver-pipeline %

Edit: Outputs were validated (and found to be valid) using https://raw.githubusercontent.com/usnistgov/OSCAL/main/xml/schema/oscal_complete_schema.xsd.

Copy link
Contributor

@aj-stein-nist aj-stein-nist left a comment

Choose a reason for hiding this comment

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

I would personally like to have these tests automated in our build pipeline such that we catch the issue in #1629 before it may have been approved and merged otherwise. Whether this will be difficult in the scope of this PR or not, I would like to discuss with you @galtm and @wendellpiez. Can you set aside time to discuss when is prudent?

@wendellpiez
Copy link
Contributor

Indeed, although hardening it against arbitrary-older-versions of Saxon can be as onerous as we want it to be. It has been moving and indeed a Saxon12 is just out. So we have to draw the line.

Best solution is probably to document the version being tested. If this is SaxonHE so much the better, as it also tests against slipping into a dependency on licensed-only features. If a developer can ensure that the pipeline works with both project-official-Saxon and latest Saxon, so much the better.

@galtm any thoughts here? If we settle on a "current for now" Saxon version what would you recommend?

Also glad we had our community find this, as it's a difficult problem to defend against. Lesson there might be that we did the right thing by asking @GaryGapinski to try. 🚀

@aj-stein-nist
Copy link
Contributor

Indeed, although hardening it against arbitrary-older-versions of Saxon can be as onerous as we want it to be. It has been moving and indeed a Saxon12 is just out. So we have to draw the line.

Agreed. We should cover the different versions we do support though. Our CI/CD only uses one version, as does our development container. Can we sync up to discuss what versions we ought to support, given issues like this, and plot out how to keep CI/CD as-is or expand the matrix of supported versions accordingly?

Best solution is probably to document the version being tested. If this is SaxonHE so much the better, as it also tests against slipping into a dependency on licensed-only features. If a developer can ensure that the pipeline works with both project-official-Saxon and latest Saxon, so much the better.

Completely agree, lines up with what we can discuss at the next available opportunity.

@galtm any thoughts here? If we settle on a "current for now" Saxon version what would you recommend?

I too would like to hear from them on this.

Also glad we had our community find this, as it's a difficult problem to defend against. Lesson there might be that we did the right thing by asking @GaryGapinski to try. 🚀

I too am glad but think this a problem we can do a small amount of work to defend against many of the common upgrade scenarios like this in the future as we change OSCAL and run across n versions we do need or support. I would definitely want to talk about this in the context of this specific PR unless there are reasons not to.

@wendellpiez
Copy link
Contributor

All sounds good. Stabilizing this saves everyone work in the medium term not only the long term.

@galtm
Copy link
Contributor Author

galtm commented Feb 1, 2023

I would personally like to have these tests automated in our build pipeline such that we catch the issue in #1629 before it may have been approved and merged otherwise. Whether this will be difficult in the scope of this PR or not, I would like to discuss with you @galtm and @wendellpiez. Can you set aside time to discuss when is prudent?

@aj-stein-nist it would be great to have these tests automated in the build pipeline. I think it is probably not in scope for this PR. Do you want to talk more about that with @wendellpiez and me this Friday morning, or another Friday?

@galtm any thoughts here? If we settle on a "current for now" Saxon version what would you recommend?

My recommendation would be Saxon 11.4, assuming #1629 is straightforward to fix. The Saxonica web site currently says, "The latest maintenance release of 11 is Saxon 11.4, released on 28 July 2022. Saxon 11 is currently considered the most stable and reliable release." [UPDATE 5/4/2023: It now says Saxon 11.5 is the most stable and reliable release.] Although Saxon 12 has been released, I think making OSCAL use the most stable and reliable release of Saxon makes sense. What do you think?

@galtm
Copy link
Contributor Author

galtm commented Feb 4, 2023

2/4/23: Pushed 2 commits to this PR that are really for #1549 but I wanted them here, too, because this PR is built on top of #1549.

@galtm
Copy link
Contributor Author

galtm commented Feb 7, 2023

I would personally like to have these tests automated in our build pipeline

@aj-stein-nist : Some quick pointers about how the github.com/xspec/xspec repo automates running its own XSpec tests in GitHub:

@galtm
Copy link
Contributor Author

galtm commented Mar 10, 2023

3/9/23: Manually resolved merge conflicts now that #1685 has been merged into develop branch.

@aj-stein-nist aj-stein-nist requested a review from iMichaela as a code owner June 29, 2023 21:24
@aj-stein-nist aj-stein-nist changed the title Profiler resolver support for importing another profile [DONOTMERGE] Profiler resolver support for importing another profile Sep 28, 2023
@aj-stein-nist aj-stein-nist linked an issue Sep 28, 2023 that may be closed by this pull request
@aj-stein-nist aj-stein-nist added this to the Next milestone Sep 28, 2023
@aj-stein-nist aj-stein-nist changed the base branch from develop to feature-recursive-profile-resolver September 28, 2023 04:46
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.
@aj-stein-nist aj-stein-nist changed the title [DONOTMERGE] Profiler resolver support for importing another profile Profiler resolver support for importing another profile Sep 28, 2023
Copy link
Contributor

@aj-stein-nist aj-stein-nist left a comment

Choose a reason for hiding this comment

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

Thanks again for your work, @galtm. I backed up the branch before rebase in my fork just in case, but this looks ready to be merged into a feature branch. This work is not fixing a bug and should be prioritized for inclusion in a later minor release since it adds new functionality, after other bug fixes, including other wonderful additions by you to the profile resolver and testing. This merged recursive profile resolver work will be merged at a later date.

Excellent contribution and keep up the good work.

@aj-stein-nist aj-stein-nist merged commit 3299323 into usnistgov:feature-recursive-profile-resolver Sep 28, 2023
@galtm galtm deleted the profiler-recursive branch September 28, 2023 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Profile Resolution Issues relating to profile resolution.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update XSLT implementation profile resolver for recursive profile support Profile resolver not applying alterations to parameters

4 participants