<?xml version="1.0" encoding="UTF-8"?>
<sch:pattern id="ISM-ID-00221" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
    <sch:p id="ruleText">
        [ISM-ID-00221][Error] If ISM-CAPCO-RESOURCE and attribute 
        derivativelyClassifiedBy is specified, then attribute classificationReason
        must not be specified.
    </sch:p>
    <sch:p id="codeDesc">
    	For each element with the attribute derivativelyClassifiedBy specified,
    	we make sure that the attribute classificationReason is not specified.
    </sch:p>
    <sch:rule context="//*[@ism:derivativelyClassifiedBy]">
        <sch:assert 
        		id="ISM-00221" 
            test="
            if($ISM_CAPCO_RESOURCE)
            then not(@ism:classificationReason)
            else true()" 
            flag="error">
        	[ISM-ID-00221][Error] If ISM-CAPCO-RESOURCE and attribute 
        	derivativelyClassifiedBy is specified, then attribute classificationReason
        	must not be specified.
        </sch:assert>
    </sch:rule>
</sch:pattern>