XMIME - XML MIME Markup Language




This version

20010716
Previous version
none
Editors
Anders W. Tell,  Financial Toolsmiths AB, <anderst@toolsmiths.se>


Abstract

The XMIME is a markup language for encoding Multimedia Internet Message Extensions MIME as defined by IETF RFC 822, RFC 1521 and RFC 2045.

Status of Document
Initial submission to Open ebXML project, which should form the basis for further discussions.
 

Table of Contents
 

1. Introduction
2. Requirements
3. Headers
  3.1 Generic field
  3.2 Parsed field
4. Message types
  4.1. Simple message type
  4.2. Multipart message type
5. Body
  5.1 Text
  5.2 Base64
  5.3 XML
  5.4 Message
Appendices
  A. References
  B. DTD
  C. XML Schema
  D. Contributors
1. Introduction

Mappings of two kinds of MIME messages are handled within XMIME, simple messages and multipart messages.

2. Requirements

  1. XMML MUST support the following IETF RFC's:
3. Headers
Both simple and multipart MIME messages contains header fields.
All immediately children of <fields> tag MUST be interpreted as either a generic field or a parsed field.
 
 Example of header fields
Content-Type:  text/plain <m:fields>
  <m:field name="Content-Type">text/plain</m:field>
</m:fields>

3.1 Generic field
A generic field is a field that a MIME processor cannot specifically recognize and the field-body MUST therefore be treated as a untyped string.
 
 Example of generic header field
Content-Type:  text/plain; 
    boundary="---boundaryX"
<m:field name="Content-Type">
    text/plain;
     boundary="---boundaryX"
</m:field>

3.2 Parsed field
A parsed field is a field that a MIME Processor recognizes and knows how to parse and therefore MAY convert into a specific field element.
 
 Example of parsed header field
Content-Type:  text/plain ;
     boundary="---boundaryX"
<Content-Type>
  <value>text/plain</value>
  <param name="boundary">---boundaryX</param>
</Content-Type>

4. Message types
 

4.1 Simple message type
As defined by RFC 822.
Basically a number of fields and a single message body
 
 Example header fields
Subject: example of simple message
Content-Type:  text/plain

...

<m:message xmlns:m="">
  <m:fields>
   <m:field name="Content-Type">text/plain</m:field>
   <Subject> example of simple message </Subject>
  </m:fields>
  <m:body>
   ...
  </m:body>
</m:message>

4.2 Multipart message type
As defined by RFC 1521 and RFC 2045
 
 
 Example header fields
Content-Type:  text/plain ;
     boundary="---boundaryX"

discardable preamble text
----boundaryX

...

----boundaryX--
discardable epilogue text

<m:multipart xmlns:m="">
  <m:fields>
    <Content-Type>
      <value>text/plain</value>
      <param name="boundary">---boundaryX</param>
    </Content-Type>
  </fields>

  <m:multipart-body>
    <m:preamble> discardable preamble text </m:preamble>

    <m:body-parts>

      <m:body-part>
         ...
      </m:body-part>

    </m:body-parts>

    <m:epilogue> discardable epilogue text </m:epilogue>
  </m:multipart-body>
</m:multipart>

[ED: is <body-part> really needed? ]
[ED: are preamble and epilogue really needed? ]
 

5. Body

5.1 Text
Message body that is can be represented using enclosing XMIME character encoding

5.2 Base64
For body content that cannot be represented in XML using enclosing XMIME character encoding.
Message body is encoded according to BASE 64 rules as defined in ...

[ED:  dig up reference to BASE64 RFC]

5.3 XML
Special case when contents is an XML document with the following characteristics


5.4 Messages
Either simple message or multipart message, see Messages chapter.
 

Appendices

A. References
[ED: To write]

IETF RFC 822
IETF RFC 1521
IETF RFC 2045.
 

B. DTD
 
XMML DTD
<?xml version="1.0" encoding="UTF-8"?>

<!-- XMIME - XML MIME markup Language 

     Copyright: 2001 , Open ebXML, "http://www.openebxml.org"
     Author: Anders W. Tell, Financial Toolsmiths AB
     Version: 20010716
-->
 

<!ENTITY % MESSAGE "(message | multipart)">

<!-- BODY -->
<!ELEMENT base64 (#PCDATA)>
<!ELEMENT text (#PCDATA)>
<!ELEMENT xml-body (#PCDATA)>
<!ELEMENT body (text | base64 | xml-body | %MESSAGE;)>
 

<!-- FIELD definitions -->
<!ELEMENT field (#PCDATA)>
<!ATTLIST field
 name NMTOKEN #REQUIRED
>

<!ENTITY % FIELD "(field | Content-Type)">

<!ELEMENT value (#PCDATA)>
<!ELEMENT param (#PCDATA)>
<!ATTLIST param
 name NMTOKEN #REQUIRED
>
<!ELEMENT Content-Type (value, param*)>

<!ELEMENT fields (%FIELD;)* >
 

<!-- MESSAGES -->

<!ELEMENT message (fields, body)>

<!ELEMENT preamble (#PCDATA)>
<!ELEMENT epilogue (#PCDATA)>
<!ELEMENT body-part (%MESSAGE;)>
<!ELEMENT body-parts (body-part*)>
<!ELEMENT multipart-body (preamble?, body-parts, epilogue?)>
<!ELEMENT multipart (fields, multipart-body)>

 

[ED:  Add schema for all predefined header fields as defined in RFC822, 1521, 2045, etc.]
 

C. XML Schema

[ED: To write]

D. Contributors

[ED: To add]