[JDEV] adding xml tag to message

David Waite dwaite at jabber.com
Wed Mar 14 13:36:13 CST 2001


Answer - all currently servers do not perform validation against a DTD or
XML Schema. Only if there is an error in the protocol as defined (required
attributes or elements missing) would any of the servers currently out throw an
error.  So with the current servers,

<message to='someone'>
<special>hey, look at me!</special>
</message>

would pass right through.

The reason I stressed 'currently' three times is that these only allow the data
through because it is a router and there is an efficiency hit in trying to
enforce a schema. The Jabber protocol only states that the server 'may' let
additional data outside the protocol through, and that a client which receives
this 'should' ignore it. Exploiting a misfeature in current server
implementations means that your client in the future may only work on some
networks. You will also be creating a client which goes against the Jabber
protocol.

Use XML namespaces instead. This is a standard mechanism which all clients
support, and which Jabber already uses extensively. As long as the URI you
specify in the 'xmlns' attribute does not begin with "jabber:", the server will
let it right through.

-David Waite

Keith Emnett wrote:

> If a client adds an extra xml tag to a message (such as a new tag in the
> <presence> message), will the server forward the message (keeping the extra
> tag) to subscribed clients, or does it validate the message against a schema
> and return an error of some sort?
>
> Basically, is there a way for a client to encode additional information that
> clients of the same type can recognize?
>
> Thanks - Keith
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev





More information about the JDev mailing list