XML Message Format

The XML message format is used for transports that transmit text but not raw binary data. An effort is made to keep the message elements as readable as possible. See Section 16.4.5.

Message

The following is an XML message example:

<?xml version="1.0"?>

<!DOCTYPE Message>

<Message version="0">  <Element name="jxta:SourceAddress" 
    mime_type="text/plain">   tcp://123.456.205.212  </Element>  
    <Element name="stuff" encoding="base64" mime_type="application/octet- 
       stream">  AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygp
       KissLS4vMDEyMzQ1Njc4asOTo7PD0+P0BBkNERUZHSElKS0xNTk9QUVJTVFVWV1hZW
       ltcXV5fYGFiY2RlZmdoaWprbG1ub3BxwMHCw8TFxsc=  
    </Element> 
</Message>

The top-level XML element is the message element. There is one required attribute: version. The value of version must be 0. The body of the Message element is a sequence of Element elements.

Element

Each element must have a name and a mime_type attribute. Optionally, an encoding attribute may be present.

Name

This is a required attribute name for the element. The name contains the namespace, followed by a colon, followed by the simple name of the element.

mime_type

This is a required attribute indicating the MIME type of the element. If the MIME type was not specified in the message, the application/octet-stream is assumed.

Encoding

Encoding is optional. The only supported encoding at this time is base64. If the encoding is not present, the content is just treated as a string.

While name, type, and content are parts ...

Get JXTA in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.