From 67503b26fef80b1dd3a064e7183f1eef25038faf Mon Sep 17 00:00:00 2001 From: galtm <40716346+galtm@users.noreply.github.com> Date: Mon, 25 Jul 2022 19:07:53 -0400 Subject: [PATCH] Test finish phase, plus minor XSLT enhancements and fixes (#1377) XSLT - Remove template that provides link to source, because metadata phase accomplished that - Add "[last()]" predicate when passing through elements that cannot appear twice - Align with schema by passing through revisions, document-id, location, and group/link but not control/annotation - Align with schema for param insertions, `` - Align with schema and spec for keeping items, `` XSpec - Add tests at the level of individual templates --- .../oscal-profile-resolve-finish.xsl | 75 +- .../testing/5_finished/finish.xspec | 701 ++++++++++++++---- 2 files changed, 591 insertions(+), 185 deletions(-) diff --git a/src/utils/util/resolver-pipeline/oscal-profile-resolve-finish.xsl b/src/utils/util/resolver-pipeline/oscal-profile-resolve-finish.xsl index 0d41da751a..b2720a86ee 100644 --- a/src/utils/util/resolver-pipeline/oscal-profile-resolve-finish.xsl +++ b/src/utils/util/resolver-pipeline/oscal-profile-resolve-finish.xsl @@ -16,17 +16,22 @@ - - - - - - - - - - + - + - - - - - - + + + + + + + + - + - + + @@ -92,20 +92,23 @@ - + + - - + - + + @@ -116,6 +119,8 @@ - + + diff --git a/src/utils/util/resolver-pipeline/testing/5_finished/finish.xspec b/src/utils/util/resolver-pipeline/testing/5_finished/finish.xspec index 7ecb1e686a..9fdca33ca1 100644 --- a/src/utils/util/resolver-pipeline/testing/5_finished/finish.xspec +++ b/src/utils/util/resolver-pipeline/testing/5_finished/finish.xspec @@ -1,171 +1,572 @@ - - - - - - - + + + + text + + + + + + + + + - - - - - Catalog - - - - - - Control A - - - - - - - Catalog - - - Control A - - - - - - - - - Catalog - - - - - - Control A - -

goes here.

-
-
-
- - - - Catalog - - - - - - Control A - -

goes here.

-
-
-
-
+ + + + + + + + + + + + + + + + + + Group 1 + + + Control A + +

goes here.

+
+
+ + + + + + Catalog + +
+
+ + + ... + + ... + ... + ... + ... + + +
+ + + + + Catalog X + 1.2 + + + Catalog Y + 1.3 + + + + + + + + + + + + + Catalog Y + 1.3 + + + + + + + + + + + + + Catalog + + + + + + Control A + + + + + + + Catalog + + + Control A + + + + + + + + + Catalog + + + + + + Control A + +

goes here.

+
+
+
+
+ + + + Catalog + + + + + + Control A + +

goes here.

+
+
+
+
+
+
- - - + + + + - Catalog + + + + + + + + + + + + + + </metadata> - <control id="control_A"> - <title>Control A - A link - property - - - - - + + - Catalog - - - Control A - property - A link - - - - - - - + + <published/> + <last-modified/> + <version/> + <oscal-version/> + <revisions/> + <document-id/> + <prop/> + <link/> + <role/> + <location/> + <party/> + <responsible-party/> + <remarks/> + </metadata> + </x:expect> + </x:scenario> + <x:scenario label="Metadata with multiple elements of same type"> + <x:context> <metadata> - <title>Catalog + Title 1 + Title 2 + 2019-11-13T12:41:07.061-05:00 + 2019-11-13T12:41:07.061-05:00 + 2021-11-13T12:41:07.061-05:00 + 2021-11-13T12:41:07.061-05:00 + 1.0 + 1.0.1 + 1.1 + 1.0.2 + + + 1.0 + + + + + 1.1 + + +

Remark 1

+

Remark 2

- - citation - -
-
- - + + - Catalog + Title 2 + 2021-11-13T12:41:07.061-05:00 + 2021-11-13T12:41:07.061-05:00 + 1.1 + 1.0.2 + + + 1.1 + + +

Remark 2

-
-
+ +
- - - - - Catalog - - - Control A - link to good citation - - - unclaimed citation - good citation - - - - - - - Catalog - - - Control A - link to good citation - - - good citation - - - + + + + + + + + Catalog + + + Group A + A link + property + + + + + + Group A + property + A link + + + + + + + + Group A + Link Me + +

Statement

+ +
+
+
+ + + Group A + + + Link Me +

Statement

+
+
+
+ + + + + + +

goes here.

+
+ Link Me + + + Group A +
+
+ + + Group A + ... + + ... + ... + + + + +
+
+ + + + Original title + Revised title + + + + + Revised title + + +
- - - + + + + + + + + Catalog + + + Control A + A link + property + + + + + + Control A + property + A link + + + + + + + + Control A + Link Me + +

Statement

+ +
+
+
+ + + Control A + + + Link Me +

Statement

+
+
+
+ + + + +

Statement

+ Link Me + + + Control A +
+
+ + + Control A + + + Link Me +

Statement

+ + +
+
+
+ + - Control A - Link Me - -

Statement

- + Original title + First revision added during modify phase + Second revision added during modify phase
-
-
- - + + - Control A - - - Link Me -

Statement

+ Second revision added during modify phase
-
-
+ +
+
+ + + + + + + + Group 1 + + + + + Control A + + + + + + + + + + + Group 1 + + + + + + + + Control A + +

goes here.

+
+
+
+
+
+ +
+ + + + + Group 1 + + + + + + Control A + + + + + + + + + + + +
+ + + + + + + Catalog + + + citation + + + + + + + + + + + + Catalog + + + Control A + link to good citation + + + unclaimed citation + good citation + + + + + + good citation + + + + + + + + Control A + + + + + + unclaimed citation + + + + + + + + + + + + + + + + + + + + + Catalog + + + Control A + link to good citation + + + + good citation + + + + +