<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [
<!ENTITY rfc3023 PUBLIC '' 
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3023.xml'>
<!ENTITY rfc3986 PUBLIC '' 
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml'>
<!ENTITY rfc3987 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3987.xml'>
<!ENTITY recxml PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml4/reference.W3C.REC-xml-20081126.xml'>
<!ENTITY recxmlnames PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml4/reference.W3C.REC-xml-names-20091208.xml'>
<!ENTITY rfc3470 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3470.xml'>
<!ENTITY xinclude PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml4/reference.W3C.REC-xinclude-20061115.xml'>
]>

<rfc xml:lang="en" category="info"   ipr='trust200902'>
  <?rfc toc="yes"        ?>
  <?rfc symrefs="yes"    ?>
  <?rfc sortrefs="yes"   ?>
  <?rfc iprnotified="no" ?>
  <?rfc strict="yes"     ?>
  <front>
    <title>The 'application/tei+xml' mediatype</title>

    <author initials="L." surname="Romary" fullname="Laurent Romary"> 
      <organization>TEI Consortium and INRIA</organization>
      <address>
	<postal>
	  <street/>
	  <city/>
	  <country/>
	</postal>
	<email>laurent.romary@inria.fr</email>
	<uri>http://www.tei-c.org/</uri>
      </address>
    </author>

    <author initials="S.L.W." surname="Lundberg" fullname="Sigfrid Lundberg" >
      <organization>The Royal Library, Copenhagen</organization>
      <address>
	<postal>
	  <street>Postbox 2149</street>
	  <city>1016 København K</city>
	  <country>Denmark</country>
	</postal>
	<email>slu@kb.dk</email>
	<uri>http://sigfrid-lundberg.se/</uri>
      </address>
    </author>

    <date/>

    <abstract>
      <t>This document defines the 'application/tei+xml' media type for markup
      languages defined in accordance with the Text Encoding and Interchange
      guidelines</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">

      <t>Text Encoding and Interchange (TEI) is an international and
      interdisciplinary standard that is widely used by libraries, museums,
      publishers, and individual scholars to represent all kinds of textual
      material for online research and teaching.<xref target="TEI"/></t>

      <t>This document defines the 'application/tei+xml' media type in
      accordance with <xref target="RFC3023"/> in order enable generic
      processing of such documents on the Internet using eXtensible Markup
      Language (XML)<xref target="W3C.REC-xml-20081126"/> technologies.</t>

    </section>


    <section anchor="recognizing" title="Recognizing TEI files">

      <t>TEI files are XML documents or fragments having the root element (as
      defined in <xref target="W3C.REC-xml-20081126"/>) in a TEI
      namespace. TEI namespace names are defined as an Universal Resource
      Identifier (URI) <xref target="RFC3986"/> in accordance with <xref
      target="W3C.REC-xml-names-20091208"/> and begins with
      http://www.tei-c.org/ns/ followed by the version number of the
      namespace. The current namespace is <eref
      target="http://www.tei-c.org/ns/1.0">http://www.tei-c.org/ns/1.0</eref></t>

      <t>
	The most common root element names for TEI documents are
	<list>
	  <t>&lt;TEI&gt;</t>
	  <t>&lt;teiCorpus&gt;</t> 
	</list> 
      </t>

      <t>The teiCorpus documents give the possibility to bundle
      multiple documents into a single file.</t>

      <t>
	Examples:
	<list>
	  <t>A document having &lt;TEI&gt; root element
	  <figure>
	    <artwork><![CDATA[
	    <?xml version="1.0" encoding="UTF-8" ?>
	    <TEI xmlns="http://www.tei-c.org/ns/1.0">
	       <teiHeader>
	       ...
	       </teiHeader>
	       <text>
	       ...
	       </text>
	    </TEI>
	    ]]></artwork>
	  </figure>

	  </t>

	  <t>A document having &lt;teiCorpus&gt; root element
	  <figure>
	    <artwork><![CDATA[
	    <?xml version="1.0" encoding="UTF-8" ?>
	    <teiCorpus  xmlns="http://www.tei-c.org/ns/1.0">
	       <teiHeader>
	       ...
	       </teiHeader>
	       <TEI>
	          <teiHeader>
	          ...
	          </teiHeader>
	          <text>
	          ...
	          </text>
	       </TEI>
	       <TEI>
	       ... second document ...
	       </TEI>
	       <TEI>
	       ... third document  ...
	       </TEI>
	    </teiCorpus>
	    ]]></artwork>
	  </figure>
	  </t>

	</list>
      </t>

      <t>TEI and teiCorpus files are often given the extensions .tei and
      .teiCorpus, respectively. There is a third type of file, which often is
      given the suffix .odd. ODD (‘One Document Does it All’) is a TEI XML
      document which include schema fragments, prose documentation, and
      reference documentation. It is used for the definition and documentation
      of XML based languages, and primarily for the TEI Guidelines.<xref
      target="ODD"/> In other words, ODD files does not differ from other TEI
      file in syntax, only in function.</t>

    </section>

    <section title="Fragment identifier">
      <t>Documents having the media type 'application/tei+xml', use the
      fragment identifier notation as specified in <xref
      target="RFC3023"/> for the media type 'application/xml'.</t>
    </section>

    <section anchor="security" title="Security considerations">

      <t>An XML resource does not in itself compromise data security. When
      being available on a network simply through the dereferencing of an
      Internationalized Resource Identifier (IRI) <xref target="RFC3987"/> or
      an URI, care must be taken to properly interpret the data to prevent
      unintended access. Hence the security issues of <xref
      target="RFC3986"/>, section 7, apply. In addition, as this media type
      uses the "+xml" convention, it shares the same security considerations
      as described in RFC 3023 <xref target="RFC3023"/>, section 10. In
      general, security issues related to the use of XML in IETF protocols are
      treated in RFC 3470<xref target="RFC3470"/>, section 7. We will not try
      to duplicate this material, but review some aspects that are important
      for document centric XML as applied to text encoding.</t>

      <section title="Harmful content">
	<t>Any application accepting submitted or retrieving TEI XML for
	processing has to be aware of risks connected with injection of
	harmful scripts and executable XML. XML inclusion<xref
	target="W3C.REC-xinclude-20061115"/> and the use of external entities,
	are vulnerable to various forms of spoofing but can also reveal
	aspects of a service in a way that may compromise its security. Any
	vulnerability of these kinds are, however, application specific. The
	TEI namespaces do not contain such elements.</t>
      </section>

      <section title="Intellectual Property Rights">
	<t>TEI documents often arise in digitization of cultural heritage
	materials. Texts made accessible in TEI format may be unrestricted in
	the sense that their distribution may be unlimited by Digital Rights
	Management<xref target="DRM"/> or Intellectual Property Rights<xref
	target="IPR"/> constraints. However, TEI documents are
	heterogeneous. Some parts of a document may be unrestricted, whereas
	other, such as editorial text and annotations may be subject to DRM
	restrictions.</t>

	<t>The TEI format provides means for highly granular attribution, down
	to the content of individual XML elements. Software agents
	participating in the exchange or processing TEI may be required to
	honour markup of this kind. Even when there are no IPR constraints,
	intellectual property attribution alone requires that document users
	are able to tell the difference between content from different
	sources.</t>

      </section>

      <section title="Authenticity and confidentiality">
	<t>Historical archival records are often encoded in TEI and legal
	document may be binding centuries after they were
	written. Digitization and encoding of legal texts may require
	technologies for assuring authenticity, such as cryptographic check
	sums and electronic signatures.</t>

	<t>Similarly, historical documents may in part or in their entirety be
	confidential. This may be required by law or by the terms and
	conditions such as in the case of donated or deposited text from
	private sources. A text archive may need content filtering or
	cryptographic technologies to meet such requirements.</t>
      </section>

    </section>

    <section title="IANA Considerations">

      <section anchor="registration"
	       title="Registration of MIME type &apos;application/tei+xml&apos;">
	<t>
	  <list>
	    <t>MIME media type name:  application</t>
	    <t>MIME subtype name:  tei+xml</t>
	    <t>Required parameters:  None</t>
	    <t>
	      Optional parameters:  charset
	      <list>
		<t>the parameter has identical semantics to the charset
		parameter of the "application/xml" media type as specified in
		RFC 3023 <xref target="RFC3023"/>.</t>
	      </list>
	    </t>

	    <t>
	      Encoding considerations:
	      <list>
		<t>Identical to those for 'application/xml'. See RFC 3023
		<xref target="RFC3023"/>, Section 3.2.</t>
	      </list>
	    </t>

	    <t>
	      Security considerations:
	      <list>
		<t>See <xref target="security">Security considerations</xref> in
		this specification.</t>
	      </list>
	    </t>

	    <t>
	      Interoperability considerations:
	      <list>
		<t>TEI documents are often given the extension '.xml', which
		is not uncommon for other XML document formats.</t>
	      </list>
	    </t>

	    <t>
	      Published specification:
	      <list>
		<t>This media type registration is for TEI documents<xref
		target="TEI"/> as described in here. TEI syntax is
		defined in a schema.<xref target="TEIschema"/></t>
	      </list>
	    </t>
	    
	    <t>
	      Applications which use this media type:
	      <list>
		<t>There are currently no known applications using the media type
		'application/tei+xml'.</t>
	      </list>
	    </t>

	    <t>
	      Additional information:

	      <list>
		<t>
		  Magic number(s):
		  <list>
		    <t>There is no single initial octet sequence that is always
		    present in TEI documents.</t>
		  </list>
		</t>
		<t>
		  file extension(s):
		  <list>
		    <t>Common extensions are '.tei', '.teiCorpus' and
		    '.odd'. See <xref target="recognizing">Recognizing TEI
		    files</xref> in this specification.</t>
		  </list>
		</t>
		<t>
		  Macintosh File Type Code(s)
		  <list>
		    <t>TEXT</t>
		  </list>

		</t>

		<t>
		  Object Identifier(s) or OID(s)
		  <list>
		    <t>Not applicable</t>
		  </list>
		</t>

	      </list>
	    </t>
	  </list>
	</t>
      </section>



    </section>
    
  </middle>

  <back>
    <references title="Normative References">
      <reference anchor="TEI" 
	         target="http://www.tei-c.org/Vault/P5/1.8.0/doc/tei-p5-doc/en/html/">
	<front>
	  <title>TEI Guidelines</title>
	  <author/>
	  <date/>
	</front>
      </reference>

      <reference anchor="TEIschema" 
	         target="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng">
	<front>
	  <title>Schema generated from ODD source</title>
	  <author/>
	  <date/>
	</front>
      </reference>


      &recxml;
      &rfc3023;
      &rfc3986;
      &recxmlnames;
      &rfc3987;
      &rfc3470;
    </references>

    <references title="Informative References">

      <reference anchor="ODD" 
	         target="http://www.tei-c.org/Guidelines/Customization/odds.xml">
	<front>
	  <title>Getting Started with P5 ODDs</title>
	  <author/>
	  <date/>
	</front>
      </reference>
      &xinclude;
      <reference anchor="DRM" 
	         target="http://en.wikipedia.org/wiki/Digital_rights_management">
	<front>
	  <title>Digital rights management</title>
	  <author/>
	  <date/>
	</front>
      </reference>
      <reference anchor="IPR" 
	         target="http://en.wikipedia.org/wiki/Intellectual_Property_Rights">
	<front>
	  <title>Intellectual property</title>
	  <author/>
	  <date/>
	</front>
      </reference>
    </references>
  </back>

</rfc>
