<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright TEI Consortium. 
Dual-licensed under CC-by and BSD2 licences 
See the file COPYING.txt for details
$Date$
$Id$
-->
<?xml-model href="http://tei.oucs.ox.ac.uk/jenkins/job/TEIP5/lastSuccessfulBuild/artifact/P5/release/xml/tei/odd/p5.nvdl" type="application/xml" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?>

<classSpec xmlns="http://www.tei-c.org/ns/1.0" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:sch="http://purl.oclc.org/dsdl/schematron" module="tagdocs" type="atts" ident="att.deprecated" predeclare="true">
  <desc versionDate="2013-05-16" xml:lang="en">provides attributes indicating how a deprecated feature will be treated in future releases.</desc>
  <attList>
    <attDef ident="validUntil" usage="opt">
      <desc versionDate="2013-05-16" xml:lang="en">provides a date before which the construct being defined
      will not be removed.</desc>
      <datatype minOccurs="1" maxOccurs="1">
        <rng:data type="date"/>
        <!-- Note: the value is restricted to just a date (no
	     dateTimes, no times, no gYearMonth, etc.; timezones are
	     permitted, but I'm not sure I understand the point) in
	     order to make the Schematron tests easy. -Syd 2013-05-16
	     -->
      </datatype>
      <constraintSpec scheme="isoschematron" ident="deprecated">
        <constraint>
          <sch:rule context="tei:*[@validUntil]">
            <sch:assert test="@validUntil cast as xs:date ge
			      current-date()"><sch:value-of select="if
			      (@ident) then concat('The ',@ident) else
			      concat('This ',local-name(.),' of
			      ',ancestor::tei:*[@ident][1]/@ident)"/>
	    construct is outdated (as of <sch:value-of
	    select="@validUntil"/>); ODD processors may ignore it, and its use is no longer supported</sch:assert>
            <sch:assert role="nonfatal" test="@validUntil cast as xs:date ge
			      (current-date() + (60*xs:dayTimeDuration('P1D')))"><sch:value-of
			      select="if (@ident) then concat('The ',@ident) else concat('This ',local-name(.),' of ',ancestor::tei:*[@ident][1]/@ident)"/>  construct becomes outdated on <sch:value-of  select="@validUntil"/></sch:assert>
          </sch:rule>
        </constraint>
      </constraintSpec>
      <remarks versionDate="2013-05-16" xml:lang="en">
        <p>The value of this attribute should represent a date (in standard <code>yyyy-mm-dd</code> format) which is later than the date on which the attribute is added to an ODD. Technically, this attribute asserts only the intent to
	leave a construct in future releases of the markup language
	being defined up to at least the specified date, and makes no
	assertion about what happens past that date. In practice, the
	expectation is that the construct will be removed from future
	releases of the markup language being defined sometime shortly
	after the <att>validUntil</att> date.</p>
        <p>An ODD processor will typically not process a specification
	element which has a <att>validUntil</att> date that is in the
	past. An ODD processor will typically warn users about
	constructs which have a <att>validUntil</att> date that is in
	the future. E.g., the documentation for such a construct might
	include the phrase <mentioned>warning: deprecated</mentioned>
	in red.</p>
      </remarks>
    </attDef>
  </attList>
</classSpec>
