Name
html — Optional
Synopsis
<message id="3" to="dj@yak" type="chat">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<span style="font-family: Arial; font-size: 10pt">
This is really <em>nice!</em>
</span>
<br/>
</body>
</html>
<body>This is really nice!</body>
</message>
The <html/>
tag is for
support of messages formatted in Extensible HyperText Markup Language (XHTML).
The normal
<body/>
tag carries plain
text; text formatted with XHTML markup can be carried in
<message/>
elements inside
the <html/>
subelement.
The markup must be qualified by the XHTML namespace
http://www.w3.org/1999/xhtml
(as shown in the example) and conform to the markup described in the
XHTML-Basic specification defined at
http://www.w3.org/TR/xhtml-basic. This is despite the
name of the tag being html
and not xhtml
.
Note that the content of the message must also be repeated in a normal
<body/>
subelement without
formatting, to comply with the “lowest common denominator” support for
different Jabber clients—not all of them will be able to interpret the XHTML
formatting, so they will need to receive the message content in a way that they
can understand.
The <html/>
subelement
effectively is a wrapper around a second, alternative,
<body/>
subelement.
Get Programming Jabber 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.