[standards-jig] XHTML-IM (JEP-0071) and in-band images

Tomasz Sterna tomek at smoczy.net
Fri Jan 16 13:03:41 UTC 2004

Richard Dobson wrote:

>I used "hash" because it matches up with the "hash" value of the file in the
>file transfer protocol, so I think it should be kept as hash e.g.

>I dont see any need to put the value into a sub node, it serves no real
>purpose and unnecessarily increases the byte size of the xml.
You mentioned that you want the <obj/> to serve more purposes than the 
<img/> tag.
It should be easily extensible. Using attributes it isn't.

>What I was thinking about to simplify things is to possibly put the hash
>value as the cid e.g.
>[...] And have the request like this, this keeps it nice and simple,
Some think Perl is nice and simple, but I see it cryptic.
Same as puting the hash into the CID:

> <message type='chat' from='src at example.com/client' to='dest at example.com'>
>     <body>Hello mate :-)</body>
>     <html xmlns='http://jabber.org/protocol/xhtml-im'>
>         <body xmlns='http://www.w3.org/1999/xhtml'>
>             Hello mate <img src='cid:552da749930852c69ae5d2141d3766b1'/>
>         </body>
>     </html>
>     <obj xmlns='http://jabber.org/protocol/iobj' cid='552da749930852c69ae5d2141d3766b1'/>
> </message>

You are duplicating the information, gaining nothing.
And another thing. The hash '552da749930852c69ae5d2141d3766b1' is not 
really the attribute of <obj/>ect, but the attribute of file you want to 
get, so it does not belong to the <obj/> node.

I see it this way now:

    <obj xmlns='http://jabber.org/protocol/iobj' cid='123456789'>
        <file hash='552da749930852c69ae5d2141d3766b1'/>
        [.. place for other iobj parameters ..]


<iq type='set' from='dest at example.com/res' to='src at example.com/client' id='iobj1'>
    <query xmlns='http://jabber.org/protocol/iobj'>
        <file hash='552da749930852c69ae5d2141d3766b1'/>

>Another extra protocol you might want could be thumbnail request for large
>images, so you can implement image transfer like in MSN6 and display small
>thumbnails in the chat window so a person can get a glace of what they are
>accepting before they accept.
We are talking in context of HTML-IM.
My browser does not show me thumbnails of <img> tags while I view the 
So does not my wordprocessor with images inserted into text.
I don't see the reason of my IM client to behave diferently.

The case you've mentioned belongs to the client-initiated file transfer 
(mostly batch file transfer), not the <iobj/> initiated case and not the 
<iobj/> object.
I would also like the preety dialog window with thumbnails, when my 
friend wants to send me some files. That's good. :-)
But it is not the '<message><html/></message>' case.

>It should definately stay as "get" and not "query", it simplifies it and
>allows it to be more extensible to have the action you are performing be the
>node name, using query is not a requirement in jabber iq protocols and is up
>to the protocol dev if they have a valid reason for it not to be.
It simplifies the typing. But generally these are machine-generated streams.

It does not simplify the parser.
Now you can have the general IQ parser, that gets <query/> subnode and 
switch on its namespace.
Your way it has to search a node for every "command" of every 
sub-protocol and check if the namespace is correct.

Same happens for IQ generation.
APIs give you a function that you supply the iq type, query namespace, 
and subnodes, and you have the packet sent.

More information about the Standards mailing list