Skip to content

Commit e36c374

Browse files
aj-stein-nistChris Compton
authored andcommitted
Remove with-parent-controls from implementation (usnistgov#1843)
* Remove with-parent-controls from XSLT profile resolver for usnistgov#1816. * Remove profile resolver with-parent-controls tests for usnistgov#1816.
1 parent 7c47f23 commit e36c374

File tree

2 files changed

+0
-213
lines changed

2 files changed

+0
-213
lines changed

src/utils/resolver-pipeline/select-or-custom-merge.xsl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,20 @@
5151
<xsl:sequence select="exists($importing/include-all)"/>
5252
<xsl:sequence select="some $c in ($importing/include-controls/with-id)
5353
satisfies ($c = $candidate/@id)"/>
54-
<xsl:sequence select="some $c in ($importing/include-controls[o:calls-parents(.)]/with-id)
55-
satisfies ($c = $candidate/descendant::control/@id)"/>
5654
<xsl:sequence select="some $c in ($importing/include-controls[o:calls-children(.)]/with-id)
5755
satisfies ($c = $candidate/ancestor::control/@id)"/>
5856
<xsl:sequence select="some $m in ($importing/include-controls/matching[@pattern != ''])
5957
satisfies (matches($candidate/@id,$m/@pattern/o:glob-as-regex(string(.)) ))"/>
60-
<xsl:sequence select="some $m in ($importing/include-controls[o:calls-parents(.)]/matching[@pattern != '']), $a in $candidate/descendant::control
61-
satisfies (matches($a/@id,$m/@pattern/o:glob-as-regex(string(.))))"/>
6258
<xsl:sequence select="some $m in ($importing/include-controls[o:calls-children(.)]/matching[@pattern != '']), $a in $candidate/ancestor::control
6359
satisfies (matches($a/@id,$m/@pattern/o:glob-as-regex(string(.))))"/>
6460
</xsl:variable>
6561
<xsl:variable name="exclude-reasons" as="xs:boolean+">
6662
<xsl:sequence select="exists($candidate/parent::control) and $importing/include-all/@with-child-controls='no'"/>
6763
<xsl:sequence select="some $c in ($importing/exclude-controls/with-id) satisfies ($c = $candidate/@id)"/>
68-
<xsl:sequence select="some $c in ($importing/exclude-controls[o:calls-parents(.)]/with-id)
69-
satisfies ($c = $candidate/descendant::control/@id)"/>
7064
<xsl:sequence select="some $c in ($importing/exclude-controls[o:calls-children(.)]/with-id)
7165
satisfies ($c = $candidate/ancestor::control/@id)"/>
7266
<xsl:sequence select="some $m in ($importing/exclude-controls/matching[@pattern != ''])
7367
satisfies (matches($candidate/@id,$m/@pattern/o:glob-as-regex(string(.))))"/>
74-
<xsl:sequence select="some $m in ($importing/exclude-controls[o:calls-parents(.)]/matching[@pattern != '']), $a in $candidate/descendant::control
75-
satisfies (matches($a/@id,$m/@pattern/o:glob-as-regex(string(.))))"/>
7668
<xsl:sequence select="some $m in ($importing/exclude-controls[o:calls-children(.)]/matching[@pattern != '']), $a in $candidate/ancestor::control
7769
satisfies (matches($a/@id,$m/@pattern/o:glob-as-regex(string(.))))"/>
7870
</xsl:variable>
@@ -84,11 +76,6 @@
8476
<xsl:param name="caller" as="element()"/>
8577
<xsl:sequence select="$caller/@with-child-controls='yes'"/>
8678
</xsl:function>
87-
88-
<xsl:function name="o:calls-parents" as="xs:boolean">
89-
<xsl:param name="caller" as="element()"/>
90-
<xsl:sequence select="not($caller/@with-parent-controls='no')"/>
91-
</xsl:function>
9279

9380
<xsl:function name="opr:catalog-identifier" as="xs:string">
9481
<xsl:param name="catalog" as="element(o:catalog)"/>

src/utils/resolver-pipeline/testing/1_selected/select.xspec

Lines changed: 0 additions & 200 deletions
Original file line numberDiff line numberDiff line change
@@ -292,40 +292,6 @@
292292
</profile>
293293
</x:expect>
294294
</x:scenario>
295-
296-
<x:scenario label="Default value of 'with-parent-controls' (yes)">
297-
<x:context>
298-
<profile>
299-
<import href="{$ov:filedir}/catalogs/xyz-tiny_catalog.xml">
300-
<include-controls with-parent-controls="yes">
301-
<with-id>z3.a-1</with-id>
302-
</include-controls>
303-
</import>
304-
</profile>
305-
</x:context>
306-
307-
<x:expect label="Control Z3-A-1 and all its ancestors">
308-
<profile>
309-
<selection uuid="..." opr:src="...">
310-
<metadata>...</metadata>
311-
<group opr:id="...">
312-
<title>Group X of XYZ</title>
313-
</group>
314-
<group opr:id="...">
315-
<title>Group Y of XYZ</title>
316-
</group>
317-
<group opr:id="...">
318-
<title>Group Z of XYZ</title>
319-
<control id="z3" opr:id="..."><title>Control Z3</title>
320-
<control id="z3.a" opr:id="..."><title>Control Z3-A</title>
321-
<control id="z3.a-1" opr:id="..."><title>Control Z3-A-1</title></control>
322-
</control>
323-
</control>
324-
</group>
325-
</selection>
326-
</profile>
327-
</x:expect>
328-
</x:scenario>
329295

330296
<x:scenario label="Nondefault value of 'with-parent-controls' (no)">
331297
<x:context>
@@ -800,32 +766,6 @@
800766
</x:call>
801767
<x:expect label="false" select="false()"/>
802768
</x:scenario>
803-
<x:scenario label="Select descendant ID, omitting with-parent-controls.">
804-
<x:call function="o:selects">
805-
<x:param name="importing">
806-
<import>
807-
<include-controls>
808-
<with-id>level-four</with-id>
809-
</include-controls>
810-
</import>
811-
</x:param>
812-
<x:param name="candidate" select="$ov:control-hierarchy//o:control[@id='level-two']"/>
813-
</x:call>
814-
<x:expect label="true (with-parent-controls defaults to yes)" select="true()"/>
815-
</x:scenario>
816-
<x:scenario label="Select descendant ID, and explicitly include parent controls.">
817-
<x:call function="o:selects">
818-
<x:param name="importing">
819-
<import>
820-
<include-controls with-parent-controls="yes">
821-
<with-id>level-four</with-id>
822-
</include-controls>
823-
</import>
824-
</x:param>
825-
<x:param name="candidate" select="$ov:control-hierarchy//o:control[@id='level-two']"/>
826-
</x:call>
827-
<x:expect label="true" select="true()"/>
828-
</x:scenario>
829769
<x:scenario label="Select descendant ID and do not include parent controls.">
830770
<x:call function="o:selects">
831771
<x:param name="importing">
@@ -938,32 +878,6 @@
938878
</x:call>
939879
<x:expect label="false" select="false()"/>
940880
</x:scenario>
941-
<x:scenario label="Match descendant ID, omitting with-parent-controls.">
942-
<x:call function="o:selects">
943-
<x:param name="importing">
944-
<import>
945-
<include-controls>
946-
<matching pattern="*-four"/>
947-
</include-controls>
948-
</import>
949-
</x:param>
950-
<x:param name="candidate" select="$ov:control-hierarchy//o:control[@id='level-two']"/>
951-
</x:call>
952-
<x:expect label="true (with-parent-controls defaults to yes)" select="true()"/>
953-
</x:scenario>
954-
<x:scenario label="Match descendant ID, with parent controls.">
955-
<x:call function="o:selects">
956-
<x:param name="importing">
957-
<import>
958-
<include-controls with-parent-controls="yes">
959-
<matching pattern="*-four"/>
960-
</include-controls>
961-
</import>
962-
</x:param>
963-
<x:param name="candidate" select="$ov:control-hierarchy//o:control[@id='level-two']"/>
964-
</x:call>
965-
<x:expect label="true" select="true()"/>
966-
</x:scenario>
967881
<x:scenario label="Match descendant ID, without parent controls.">
968882
<x:call function="o:selects">
969883
<x:param name="importing">
@@ -1016,23 +930,6 @@
1016930
</x:call>
1017931
<x:expect label="false" select="false()"/>
1018932
</x:scenario>
1019-
<x:scenario label="Include grandchild with parent controls, and include child without parent controls">
1020-
<x:call function="o:selects">
1021-
<x:param name="importing">
1022-
<import>
1023-
<include-controls with-parent-controls="yes">
1024-
<with-id>level-four</with-id>
1025-
</include-controls>
1026-
<include-controls with-parent-controls="no">
1027-
<with-id>level-three</with-id>
1028-
</include-controls>
1029-
</import>
1030-
</x:param>
1031-
<x:param name="candidate"
1032-
select="$ov:control-hierarchy//o:control[@id='level-two']"/>
1033-
</x:call>
1034-
<x:expect label="true" select="true()"/>
1035-
</x:scenario>
1036933
<x:scenario label="Include grandparent with child controls, and include parent without child controls">
1037934
<x:call function="o:selects">
1038935
<x:param name="importing">
@@ -1095,48 +992,6 @@
1095992
</x:call>
1096993
<x:expect label="true" select="true()"/>
1097994
</x:scenario>
1098-
<x:scenario label="Exclude descendant ID, omitting with-parent-controls.">
1099-
<x:call function="o:selects">
1100-
<x:param name="importing">
1101-
<import>
1102-
<include-all/>
1103-
<exclude-controls>
1104-
<with-id>level-four</with-id>
1105-
</exclude-controls>
1106-
</import>
1107-
</x:param>
1108-
<x:param name="candidate" select="$ov:control-hierarchy//o:control[@id='level-two']"/>
1109-
</x:call>
1110-
<x:expect label="false (with-parent-controls defaults to yes)" select="false()"/>
1111-
</x:scenario>
1112-
<x:scenario label="Exclude descendant ID with parent controls.">
1113-
<x:call function="o:selects">
1114-
<x:param name="importing">
1115-
<import>
1116-
<include-all/>
1117-
<exclude-controls with-parent-controls="yes">
1118-
<with-id>level-four</with-id>
1119-
</exclude-controls>
1120-
</import>
1121-
</x:param>
1122-
<x:param name="candidate" select="$ov:control-hierarchy//o:control[@id='level-two']"/>
1123-
</x:call>
1124-
<x:expect label="false" select="false()"/>
1125-
</x:scenario>
1126-
<x:scenario label="Exclude descendant ID without parent controls.">
1127-
<x:call function="o:selects">
1128-
<x:param name="importing">
1129-
<import>
1130-
<include-all/>
1131-
<exclude-controls with-parent-controls="no">
1132-
<with-id>level-four</with-id>
1133-
</exclude-controls>
1134-
</import>
1135-
</x:param>
1136-
<x:param name="candidate" select="$ov:control-hierarchy//o:control[@id='level-two']"/>
1137-
</x:call>
1138-
<x:expect label="true" select="true()"/>
1139-
</x:scenario>
1140995
<x:scenario label="Exclude ancestor ID, omitting with-child-controls.">
1141996
<x:call function="o:selects">
1142997
<x:param name="importing">
@@ -1277,34 +1132,6 @@
12771132
</x:call>
12781133
<x:expect label="true" select="true()"/>
12791134
</x:scenario>
1280-
<x:scenario label="Match descendant ID, omitting with-parent-controls.">
1281-
<x:call function="o:selects">
1282-
<x:param name="importing">
1283-
<import>
1284-
<include-all/>
1285-
<exclude-controls>
1286-
<matching pattern="*-four"/>
1287-
</exclude-controls>
1288-
</import>
1289-
</x:param>
1290-
<x:param name="candidate" select="$ov:control-hierarchy//o:control[@id='level-two']"/>
1291-
</x:call>
1292-
<x:expect label="false (with-parent-controls defaults to yes)" select="false()"/>
1293-
</x:scenario>
1294-
<x:scenario label="Match descendant ID, with parent controls.">
1295-
<x:call function="o:selects">
1296-
<x:param name="importing">
1297-
<import>
1298-
<include-all/>
1299-
<exclude-controls with-parent-controls="yes">
1300-
<matching pattern="*-four"/>
1301-
</exclude-controls>
1302-
</import>
1303-
</x:param>
1304-
<x:param name="candidate" select="$ov:control-hierarchy//o:control[@id='level-two']"/>
1305-
</x:call>
1306-
<x:expect label="false" select="false()"/>
1307-
</x:scenario>
13081135
<x:scenario label="Match descendant ID, without parent controls.">
13091136
<x:call function="o:selects">
13101137
<x:param name="importing">
@@ -1468,33 +1295,6 @@
14681295
</x:scenario>
14691296
</x:scenario>
14701297

1471-
<x:scenario label="Tests for o:calls-parents function">
1472-
<x:scenario label="with-parent-controls attribute is 'yes'">
1473-
<x:call function="o:calls-parents">
1474-
<x:param>
1475-
<elem with-parent-controls="yes"/>
1476-
</x:param>
1477-
</x:call>
1478-
<x:expect label="true" select="true()"/>
1479-
</x:scenario>
1480-
<x:scenario label="with-parent-controls attribute is 'no'">
1481-
<x:call function="o:calls-parents">
1482-
<x:param>
1483-
<elem with-parent-controls="no"/>
1484-
</x:param>
1485-
</x:call>
1486-
<x:expect label="false" select="false()"/>
1487-
</x:scenario>
1488-
<x:scenario label="with-parent-controls attribute is omitted">
1489-
<x:call function="o:calls-parents">
1490-
<x:param>
1491-
<elem/>
1492-
</x:param>
1493-
</x:call>
1494-
<x:expect label="true" select="true()"/>
1495-
</x:scenario>
1496-
</x:scenario>
1497-
14981298
<x:scenario label="Tests for o:resource-or-error function">
14991299
<x:scenario label="Document is available">
15001300
<x:call function="o:resource-or-error">

0 commit comments

Comments
 (0)