XEP-0071: XHTML-IM
XEP-0071: XHTML-IM
Abstract
This specification defines an XHTML 1.0 Integration Set for use in exchanging instant messages that contain lightweight text markup. The protocol enables an XMPP entity to format a message using a small range of commonly-used HTML elements, attributes, and style properties that are suitable for use in instant messaging. The protocol also excludes HTML constructs that may introduce malware and other vulnerabilities (such as scripts and objects) for improved security.
Author
Peter Saint-Andre
SEE LEGAL NOTICES
Status
Deprecated
WARNING: This document has been
Deprecated
by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended. Developers desiring similar functionality are advised to implement the protocol that supersedes this one (if any).
Type
Standards Track
Version
1.5.4 (2018-03-08)
Document Lifecycle
Experimental
Proposed
Stable
Final
Deprecated
Obsolete
1.
Introduction
This document defines methods for exchanging instant messages that contain lightweight text markup. In the context of this document, "lightweight text markup" is to be understood as a combination of minimal structural elements and presentational styles that can easily be rendered on a wide variety of devices without requiring a full rich-text rendering engine such as a web browser. Examples of lightweight text markup include basic text blocks (e.g., paragraphs and blockquotes), structural elements (e.g., emphasis and strength), lists, hyperlinks, image references, and font styles (e.g., sizes and colors).
Note: This specification essentially defines a recommended set of XHTML elements and attributes for use in instant messaging by applying a series of "filters" to the wealth of XHTML features; however, developers of Jabber/XMPP clients mainly need to pay attention to the
Summary of Recommendations
rather than the complexities of how the recommendations are derived.
2.
Choice of Technology
In the past, there have existed several incompatible methods within the Jabber community for exchanging instant messages that contain lightweight text markup. The most notable such methods have included derivatives of
XHTML 1.0
] as well as of
Rich Text Format (RTF)
].
Although it is sometimes easier for client developers to implement RTF support (this is especially true on certain Microsoft Windows operating systems), there are several reasons (consistent with the
XMPP Design Guidelines (XEP-0134)
]) for the
XMPP Standards Foundation (XSF)
] to avoid the use of RTF in developing a protocol for lightweight text markup. Specifically:
RTF is not a structured vocabulary derived from SGML (as is
HTML 4.0
]) or, more relevantly, from XML (as is XHTML 1.0).
RTF is under the control of the Microsoft Corporation and thus is not an open standard maintained by a recognized standards development organization; therefore the XSF is unable to contribute to or influence its development if necessary, and any protocol the XSF developed using RTF would introduce unwanted dependencies.
Conversely, there are several reasons to prefer XHTML for lightweight text markup:
XHTML is a structured format that is defined as an application of
XML 1.0
], making it especially appropriate for sending over Jabber/XMPP, which is at root a technology for streaming XML (see
XMPP Core
]).
XHTML is an open standard developed by the
World Wide Web Consortium (W3C)
], a recognized standards development organization.
Therefore, this document defines support for lightweight text markup in the form of an XMPP extension that encapsulates content defined by an XHTML 1.0 Integration Set that we label "XHTML-IM". The remainder of this document discusses lightweight text markup in terms of XHTML 1.0 only and does not further consider RTF or other technologies.
3.
Requirements
HTML was originally designed for authoring and presenting stuctured documents on the World Wide Web, and was subsequently extended to handle more advanced functionality such as image maps and interactive forms. However, the requirements for publishing documents (or developing transactional websites) for presentation by dedicated XHTML user agents on traditional computers or small-screen devices are fundamentally different from the requirements for lightweight text markup of instant messages; for this reason, only a reduced set of XHTML features is needed for XHTML-IM. In particular:
IM clients are not XHTML clients: their primary purpose is not to read pre-existing XHTML documents, but to read
and generate
relatively large numbers of fairly small instant messages.
The underlying context for XHTML content in Jabber/XMPP instant messaging is provided not by a full XHTML document, but by an XML stream, and specifically by a message stanza within that stream. Thus the element and all its children are unnecessary. Only the element and some of its children are appropriate for use in instant messaging.
The XHTML content that is read by one's IM client is normally generated on the fly by one's conversation partner (or, to be precise, by his or her IM client). Thus there is an inherent limit to the sophistication of the XHTML markup involved. Even in normal XHTML documents, fairly basic structural and rendering elements such as definition lists, abbreviations, addresses, and computer input handling (e.g., and ) are relatively rare. There is little or no foreseeable need for such elements within the context of instant messaging.
The foregoing is doubly true of more advanced markup such as tables, frames, and forms (however, there exists an XMPP extension that provides an instant messaging equivalent of the latter, as defined in
Data Forms (XEP-0004)
]).
Although ad-hoc styles are useful for messaging (by means of the 'style' attribute), full support for
Cascading Style Sheets
10
] (defined by the