[Standards-JIG] JEP-0060 (pubsub) Event Types

Bob Wyman bob at wyman.us
Sat Jun 26 18:16:12 UTC 2004

Ralph Meijer wrote:
> If the publisher would send no payload along in the publish,
> how can the pubsub service persist the item?
	The way JEP-0060 is currently written, it seems clear that you
can publish with no itemID and with no payload. The pubsub XSD is clear
about the fact that the item element which would otherwise contain the
payload is an optional child of <publish> (i.e. it has minOccurs=0).
Thus, the following would be a minimal publish request:

<iq type="set" from="xxx" to="xxx" id="publish1">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <publish node="generic/pgm-mp3-player"/>

	Ralph seems to be suggesting that the minimal request should
look like the following (itemID would remain optional, but item would
become required):

<iq type="set" from="xxx" to="xxx" id="publish1">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <publish node="generic/pgm-mp3-player">

	Personally, I see no significant semantic difference between the
two and prefer the first (the way things are currently written) since it
requires at least 16 fewer bytes in every request of this type. In
either case, any system which is persisting data is probably going to
simply store an empty node, some marker for "no item", or simply an
empty string. In some cases, this may require a slight increase in the
complexity of the persistence code, however, that added complexity is a
tiny cost when balanced against the cost of increasing the size of every
publish request by 16 bytes.

		bob wyman

More information about the Standards mailing list