<?xml version="1.0" encoding="UTF-8"?>
<sch:pattern id="ISM-ID-00196" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
    <sch:p id="ruleText">[ISM-ID-00196][Warning] Attribute ownerProducer contains a value that will be deprecated.</sch:p>
    <sch:p id="codeDesc">Traverse the CVE file pulling out deprecated values and their dates. Using the current date, determine if the values are
        being used but it is still prior to the deprecated date</sch:p>

    <sch:rule context="//*[@ism:ownerProducer]">
        <sch:let name="curDate" value="translate($ISM_RESOURCE_ELEMENT/@ism:createDate,'-','')"/>
        <sch:let name="depValues" value="document('./CVE/CVEnumISMOwnerProducer.xml')//cve:CVE/cve:Enumeration/cve:Term[./@deprecated]/cve:Value"/>
        <sch:let name="depDates" value="document('./CVE/CVEnumISMOwnerProducer.xml')//cve:CVE/cve:Enumeration/cve:Term/@deprecated"/>
        <sch:let name="isError" value="false()"/>
        
        <sch:let name="reportWarn" value="
            dvf:deprecated(./@ism:ownerProducer, $depValues, $depDates, $curDate, $isError)
            "/>
        
        <sch:assert id="ISM-00196"
            test="count($reportWarn)=0"
            flag="warning">
            [ISM-ID-00196][Warning] For attribute ownerProducer, value(s) <sch:value-of select="$reportWarn"/>
        </sch:assert>
    </sch:rule>
</sch:pattern>