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:
Headers
<CR><LF>
<CR><LF>
Body
MIME messages are used in both the SMTP and HTTP protocols and are the traditional basic datatype of the Internet.
MIME is expressed as XML by a simple set of transforms:
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.
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.
Each MIME header is represented by an element whose local name is the header name. Parameters are represented by child elements.
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"
.
Each parameter is represented by an element whose local name is the parameter name.
When the header has parameters, its value is contained in a web:value
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.
The MIME:
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#" xmlns:mime="http//www.openhealth.org/xmtp#" xmlns:web="http://www.w3.org/1999/02/22-rdf-syntax-ns#" web:about="mid:xxxyyy@openhealth.org"> <Message-ID>xxxyyy@openhealth.org</Message-ID> <From>jonathan@openhealth.org</From> <To>xml-dev@lists.xml.org</To> <Subject> An example</Subject> <MIME-Version>1.0</MIME-Version> <Content-Type>text/plain</Content-Type> <mime:Body xmlns="">This is a simple message in MIME format</mime:Body> </Message>
Received: from 157.54.9.104 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. ------_=_NextPart_001_01C00ED4.89FE2B99 Content-Type: text/plain; charset="ISO-8859-1" Sincerely, John Doe Microsoft DSX Messaging Email: < <mailto:johndo@microsoft.com> > ------_=_NextPart_001_01C00ED4.89FE2B99 Content-Type: text/html; charset= "ISO-8859-1" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
is transformed into:
<?xml version="1.0" standalone="yes"?>
<Message
web:about="mid:12C50B343E32FC4EA257902D287AD57605843172@clt-msg-01.northamerica.corp.microsoft.com"
xmlns="http://www.openhealth.org/xmtp#"
xmlns:web="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Message-ID><12C50B343E32FC4EA257902D287AD57605843172@clt-msg-01.northamerica.corp.microsoft.com></Message-ID>
<From>John Doe <johndo@microsoft.com></From>
<To><test-xmtp@openhealth.org></To>
<Subject>A test</Subject>
<Date>Fri, 25 Aug 2000 13:39:17 -0700</Date>
<MIME-Version>1.0</MIME-Version>
<Content-Type web:parseType="Resource">
<boundary>----_=_NextPart_001_01C00ED4.89FE2B99</boundary>
<web:value>multipart/alternative</web:value>
</Content-Type>
<Body>
<Message>
<Content-Type web:parseType="Resource">
<charset>ISO-8859-1</charset>
<web:value>text/plain</web:value>
</Content-Type>
<Body>
Sincerely,
John Doe
Microsoft DSX Messaging
Email: < mailto:johndo@microsoft.com <mailto:johndo@microsoft.com> >
</Body>
</Message>
<Message>
<Content-Type web:parseType="Resource">
<charset>ISO-8859-1</charset>
<web:value>text/html</web:value>
</Content-Type>
<Body><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
...