> <x:expect-assert id="incomplete-implementation-requirements" label="it is invalid."/>
This x:expect-assert returns Failure, because the corresponding sch:assert/@test in ssp.sch is always true:
> <sch:assert id="incomplete-implementation-requirements" test="true()">
Note that x:expect-assert searches SVRL for svrl:failed-assert. Setting test=true() in sch:assert will not raise it.
Regarding the global context item,
In your case, I think the global context item and x:context must be identical. But the source of the global context item ($global-context-item) is global across all x:context. So, I'm afraid that you have to split the scenarios and put each scenario into its own .xspec file. For example:
[scenario1.xspec]
<x:param name="allow-foreign">true</x:param>
<x:param name="global-context-item" select="/">
<system-characteristics>
<!-- no level set in empty element-->
<security-sensitivity-level />
</system-characteristics>
</system-security-plan>
</x:param>
<x:scenario label="For an OSCAL FedRAMP SSP">
<x:scenario label="when the security sensitivity level">
<x:scenario label="is not defined at all">
<x:context select="$global-context-item" />
<x:expect-assert id="no-security-sensitivity-level" label="it is invalid."/>
</x:scenario>
</x:scenario>
</x:scenario>
</x:description>
[scenario2.xspec]
<x:param name="allow-foreign">true</x:param>
<x:param name="global-context-item" select="/">
<system-characteristics>
<security-sensitivity-level>low</security-sensitivity-level>
</system-characteristics>
</system-security-plan>
</x:param>
<x:scenario label="For an OSCAL FedRAMP SSP">
<x:scenario label="when the security sensitivity level">
<x:scenario label="is set to a value from the official FedRAMP list">
<x:context select="$global-context-item" />
<x:expect-not-assert id="invalid-security-sensitivity-level" label="it is valid."/>
</x:scenario>
</x:scenario>
</x:scenario>
</x:description>
[scenario3.xspec]
...
[scenario4.xspec]
...
@run-as=external introduced in XSpec v2.0 enables you to finetune the global context item in some cases. Unfortunately it is not available on Schematron. I opened an issue for it:
https://github.com/xspec/xspec/issues/1287
--
AirQuick