<?xml version="1.0" encoding="UTF-8"?>
<sch:pattern id="ISM-ID-00043" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
    <sch:p id="ruleText">
        [ISM-ID-00043][Error] If ISM-CAPCO-RESOURCE and attribute SCIcontrols contains the name token [SI], then attribute 
        classification must have a value of [TS], [S], or [C].
    </sch:p>
    <sch:p id="codeDesc">
        If CAPCO rules do not apply to the document then the rule does not apply
        and we return true. If the current element has attribute SCIcontrols specified
        with a value containing [SI], then we make sure that attribute classification
        has a value of [TS], [S], or [C].
    </sch:p>
    <sch:rule context="//*[@ism:SCIcontrols]">
        <sch:assert 
            id="ISM-00043" 
            test="if(not($ISM_CAPCO_RESOURCE)) then true() else  
            if ( index-of(tokenize(./@ism:SCIcontrols, ' '),'SI')>0 
                and not( matches(./@ism:classification,'^(TS|S|C)$'))
            ) then false() else true()
            " 
            flag="error">
            [ISM-ID-00043][Error] If ISM-CAPCO-RESOURCE and attribute SCIcontrols contains the name token [SI], then attribute 
            classification must have a value of [TS], [S], or [C].
        </sch:assert>
    </sch:rule>
</sch:pattern>