[jdev] my own xml in body tag

Ralph Meijer jabber.org at ralphm.ik.nu
Sun May 15 07:03:00 CDT 2005


On Sun, May 15, 2005 at 11:55:04AM +0200, Ulrich Staudinger wrote:
> 
> 
> Jeremy Nickurak schrieb:
> 
> >Why not just:
> >
> ><message to='...' type='chat' from='...'>
> >    <game xmlns='http://some.your.na/mespace' nbPlayers='10' />
> ></message>
> > 
> >
> Because per definition/the specs free form tags are only allowed inside 
> the X-tag.

Not true!

There is no need to call extension child elements to <message/> <x/>.
The element can have any name as defined by the namespace it claims to
be in using the xmlns attribute. An example in current JEPs is the
notification events from JEP-0060 (pubsub):

    <message to="subscriber1" from="pubsub.jabber.org">
      <event xmlns="http://jabber.org/protocol/pubsub#event">
	<items node="generic/pgm-mp3-player">
	  <item id="current"/>
	</items>
      </event>
    </message>

Another example is sending XHTML using JEP-0071.

What is true is that it used to be a convention to use 'x' as the
element name, and several Jabber libraries erroneous still assume this.

Jeremy's example is perfectly legal, and IMHO a whole lot better than
wrapping it inside another element for no additional gain.

-- 
Groetjes,

ralphm



More information about the JDev mailing list