added example of singleton node

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@2230 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2008-09-08 21:15:06 +00:00
parent b574d3202b
commit f333f92abf
1 changed files with 12 additions and 0 deletions

View File

@ -5581,6 +5581,18 @@ O, what a rogue and peasant slave am I!
</section2>
<section2 topic='Singleton Nodes' anchor='impl-singleton'>
<p>For some nodes, it is desirable to have at most one item associated with the node at any one time (for example, a client may want to store its preferences using a node name that is a namespace controlled by that client). When this pattern is desired, it is RECOMMENDED for the publisher to specify an ItemID of "current" to ensure that the publication of a new item will overwrite the existing item.</p>
<example caption='Publishing to a Singleton Node'><![CDATA[
<iq type='set'
from='horatio@denmark.lit/mobile'
to='pubsub.shakespeare.lit'
id='single1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='elsinore-doorbell'>
<item id='current'/>
</publish>
</pubsub>
</iq>
]]></example>
</section2>
</section1>