XML MIME Transformation Protocol (XMTP)

An RDF XML mapping of RFC 822/MIME

This version: April 24, 2001

Latest Version

Previous Version: 1998



XMTP is a mapping of RFC 822/MIME to XML. XMTP 2.0 is implemented in RDF 1.0 syntax.

This is a RDDL document describing the XMTP namespace

The download contains a java implementation.

The JAR contains an implementation of a SAX XMLReader which parses a MIME document and outputs SAX events that describe the document in XMTP. This implementation also accepts a com.megginson.sax.RDFHandler property handling RDF statements corresponding to the parsed MIME document.


A description of the prior verion of XMTP can be found here and here.


The first standards for the transmission of text messages over the Internet (then the Arpanet) were defined by RFC 821/822. Multimedia Internet Message Extensions (MIME) extended this format for the representation of multimedia types. The basic organization of a MIME message is:





MIME messages are used in both the SMTP and HTTP protocols and are the traditional basic datatype of the Internet.

The XMTP XML representation

MIME is expressed as XML by a simple set of transforms:

Message element

The Message element is the root of a MIME/RFC 822 message. The Message element contains header child elements and a Body child element. The name of each Header child element is the name of the Header.

The mime prefix is bound to the namespace http://www.openhealth.org/xmtp#. This is also the default namespace.

web:about attribute

The web:about attribute references the message identifier URI.

The web prefix is bound to the http://www.w3.org/1999/02/22-rdf-syntax-ns# namespace URI.

Header elements

Each MIME header is represented by an element whose local name is the header name. Parameters are represented by child elements.

web:parseType attribute

When the header has parameters, the web:parseType="Resource" attribute is required. The header content is usually the content of the header element. When parameters are present, the content is the content of a child web:value element.

When a Body contains XML i.e. content-type text/xml,application/xml, text/*+xml or application/*+xml, web:parseType="Literal".

Parameter elements

Each parameter is represented by an element whose local name is the parameter name.

web:value element

When the header has parameters, its value is contained in a web:value element.

mime:Body Element

The body is contained in the mime:Body element. Each Message contains one Body element.

Binary data is base64 encoded.

Multipart MIME messages are represented as multiple Message child elements of the Body


A Grove or Graph Representation of Property Values is the logical structure of a document that can be obtained by parsing the character stream that represents the document.

XMTP implements an XML Grove for MIME, where the result of parsing a MIME document is a logical XML structure (otherwise known as an Infoset). The java project referenced above implements an XML Grove for MIME by parsing a MIME character stream into a SAX event stream, which is one of the incarnations of an XML Grove.

A wealth of information on Groves can be obtained at Robin Cover's XML CoverPages.


Similarly to the XML Grove obtained via parsing a MIME document into a series of SAX events, an RDF Grove is obtained by parsing a MIME document into an RDF Model. The implementation accepts an com.megginson.sax.RDFHandler interface property through which the parser can fire events signalling RDF statements.


A simple example


Message-ID: xxxyyy@openhealth.org
From: jonathan@openhealth.org
To: xml-dev@lists.xml.org
Subject: An example
MIME-Version: 1.0
Content-Type: text/plain

This is a simple message in MIME format

is transformed into:

<Message xmlns="http://www.openhealth.org/xmtp#"
  <Subject> An example</Subject>
  <mime:Body xmlns="">This is a simple message in MIME format</mime:Body>

A multipart example

Received: from by mail2.microsoft.com (InterScan E-Mail VirusWall NT); Fri, 25 Aug 2000 13:39:20 -0700 (Pacific Daylight Time)
Received: by INET-IMC-02 with Internet Mail Service (5.5.2651.58)
	id ; Fri, 25 Aug 2000 13:39:19 -0700
Message-ID: <12C50B343E32FC4EA257902D287AD57605843172@clt-msg-01.northamerica.corp.microsoft.com>
From: John Doe <johndo@microsoft.com>
To: test-xmtp@openhealth.org
Subject: A test 
Date: Fri, 25 Aug 2000 13:39:17-0700 
MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2651.58)
Content-Type:multipart/alternative; boundary="----_=_NextPart_001_01C00ED4.89FE2B99"

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

Content-Type: text/plain;
John Doe
Microsoft DSX Messaging
Email: < <mailto:johndo@microsoft.com> >

Content-Type: text/html;

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
is transformed into:
<?xml version="1.0" standalone="yes"?>
  <From>John Doe &lt;johndo@microsoft.com&gt;</From>
  <Subject>A test</Subject>
  <Date>Fri, 25 Aug 2000 13:39:17 -0700</Date>
  <Content-Type web:parseType="Resource">
  <Content-Type web:parseType="Resource">
John Doe
Microsoft DSX Messaging
Email: &lt; mailto:johndo@microsoft.com &lt;mailto:johndo@microsoft.com&gt; &gt;


<Content-Type web:parseType="Resource">
<Body>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
&lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"&gt;