No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0030.xml 54KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Service Discovery</title>
  10. <abstract>This specification defines an XMPP protocol extension for discovering information about other XMPP entities. Two kinds of information can be discovered: (1) the identity and capabilities of an entity, including the protocols and features it supports; and (2) the items associated with an entity, such as the list of rooms hosted at a multi-user chat service.</abstract>
  12. <number>0030</number>
  13. <status>Final</status>
  14. <interim/>
  15. <type>Standards Track</type>
  16. <sig>Standards</sig>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. </dependencies>
  20. <supersedes>
  21. <spec>XEP-0011</spec>
  22. <spec>XEP-0094</spec>
  23. </supersedes>
  24. <supersededby/>
  25. <shortname>disco</shortname>
  26. <schemaloc>
  27. <ns></ns>
  28. <url></url>
  29. </schemaloc>
  30. <schemaloc>
  31. <ns></ns>
  32. <url></url>
  33. </schemaloc>
  34. <registry/>
  35. &hildjj;
  36. &pgmillard;
  37. &reatmon;
  38. &stpeter;
  39. <revision>
  40. <version>2.5rc3</version>
  41. <date>2017-10-03</date>
  42. <initials>th</initials>
  43. <remark><p>XML schema modified so that no ordering is required between disco#info children.</p></remark>
  44. </revision>
  45. <revision>
  46. <version>2.5rc2</version>
  47. <date>2016-10-13</date>
  48. <initials>egp</initials>
  49. <remark>
  50. <p>Fixed the examples to always include a disco#info feature.</p>
  51. <p>Listed the proper namespace in the schemaloc ns element.</p>
  52. </remark>
  53. </revision>
  54. <revision>
  55. <version>2.5rc1</version>
  56. <date>2015-09-22</date>
  57. <initials>editor(mam)</initials>
  58. <remark>
  59. <p>Errata submitted to standards@ regarding subscriptions and returned items.</p>
  60. <p>Clarify that feature elements must be childless to make the text match the schema.</p>
  61. </remark>
  62. </revision>
  63. <revision>
  64. <version>2.4</version>
  65. <date>2008-06-06</date>
  66. <initials>psa</initials>
  67. <remark><p>Per Council consensus, removed disco-publish feature (implementations should use publish-subscribe instead).</p></remark>
  68. </revision>
  69. <revision>
  70. <version>2.3</version>
  71. <date>2007-02-15</date>
  72. <initials>psa</initials>
  73. <remark><p>Added implementation note regarding Entity Capabilities.</p></remark>
  74. </revision>
  75. <revision>
  76. <version>2.2</version>
  77. <date>2006-01-24</date>
  78. <initials>psa</initials>
  79. <remark><p>Further specified and clarified security considerations relating to server handling of requests sent to bare JIDs.</p></remark>
  80. </revision>
  81. <revision>
  82. <version>2.1</version>
  83. <date>2005-03-03</date>
  84. <initials>psa</initials>
  85. <remark><p>Added paragraph to implementation notes about server handling of requests sent to bare JIDs.</p></remark>
  86. </revision>
  87. <revision>
  88. <version>2.0</version>
  89. <date>2004-07-20</date>
  90. <initials>psa</initials>
  91. <remark><p>Per a vote of the Jabber Council, advanced status to Final.</p></remark>
  92. </revision>
  93. <revision>
  94. <version>1.10</version>
  95. <date>2004-06-29</date>
  96. <initials>psa/jjh</initials>
  97. <remark><p>Defined security considerations; changed extended presence example to use a fictitious protocol; further specified publish feature; defined registry submissions.</p></remark>
  98. </revision>
  99. <revision>
  100. <version>1.9</version>
  101. <date>2004-05-27</date>
  102. <initials>psa</initials>
  103. <remark><p>Clarified error conditions.</p></remark>
  104. </revision>
  105. <revision>
  106. <version>1.8</version>
  107. <date>2004-05-21</date>
  108. <initials>psa</initials>
  109. <remark><p>Moved remaining feature negotiation text to XEP-0020.</p></remark>
  110. </revision>
  111. <revision>
  112. <version>1.7</version>
  113. <date>2004-05-13</date>
  114. <initials>psa</initials>
  115. <remark><p>Added implementation note regarding flexibility of feature and item results; final editorial cleanup.</p></remark>
  116. </revision>
  117. <revision>
  118. <version>1.6</version>
  119. <date>2004-05-11</date>
  120. <initials>psa</initials>
  121. <remark><p>Corrected examples of publishing available items; further clarified nature of node hierarchies.</p></remark>
  122. </revision>
  123. <revision>
  124. <version>1.5</version>
  125. <date>2004-05-10</date>
  126. <initials>psa</initials>
  127. <remark><p>Added clarifying note about node hierarchies.</p></remark>
  128. </revision>
  129. <revision>
  130. <version>1.4</version>
  131. <date>2004-05-07</date>
  132. <initials>psa</initials>
  133. <remark><p>Clarified usage of "directory"; added section defining the relationship between an entity and its associated items.</p></remark>
  134. </revision>
  135. <revision>
  136. <version>1.3</version>
  137. <date>2004-04-23</date>
  138. <initials>psa</initials>
  139. <remark><p>Further clarified item-publication protocol; moved some feature negotiation text to XEP-0020; added information about registry of well-known service discovery nodes; added implementation notes regarding tree-walking and large result sets; incorporated additional Call for Experience suggestions.</p></remark>
  140. </revision>
  141. <revision>
  142. <version>1.2</version>
  143. <date>2004-04-20</date>
  144. <initials>psa</initials>
  145. <remark><p>Editorial cleanup; incorporated some Call for Experience suggestions.</p></remark>
  146. </revision>
  147. <revision>
  148. <version>1.1</version>
  149. <date>2004-03-15</date>
  150. <initials>psa</initials>
  151. <remark><p>Described requirements, syntax, and use cases in a more formal manner; corrected several errors in the examples and schemas; defined XMPP Registrar procedures; added a number of references; specified XMPP error handling.</p></remark>
  152. </revision>
  153. <revision>
  154. <version>1.0</version>
  155. <date>2003-04-21</date>
  156. <initials>psa</initials>
  157. <remark><p>Per a vote of the Jabber Council, advanced status to Draft; also added XML schemas.</p></remark>
  158. </revision>
  159. <revision>
  160. <version>0.13</version>
  161. <date>2003-02-25</date>
  162. <initials>pgm</initials>
  163. <remark><p>Added remarks about empty node attributes; described semantics regarding multiple identity elements.</p></remark>
  164. </revision>
  165. <revision>
  166. <version>0.12</version>
  167. <date>2003-02-06</date>
  168. <initials>pgm</initials>
  169. <remark><p>Added support for IQ-set; added example for disco#info to a specific node.</p></remark>
  170. </revision>
  171. <revision>
  172. <version>0.11</version>
  173. <date>2002-12-17</date>
  174. <initials>psa</initials>
  175. <remark><p>Added support for the 'node' attribute per discussion on the Standards list in order to support items that are not JID-addressable.</p></remark>
  176. </revision>
  177. <revision>
  178. <version>0.10</version>
  179. <date>2002-11-21</date>
  180. <initials>psa</initials>
  181. <remark><p>Changed &lt;feature type='foo'/&gt; to &lt;feature var='foo'/&gt; to track changes in feature negotiation (XEP-0020); added initial registry parameters.</p></remark>
  182. </revision>
  183. <revision>
  184. <version>0.9</version>
  185. <date>2002-11-07</date>
  186. <initials>psa</initials>
  187. <remark><p>Added support for empty result sets in disco#item.</p></remark>
  188. </revision>
  189. <revision>
  190. <version>0.8</version>
  191. <date>2002-11-01</date>
  192. <initials>psa</initials>
  193. <remark><p>Removed the max, start, and total attributes for item queries (this will be handled by a generic paging protocol); added "" namespace as a feature to signal negotiability regarding one or more features.</p></remark>
  194. </revision>
  195. <revision>
  196. <version>0.7</version>
  197. <date>2002-10-28</date>
  198. <initials>psa</initials>
  199. <remark><p>Cleaned up the feature text and examples.</p></remark>
  200. </revision>
  201. <revision>
  202. <version>0.6</version>
  203. <date>2002-10-27</date>
  204. <initials>psa</initials>
  205. <remark><p>Added the 'category' attribute to the &lt;feature/&gt; element; added security, IANA, and XMPP Registrar considerations; added a number of examples.</p></remark>
  206. </revision>
  207. <revision>
  208. <version>0.5</version>
  209. <date>2002-10-15</date>
  210. <initials>psa</initials>
  211. <remark><p>Total overhaul and simplification.</p></remark>
  212. </revision>
  213. <revision>
  214. <version>0.4</version>
  215. <date>2002-07-16</date>
  216. <initials>psa</initials>
  217. <remark><p>Major additions and fixes, many more examples.</p></remark>
  218. </revision>
  219. <revision>
  220. <version>0.3</version>
  221. <date>2002-05-30</date>
  222. <initials>psa</initials>
  223. <remark><p>Re-organized around use cases, made some minor fixes.</p></remark>
  224. </revision>
  225. <revision>
  226. <version>0.2</version>
  227. <date>2002-05-05</date>
  228. <initials>psa</initials>
  229. <remark><p>Incorporated comments from co-authors and added notes.</p></remark>
  230. </revision>
  231. <revision>
  232. <version>0.1</version>
  233. <date>2002-05-03</date>
  234. <initials>psa</initials>
  235. <remark><p>Initial draft.</p></remark>
  236. </revision>
  237. </header>
  238. <section1 topic='Introduction' anchor='intro'>
  239. <p>The ability to discover information about entities on the Jabber network is extremely valuable. Such information might include features offered or protocols supported by the entity, the entity's type or identity, and additional entities that are associated with the original entity in some way (often thought of as "children" of the "parent" entity). While mechanisms for doing so are not defined in &xmppcore;, several protocols have been used in the past within the Jabber community for service discovery, specifically &xep0011; and &xep0094;. However, those protocols are perceived to be inadequate for several reasons:</p>
  240. <ol>
  241. <li><p>Neither Jabber Browsing nor Agent Information is easily extensible. For example, the categories and subcategories listed for JID-Types in XEP-0011 are explicitly defined as the only official categories, and any additions to the list of JID-Types would require a modification to XEP-0011. While the Jabber Browsing specification does allow for the use of unofficial categories and types prefixed with the string 'x-', this introduces migration issues. This lack of flexibility violates one of the Jabber community's core &xep0134;.</p></li>
  242. <li><p>In Agent Information, there is no way to advertise supported features. While Jabber Browsing includes such a mechanism, the only way to express the availability of a feature is to advertise a supported protocol namespace. Yet some features may not be uniquely associated with a protocol namespace, which are one implementation of features but not the only one.</p></li>
  243. <li><p>A Jabber Browsing result returns a combination of (1) namespaces supported by a Jabber Entity, (2) items associated with a Jabber Entity, and (3) namespaces supported by the associated items. This approach mixes information levels and requires parents to know everything about child nodes, thereby introducing significant confusion.</p></li>
  244. <li><p>In both Jabber Browsing and Agent Information, items must be addressable as JIDs; however, this may not be possible in some applications.</p></li>
  245. </ol>
  246. <p>This document addresses the perceived weaknesses of both the Jabber Browsing and Agent Information protocols. The result is a standards-track protocol for service discovery (often abbreviated to "disco", as is familiar in protocols such as &w3soap;).</p>
  247. </section1>
  248. <section1 topic='Requirements' anchor='reqs'>
  249. <p>The authors have designed the service discovery protocol with the following requirements in mind:</p>
  250. <ul>
  251. <li><p>The protocol MUST support all functionality supported by the protocols it supersedes (Jabber Browsing and Agent Information).</p></li>
  252. <li>
  253. <p>There are three kinds of information that need to be discovered about an entity:</p>
  254. <ol>
  255. <li>its basic identity (type and/or category)</li>
  256. <li>the features it offers and protocols it supports</li>
  257. <li>any additional items associated with the entity, whether or not they are addressable as JIDs</li>
  258. </ol>
  259. <p>All three MUST be supported, but the first two kinds of information relate to the entity itself whereas the third kind of information relates to items associated with the entity itself; therefore two different query types are needed.</p>
  260. </li>
  261. <li><p>Discovering information about a child item MUST be accomplished by sending a separate discovery request to that item, not to the parent entity. (One result of this is that discovering complete information about an entire tree will require multiple request/response pairs in order to "walk the tree".)</p></li>
  262. <li><p>The lists of identities and features MUST be flexible.</p></li>
  263. <li><p>The protocol itself MUST be extensible.</p></li>
  264. </ul>
  265. </section1>
  266. <section1 topic='Discovering Information About a Jabber Entity' anchor='info'>
  267. <section2 topic='Basic Protocol' anchor='info-basic'>
  268. <p>A requesting entity may want to discover information about another entity on the network. The information desired generally is of two kinds:</p>
  269. <ol>
  270. <li><p><strong>The target entity's identity.</strong> In disco, an entity's identity is broken down into its category (server, client, gateway, directory, etc.) and its particular type within that category (IM server, phone vs. handheld client, MSN gateway vs. AIM gateway, user directory vs. chatroom directory, etc.). This information helps requesting entities to determine the group or "bucket" of services into which the entity is most appropriately placed (e.g., perhaps the entity is shown in a GUI with an appropriate icon). An entity MAY have multiple identities. When multiple identity elements are provided, the name attributes for each identity element SHOULD have the same value.</p>
  271. </li>
  272. <li><p><strong>The features offered and protocols supported by the target entity.</strong> This information helps requesting entities determine what actions are possible with regard to this entity (registration, search, join, etc.), what protocols the entity supports, and specific feature types of interest, if any (e.g., for the purpose of feature negotiation).</p></li>
  273. </ol>
  274. <p>In order to discover such information, the requesting entity MUST send an IQ stanza of type "get", containing an empty &lt;query/&gt; element qualified by the '' namespace, to the JID of the target entity (a 'node' attribute on the &QUERY; element is OPTIONAL as described in the <link url="#info-nodes">Info Nodes</link> and <link url="#items-nodes">Items Nodes</link> section of this document):</p>
  275. <example caption='Querying for information'><![CDATA[
  276. <iq type='get'
  277. from=''
  278. to='plays.shakespeare.lit'
  279. id='info1'>
  280. <query xmlns=''/>
  281. </iq>
  282. ]]></example>
  283. <p>The target entity then MUST either return an IQ result, or return an error (see the <link url="#errors">Error Conditions</link> section of this document). The result MUST contain a &lt;query/&gt; element qualified by the '' namespace, which in turn contains one or more &lt;identity/&gt; elements and one or more &lt;feature/&gt; elements. (Note: Every entity MUST have at least one identity, and every entity MUST support at least the '' feature; however, an entity is not required to return a result and MAY return an error, most likely &feature; or &unavailable;, although other error conditions may be appropriate.)</p>
  284. <p>Each &lt;identity/&gt; element MUST possess the 'category' and 'type' attributes specifying the category and type for the entity, and MAY possess a 'name' attribute specifying a natural-language name for the entity; the &lt;identity/&gt; element MAY also possess a standard 'xml:lang' attribute, which enables the entity to return localized results if desired (i.e., the &lt;query/&gt; element MAY include multiple &lt;identity/&gt; elements with the same category+type but with different 'xml:lang' values, however the &lt;query/&gt; element MUST NOT include multiple &lt;identity/&gt; elements with the same category+type+xml:lang but with different 'name' values).</p>
  285. <p>Each &lt;feature/&gt; element MUST possess a 'var' attribute whose value is a protocol namespace or other feature offered by the entity, and MUST NOT have any children.</p>
  286. <p>Preferably, both the category/type values and the feature values will be registered in a public registry, as described in the <link url="#registrar">XMPP Registrar Considerations</link> section of this document.</p>
  287. <example caption='Result-set for information request'><![CDATA[
  288. <iq type='result'
  289. from='plays.shakespeare.lit'
  290. to=''
  291. id='info1'>
  292. <query xmlns=''>
  293. <identity
  294. category='conference'
  295. type='text'
  296. name='Play-Specific Chatrooms'/>
  297. <identity
  298. category='directory'
  299. type='chatroom'
  300. name='Play-Specific Chatrooms'/>
  301. <feature var=''/>
  302. <feature var=''/>
  303. <feature var=''/>
  304. <feature var='jabber:iq:register'/>
  305. <feature var='jabber:iq:search'/>
  306. <feature var='jabber:iq:time'/>
  307. <feature var='jabber:iq:version'/>
  308. </query>
  309. </iq>
  310. ]]></example>
  311. <p>If the JID of the specified target entity does not exist, the server or other authoritative entity SHOULD return an &notfound; error, unless doing so would violate the privacy and security considerations specified in <cite>XMPP Core</cite> and &xmppim; or local privacy and security policies (see also the <link url='#security'>Security Considerations</link> of this document):</p>
  312. <example caption='Target entity does not exist'><![CDATA[
  313. <iq type='error'
  314. from='plays.shakespeare.lit'
  315. to=''
  316. id='info1'>
  317. <query xmlns=''/>
  318. <error type='cancel'>
  319. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  320. </error>
  321. </iq>
  322. ]]></example>
  323. <p>If privacy and security considerations or policies prevent the server or other authoritative entity from returning an &notfound; error, it SHOULD return a &unavailable; error instead:</p>
  324. <example caption='Service unavailable'><![CDATA[
  325. <iq type='error'
  326. from='plays.shakespeare.lit'
  327. to=''
  328. id='info1'>
  329. <query xmlns=''/>
  330. <error type='cancel'>
  331. <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  332. </error>
  333. </iq>
  334. ]]></example>
  335. <p>When an entity sends a disco#info request to a bare JID (&lt;account@domain.tld&gt;) hosted by a server, the server itself MUST reply on behalf of the hosted account, either with an IQ-error or an IQ-result. For important rules regarding access to this functionality, see the <link url='#security'>Security Considerations</link> section of this document. In particular, in response to a disco#info request sent to a bare JID with no node, if access is not denied the server SHOULD return an IQ-result for the bare JID, in which the primary identity SHOULD have a category of "account" with an appropriate type as specified in the Service Discovery Identities registry (most likely, a type of "registered"). Note: This enables authorized or trusted entities to discover whether the account exists and its account type (e.g., in IM systems to determine the existence of an account before adding it to a contact's roster).</p>
  336. <example caption='Requesting info from a bare JID'><![CDATA[
  337. <iq type='get'
  338. from='shakespeare.lit'
  339. to=''
  340. id='info2'>
  341. <query xmlns=''/>
  342. </iq>
  343. ]]></example>
  344. <p>Here we assume that shakespeare.lit is trusted by and that the account &lt;; is a registered account:</p>
  345. <example caption='Server replies on behalf of bare JID'><![CDATA[
  346. <iq type='result'
  347. from=''
  348. to='shakespeare.lit'
  349. id='info2'>
  350. <query xmlns=''>
  351. <identity category='account' type='registered'/>
  352. <feature var=''/>
  353. </query>
  354. </iq>
  355. ]]></example>
  356. <p>A query sent to an associated entity may result in different or more detailed information. One example is sending a query to a particular conference room rather than the parent conference service:</p>
  357. <example caption='Querying a specific conference room'><![CDATA[
  358. <iq type='get'
  359. from=''
  360. to='balconyscene@plays.shakespeare.lit'
  361. id='info3'>
  362. <query xmlns=''/>
  363. </iq>
  364. <iq type='result'
  365. from='balconyscene@plays.shakespeare.lit'
  366. to=''
  367. id='info3'>
  368. <query xmlns=''>
  369. <identity
  370. category='conference'
  371. name='A Dark Cave'
  372. type='text'/>
  373. <feature var=''/>
  374. <feature var=''/>
  375. <feature var='muc_passwordprotected'/>
  376. <feature var='muc_hidden'/>
  377. <feature var='muc_temporary'/>
  378. <feature var='muc_open'/>
  379. <feature var='muc_unmoderated'/>
  380. <feature var='muc_nonanonymous'/>
  381. </query>
  382. </iq>]]></example>
  383. <p>Another example of this is sending a query to a specific connected resource for an IM user:</p>
  384. <example caption='Querying a connected resource for further information'><![CDATA[
  385. <iq type='get'
  386. from=''
  387. to=''
  388. id='info4'>
  389. <query xmlns=''/>
  390. </iq>
  391. <iq type='result'
  392. from=''
  393. to=''
  394. id='info4'>
  395. <query xmlns=''>
  396. <identity
  397. category='client'
  398. type='pc'
  399. name='Gabber'/>
  400. <feature var=''/>
  401. <feature var='jabber:iq:time'/>
  402. <feature var='jabber:iq:version'/>
  403. </query>
  404. </iq>
  405. ]]></example>
  406. </section2>
  407. <section2 topic='Info Nodes' anchor='info-nodes'>
  408. <p>A disco#info query MAY also be directed to a specific node identifier associated with a JID, although the primary use of nodes is as <link url='#items-nodes'>Items Nodes</link> rather than as info nodes:</p>
  409. <example caption='Querying a specific JID and node combination'><![CDATA[
  410. <iq type='get'
  411. from=''
  412. to='mim.shakespeare.lit'
  413. id='info3'>
  414. <query xmlns=''
  415. node=''/>
  416. </iq>
  417. ]]></example>
  418. <p>If the request included a 'node' attribute, the response MUST mirror the specified 'node' attribute to ensure coherence between the request and the response.</p>
  419. <example caption='JID+node result'><![CDATA[
  420. <iq type='result'
  421. from='mim.shakespeare.lit'
  422. to=''
  423. id='info3'>
  424. <query xmlns=''
  425. node=''>
  426. <identity
  427. category='automation'
  428. type='command-list'/>
  429. <feature var=''/>
  430. </query>
  431. </iq>
  432. ]]></example>
  433. </section2>
  434. </section1>
  435. <section1 topic='Discovering the Items Associated with a Jabber Entity' anchor='items'>
  436. <section2 topic='Basic Protocol' anchor='items-basic'>
  437. <p>In order for the requesting entity to discover the items associated with a Jabber Entity, it MUST send an IQ stanza of type "get" to the target entity, containing an empty &lt;query/&gt; element qualified by the '' namespace:</p>
  438. <example caption='Requesting all items'><![CDATA[
  439. <iq type='get'
  440. from=''
  441. to='shakespeare.lit'
  442. id='items1'>
  443. <query xmlns=''/>
  444. </iq>
  445. ]]></example>
  446. <p>The target entity then MUST either return its list of publicly-available items, or return an error. The list of items MUST be provided in an IQ stanza of type "result", with each item specified by means of an &lt;item/&gt; child of a &lt;query/&gt; element qualified by the '' namespace (the &lt;item/&gt; child MUST possess a 'jid' attribute specifying the JID of the item and MAY possess a 'name' attribute specifying a natural-language name for the item):</p>
  447. <example caption='Result-set for all items'><![CDATA[
  448. <iq type='result'
  449. from='shakespeare.lit'
  450. to=''
  451. id='items1'>
  452. <query xmlns=''>
  453. <item jid='people.shakespeare.lit'
  454. name='Directory of Characters'/>
  455. <item jid='plays.shakespeare.lit'
  456. name='Play-Specific Chatrooms'/>
  457. <item jid='mim.shakespeare.lit'
  458. name='Gateway to Marlowe IM'/>
  459. <item jid='words.shakespeare.lit'
  460. name='Shakespearean Lexicon'/>
  461. <item jid='globe.shakespeare.lit'
  462. name='Calendar of Performances'/>
  463. <item jid='headlines.shakespeare.lit'
  464. name='Latest Shakespearean News'/>
  465. <item jid='catalog.shakespeare.lit'
  466. name='Buy Shakespeare Stuff!'/>
  467. <item jid='en2fr.shakespeare.lit'
  468. name='French Translation Service'/>
  469. </query>
  470. </iq>
  471. ]]></example>
  472. <p>The &lt;item/&gt; element MUST NOT contain XML character data and SHOULD be empty; while it MAY contain XML data in another namespace, such data MUST be ignored if an implementation does not understand it.</p>
  473. <p>If there are no items associated with an entity (or if those items are not publicly available), the target entity MUST return an empty query element to the requesting entity:</p>
  474. <example caption='Empty result set'><![CDATA[
  475. <iq type='result'
  476. from='shakespeare.lit'
  477. to=''
  478. id='items1'>
  479. <query xmlns=''/>
  480. </iq>
  481. ]]></example>
  482. <p>As with disco#info requests, when an entity sends a disco#items request to a bare JID (&lt;account@domain.tld&gt;) hosted by a server, the server itself MUST reply on behalf of the hosted account. For important rules regarding access to this functionality, see the <link url='#security'>Security Considerations</link> section of this document. In particular, in response to a disco#items request sent to a bare JID with no node, if access is not denied the server SHOULD return the associated items including connected or available resources as appropriate:</p>
  483. <example caption='Requesting items from a bare JID'><![CDATA[
  484. <iq type='get'
  485. from='shakespeare.lit'
  486. to=''
  487. id='items2'>
  488. <query xmlns=''/>
  489. </iq>
  490. ]]></example>
  491. <p>Here we assume that shakespeare.lit is trusted by and that the account &lt;; has two available resources:</p>
  492. <example caption='Server replies on behalf of bare JID'><![CDATA[
  493. <iq type='result'
  494. from=''
  495. to='shakespeare.lit'
  496. id='items2'>
  497. <query xmlns=''>
  498. <item jid=''/>
  499. <item jid=''/>
  500. </query>
  501. </iq>
  502. ]]></example>
  503. </section2>
  504. <section2 topic='Items Nodes' anchor='items-nodes'>
  505. <p>It is possible that an item associated with an entity will not be addressable as a JID; examples might include offline messages stored in an inbox (see &xep0013;), entries in a Jabber-enabled weblog, XML-RPC services associated with a client or component, items available in an online trading system (e.g., a catalog or auction), news postings located at an NNTP gateway, and topics hosted by a &xep0060; component. In order to handle such items, the &lt;item/&gt; element MAY possess an OPTIONAL 'node' attribute that supplements the REQUIRED 'jid' attribute.</p>
  506. <p>The value of the node attribute may or may not have semantic meaning; from the perspective of Service Discovery, a node is merely something that is associated with an entity. In order to discover more about the node, the requesting entity MUST query the entity's JID while specifying the node. If the value of the 'node' attribute has semantic meaning, that meaning is provided by the "using protocol" or application, not by the Service Discovery protocol. A node attribute SHOULD NOT be included unless it is necessary to provide or discover information about an entity that cannot be directly addressed as a JID (i.e., if the associated item can be addressed as a JID, do not include a node). The value of the 'node' attribute MUST NOT be null.</p>
  507. <p>In the following example, a user requests all available items from an online catalog service:</p>
  508. <example caption='Requesting nodes'><![CDATA[
  509. <iq type='get'
  510. from=''
  511. to='catalog.shakespeare.lit'
  512. id='items2'>
  513. <query xmlns=''/>
  514. </iq>
  515. ]]></example>
  516. <p>If there are items associated with the target entity but they are not addressable as JIDs, the service SHOULD then return a list of nodes (where each &lt;item/&gt; element MUST possess a 'jid' attribute, SHOULD possess a 'node' attribute, and MAY possess a 'name' attribute):</p>
  517. <example caption='Service returns nodes'><![CDATA[
  518. <iq type='result'
  519. from='catalog.shakespeare.lit'
  520. to=''
  521. id='items2'>
  522. <query xmlns=''>
  523. <item jid='catalog.shakespeare.lit'
  524. node='books'
  525. name='Books by and about Shakespeare'/>
  526. <item jid='catalog.shakespeare.lit'
  527. node='clothing'
  528. name='Wear your literary taste with pride'/>
  529. <item jid='catalog.shakespeare.lit'
  530. node='music'
  531. name='Music from the time of Shakespeare'/>
  532. </query>
  533. </iq>
  534. ]]></example>
  535. <p>There may be futher nodes associated with the "first-level" nodes returned in the above query (e.g., the nodes may be categories that have associated items). The requesting entity can query a node further by sending a request to the JID and specifying the node of interest in the query.</p>
  536. <example caption='Requesting further nodes'><![CDATA[
  537. <iq type='get'
  538. from=''
  539. to='catalog.shakespeare.lit'
  540. id='items3'>
  541. <query xmlns=''
  542. node='music'/>
  543. </iq>
  544. ]]></example>
  545. <p>The service then returns the further nodes associated with the "parent" node. In the following example, the service itself enforces an alphabetically-ordered hierarchical structure on the nodes that are returned, but such a structure is a matter of implementation rather than protocol.</p>
  546. <example caption='Service returns further nodes'><![CDATA[
  547. <iq type='result'
  548. from='catalog.shakespeare.lit'
  549. to=''
  550. id='items3'>
  551. <query xmlns=''
  552. node='music'>
  553. <item jid='catalog.shakespeare.lit'
  554. node='music/A'/>
  555. <item jid='catalog.shakespeare.lit'
  556. node='music/B'/>
  557. <item jid='catalog.shakespeare.lit'
  558. node='music/C'/>
  559. <item jid='catalog.shakespeare.lit'
  560. node='music/D'/>
  561. .
  562. .
  563. .
  564. </query>
  565. </iq>
  566. ]]></example>
  567. <p>The requesting entity can then query further if desired:</p>
  568. <example caption='Requesting even more nodes'><![CDATA[
  569. <iq type='get'
  570. from=''
  571. to='catalog.shakespeare.lit'
  572. id='items4'>
  573. <query xmlns=''
  574. node='music/D'/>
  575. </iq>
  576. ]]></example>
  577. <example caption='Service returns even more nodes'><![CDATA[
  578. <iq type='result'
  579. from='catalog.shakespeare.lit'
  580. to=''
  581. id='items4'>
  582. <query xmlns=''
  583. node='music/D'>
  584. <item jid='catalog.shakespeare.lit'
  585. node='music/D/dowland-firstbooke'
  586. name='John Dowland - First Booke of Songes or Ayres'/>
  587. <item jid='catalog.shakespeare.lit'
  588. node='music/D/dowland-solace'
  589. name='John Dowland - A Pilgrimes Solace'/>
  590. </query>
  591. </iq>
  592. ]]></example>
  593. </section2>
  594. <section2 topic='Node Hierarchies' anchor='items-hierarchy'>
  595. <p>The foregoing examples show a hierarchy of nodes, in which some nodes are branches (i.e., contain further nodes) and some nodes are leaves (i.e., do not contain further nodes). The "hierarchy" category SHOULD be used to identify such nodes, where the "branch" and "leaf" types are exhaustive of the types within this category.</p>
  596. <p>If the hierarchy category is used, every node in the hierarchy MUST be identified as either a branch or a leaf; however, since a node MAY have multiple identities, any given node MAY also possess an identity other than "hierarchy/branch" or "hierarchy/leaf".</p>
  597. <p>Therefore, a disco#info request to the "music/D" node shown above would yield &lt;identity category='hierarchy' type='branch'/&gt; while a disco#info request to the "music/D/dowland-firstbooke" node would yield &lt;identity category='hierarchy' type='leaf'/&gt; (and each node could yield additional identities as appropriate).</p>
  598. </section2>
  599. <section2 topic='Relationship Between an Entity and its Items' anchor='items-relationship'>
  600. <p>This section explains in greater detail the relationship between an entity and its associated items.</p>
  601. <p>In general, the items returned by an entity in a disco#items result MUST be items over which the entity has some relationship of ownership -- either direct control over the item itself (e.g., <cite>Publish-Subscribe</cite> nodes owned by the entity) or at least the ability to provide or vouch for the item in a canonical way on the Jabber network (e.g., groupchat rooms directly hosted by a multi-user chat service or IRC channels to which a gateway provides access).</p>
  602. <p>Such a relationship does not constrain the relationship between the owning entity's address and the address of the associated entity. In particular, any of the following scenarios is perfectly acceptable:</p>
  603. <ol>
  604. <li><p>Upon querying an entity (JID1) for items, one receives a list of items that can be addressed as JIDs; each associated item has its own JID, but no such JID equals JID1.</p></li>
  605. <li><p>Upon querying an entity (JID1) for items, one receives a list of items that cannot be addressed as JIDs; each associated item has its own JID+node, where each JID equals JID1 and each NodeID is unique.</p></li>
  606. <li><p>Upon querying an entity (JID1+NodeID1) for items, one receives a list of items that can be addressed as JIDs; each associated item has its own JID, but no such JID equals JID1.</p></li>
  607. <li><p>Upon querying an entity (JID1+NodeID1) for items, one receives a list of items that cannot be addressed as JIDs; each associated item has its own JID+node, but no such JID+node equals JID1+NodeID1 and each NodeID is unique in the context of the associated JID.</p></li>
  608. </ol>
  609. <p>In addition, the results MAY also be mixed, so that a query to a JID or a JID+node could yield both (1) items that are addressed as JIDs and (2) items that are addressed as JID+node combinations.</p>
  610. <p>Consider the case of an entity that owns multiple publish-subscribe nodes -- for example, a person who owns one such node for each of his music players. The following examples show what the disco#items query and result might look like (using the protocol defined in &xep0118;):</p>
  611. <example caption='User queries entity regarding tunes'><![CDATA[
  612. <iq from=''
  613. id='items4'
  614. to=''
  615. type='get'>
  616. <query xmlns=''
  617. node=''/>
  618. </iq>
  619. ]]></example>
  620. <p>The queried entity now returns a list of publish-subscribe nodes over which it has control, each of which is hosted on a different pubsub service:</p>
  621. <example caption='Entity returns multiple items'><![CDATA[
  622. <iq from=''
  623. id='items4'
  624. to=''
  625. type='result'>
  626. <query xmlns=''
  627. node=''>
  628. <item jid='pubsub.shakespeare.lit'
  629. name='Romeo&apos;s CD player'
  630. node='s623nms9s3bfh8js'/>
  631. <item jid=''
  632. node='music/R/Romeo/iPod'/>
  633. <item jid='tunes.characters.lit'
  634. node='g8k4kds9sd89djf3'/>
  635. </query>
  636. </iq>
  637. ]]></example>
  638. </section2>
  639. </section1>
  640. <section1 topic='Publishing Available Items' anchor='publish'>
  641. <p>This feature has been removed in favor of the XMPP publish-subscribe technology defined in <cite>XEP-0060</cite>.</p>
  642. </section1>
  643. <section1 topic='Implementation Notes' anchor='impl'>
  644. <section2 topic='Number of Info Requests' anchor='impl-info'>
  645. <p>When the requesting application is a client, it may want to retrieve service discovery information about all of a user's contacts after retrieving the user's roster and receiving presence from contacts in the user's roster (e.g., to show capabilities). Unfortunately, a user's roster can be quite large, resulting in sending a large number of outbound disco#info requests and receiving a large number of inbound disco#info responses upon login. Because this "disco flood" is undesirable for reasons of scalability and bandwidth usage, client applications SHOULD use &xep0115; to determine the capabilities of entities from which they receive presence information and SHOULD NOT send disco#info requests to such entities.</p>
  646. </section2>
  647. <section2 topic='Number of Items Requests' anchor='impl-items'>
  648. <p>In order to retrieve full information about an entity and its associated items, the requesting application needs to "walk the tree" of items. Naturally, this can result in a large number of requests and responses. The requesting application SHOULD NOT send follow-up requests to all items associated with an entity if the list of such items is long (e.g., more than twenty items). Entities that will routinely host a large number of items (e.g., IRC gateways or NNTP services) SHOULD structure nodes into hierarchies and/or provide more robust searching capabilities, for example via &xep0055;; they SHOULD NOT return extremely large result sets via Service Discovery.</p>
  649. </section2>
  650. <section2 topic='Response Consistency' anchor='impl-consistency'>
  651. <p>This document recommends but does not require that a responding entity must return the same results in response to the same request from different requesting entities (e.g., an entity could return a different list of items or features based on the degree to which it trusts the requesting entity, or based on the known capabilities of the requesting entity). However, the responding entity SHOULD return the same &lt;identity/&gt; element (category+type) to all disco#info requests sent to the same JID+node combination.</p>
  652. </section2>
  653. </section1>
  654. <section1 topic='Error Conditions' anchor='errors'>
  655. <p>If a specific entity (JID or JID+node) does not support the disco namespace, refuses to return disco results to the specific requesting entity, or refuses to return disco results to any requesting entity, it SHOULD return an appropriate error message (such as &unavailable;, &forbidden;, or &notallowed;, respectively). One example is shown below.</p>
  656. <example caption='JID+node error'><![CDATA[
  657. <iq type='error'
  658. from='mim.shakespeare.lit'
  659. to=''
  660. id='info3'>
  661. <query xmlns=''
  662. node=''/>
  663. <error type='cancel'>
  664. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  665. </error>
  666. </iq>
  667. ]]></example>
  668. <p>Other error conditions may be appropriate depending on the application.</p>
  669. <p>The following table summarizes the common error conditions that can have special meaning in the context of Service Discovery (for information regarding error condition syntax and semantics, see &xep0086;).</p>
  670. <table caption='Error Conditions'>
  671. <tr>
  672. <th>Condition</th>
  673. <th>Cause</th>
  674. </tr>
  675. <tr>
  676. <td>&notfound;</td>
  677. <td>The JID or JID+NodeID of the specified target entity does not exist and that fact can be divulged in accordance with privacy and security considerations and policies.</td>
  678. </tr>
  679. <tr>
  680. <td>&unavailable;</td>
  681. <td>The target entity does not support this protocol, or the specified target entity does not exist but that fact cannot be divulged because of privacy and security considerations.</td>
  682. </tr>
  683. </table>
  684. <p>The other error conditions specified in <cite>XMPP Core</cite> MAY be returned as well (&forbidden;, &notallowed;, &notauthorized;, etc.), including application-specific conditions.</p>
  685. <p>As noted above, if an entity has no associated items, it MUST return an empty &QUERY; element (rather than an error) in response to a disco#items request.</p>
  686. </section1>
  687. <section1 topic='Security Considerations' anchor='security'>
  688. <p>Certain attacks may be made easier when an entity discloses (via disco#info responses) that it supports particular protocols or features; however, in general, service discovery introduces no new vulnerabilities, since a malicious entity could discover that the responding entity supports such protocols and features by sending requests specific to those protocols rather than by sending service discovery requests.</p>
  689. <p>A responding entity is under no obligation to return the identical service discovery response when replying to service discovery requests received from different requesting entities, and MAY perform authorization checks before responding in order to determine how (or whether) to respond.</p>
  690. <p>A server MUST carefully control access to any functionality that would enable directory harvesting attacks or that would leak information about connected or available resources; this functionality consists of the server's replies to disco#info and disco#items requests sent to bare JIDs (addresses of the form account@domain.tld) hosted on the server, since the server responds to such requests on behalf of the account. The following rules apply to the handling of service discovery requests sent to bare JIDs:</p>
  691. <ol>
  692. <li>
  693. <p>In response to a disco#info request, the server MUST return a &unavailable; error if one of the following is true:</p>
  694. <ol>
  695. <li>The target entity does not exist (no matter if the request specifies a node or not).</li>
  696. <li>The requesting entity is not authorized to receive presence from the target entity (i.e., via the target having a presence subscription to the requesting entity of type "both" or "from") or is not otherwise trusted (e.g., another server in a trusted network).</li>
  697. </ol>
  698. </li>
  699. <li>
  700. <p>In response to a disco#items request, the server MUST return an empty result set if:</p>
  701. <ol>
  702. <li>The target entity does not exist (no matter if the request specifies a node or not).</li>
  703. <li>The request did not specify a node, the only items are available resources (as defined in <cite>RFC 3921</cite>), and the requesting entity is not authorized to receive presence from the target entity (i.e., via the target having a presence subscription to the requesting entity of type "both" or "from") or is not otherwise trusted (e.g., another server in a trusted network). <note>However, the server MAY return items other than available resources (if any).</note></li>
  704. </ol>
  705. </li>
  706. </ol>
  707. </section1>
  708. <section1 topic='IANA Considerations' anchor='iana'>
  709. <p>This document requires no interaction with &IANA;.</p>
  710. </section1>
  711. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  712. <section2 topic='Protocol Namespaces' anchor='registrar-protocol'>
  713. <p>The &REGISTRAR; includes the '' and '' namespaces in its registry of protocol namespaces.</p>
  714. </section2>
  715. <section2 topic='Registries' anchor='registrar-reg'>
  716. <section3 topic='Identity Categories and Types Registry' anchor='registrar-reg-identity'>
  717. <p>The XMPP Registrar maintains a registry of values for the 'category' and 'type' attributes of the &lt;identity/&gt; element in the '' namespace; see &DISCOCATEGORIES;.</p>
  718. <section4 topic='Process' anchor='registrar-identity'>
  720. <code><![CDATA[
  721. <category>
  722. <name>the name of the category (all lower-case)</name>
  723. <desc>a natural-language description of the category</desc>
  724. <type>
  725. <name>the name of the specific type (all lower-case)</name>
  726. <desc>a natural-language description of the type</desc>
  727. <doc>the document (e.g., XEP) in which this type is specified</doc>
  728. </type>
  729. </category>
  730. ]]></code>
  731. <p>The registrant may register more than one category at a time, each contained in a separate &lt;category/&gt; element. The registrant may also register more than one type at a time, each contained in a separate &lt;type/&gt; child element. Registrations of new types within an existing category must include the full XML snippet but should not include the category description (only the name).</p>
  732. </section4>
  733. <section4 topic='Initial Submission' anchor='registrar-reg-identity-init'>
  734. <p>This document defines a "hierarchy" category that contains two and only two types: "branch" and "leaf"; the associated registry submission is as follows:</p>
  735. <code><![CDATA[
  736. <category>
  737. <name>hierarchy</name>
  738. <desc>
  739. An entity that exists in the context of a
  740. service discovery node hierarchy.
  741. </desc>
  742. <type>
  743. <name>branch</name>
  744. <desc>
  745. A "container node" for other entities in a
  746. service discovery node hierarchy.
  747. </desc>
  748. <doc>XEP-0030</doc>
  749. </type>
  750. <type>
  751. <name>leaf</name>
  752. <desc>
  753. A "terminal node" in a service discovery
  754. node hierarchy.
  755. </desc>
  756. <doc>XEP-0030</doc>
  757. </type>
  758. </category>
  759. ]]></code>
  760. </section4>
  761. </section3>
  762. <section3 topic='Features Registry' anchor='registrar-reg-features'>
  763. <p>The XMPP Registrar maintains a registry of features for use as values of the 'var' attribute of the &lt;feature/&gt; element in the '' namespace; see &DISCOFEATURES;.</p>
  764. <section4 topic='Process' anchor='registrar-reg-features-process'>
  766. <code><![CDATA[
  767. <var>
  768. <name>name of feature or namespace</name>
  769. <desc>a natural-language description of the feature</desc>
  770. <doc>the document (e.g., XEP) in which this feature is specified</doc>
  771. </var>
  772. ]]></code>
  773. <p>The registrant may register more than one feature at a time, each contained in a separate &lt;feature/&gt; element.</p>
  774. </section4>
  775. </section3>
  776. <section3 topic='Well-Known Nodes' anchor='registrar-reg-nodes'>
  777. <p>A "using protocol" may specify one or more service discovery nodes that have a special and well-defined meaning in the context of that protocol. For the purpose of reserving these node names globally across all Jabber protocols, the XMPP Registrar maintains a registry of well-known service discovery nodes at &NODES;.</p>
  778. <section4 topic='Process' anchor='registrar-reg-nodes-process'>
  780. <code><![CDATA[
  781. <node>
  782. <name>the name of the node</name>
  783. <desc>a natural-language description of the node</desc>
  784. <doc>the document (e.g., XEP) in which this node is specified</doc>
  785. </node>
  786. ]]></code>
  787. <p>The registrant may register more than one node at a time, each contained in a separate &lt;node/&gt; element.</p>
  788. </section4>
  789. </section3>
  790. </section2>
  791. <section2 topic='URI Query Types' anchor='registrar-querytypes'>
  792. <p>As authorized by &xep0147;, the XMPP Registrar maintains a registry of queries and key-value pairs for use in XMPP URIs (see &QUERYTYPES;).</p>
  793. <p>The "disco" querytype is defined herein for service discovery interactions, with three keys: (1) "node" (the optional node to query), (2) "request" (with values of "info" to retrieve service discovery information and "items" to retrieve service discovery items), and (3) "type" (with values of "get" for IQ-gets and "set" for IQ-sets).</p>
  794. <example caption='Service Discovery Information Request: IRI/URI'><![CDATA[
  796. ]]></example>
  797. <example caption='Service Discovery Information Request: Resulting Stanza'><![CDATA[
  798. <iq to='' type='get'>
  799. <query xmlns=''/>
  800. </iq>
  801. ]]></example>
  802. <example caption='Service Discovery Items Request: IRI/URI'><![CDATA[
  804. ]]></example>
  805. <example caption='Service Discovery Items Request: Resulting Stanza'><![CDATA[
  806. <iq to='' type='get'>
  807. <query xmlns=''/>
  808. </iq>
  809. ]]></example>
  810. <p>The following submission registers the "disco" querytype.</p>
  811. <code><![CDATA[
  812. <querytype>
  813. <name>disco</name>
  814. <proto></proto>
  815. <desc>enables interaction for the purpose of service discovery</desc>
  816. <doc>XEP-0030</doc>
  817. <keys>
  818. <key>
  819. <name>node</name>
  820. <desc>the (optional) service discovery node</desc>
  821. </key>
  822. <key>
  823. <name>request</name>
  824. <desc>the service discovery request type</desc>
  825. <values>
  826. <value>
  827. <name>info</name>
  828. <desc>a service discovery information (disco#info) request</desc>
  829. </value>
  830. <value>
  831. <name>items</name>
  832. <desc>a service discovery items (disco#items) request</desc>
  833. </value>
  834. </values>
  835. </key>
  836. <key>
  837. <name>type</name>
  838. <desc>the IQ type</desc>
  839. <values>
  840. <value>
  841. <name>get</name>
  842. <desc>an IQ get</desc>
  843. </value>
  844. </values>
  845. </key>
  846. </keys>
  847. </querytype>
  848. ]]></code>
  849. </section2>
  850. </section1>
  851. <section1 topic='XML Schemas' anchor='schemas'>
  852. <section2 topic='disco#info' anchor='schemas-info'>
  853. <code><![CDATA[
  854. <?xml version='1.0' encoding='UTF-8' ?>
  855. <xs:schema
  856. xmlns:xs=''
  857. targetNamespace=''
  858. xmlns=''
  859. elementFormDefault='qualified'>
  860. <xs:annotation>
  861. <xs:documentation>
  862. The protocol documented by this schema is defined in
  863. XEP-0030:
  864. </xs:documentation>
  865. </xs:annotation>
  866. <xs:element name='query'>
  867. <xs:complexType>
  868. <xs:sequence minOccurs='0'>
  869. <xs:choice>
  870. <xs:sequence>
  871. <xs:element ref='feature' maxOccurs='unbounded'/>
  872. <xs:element ref='identity'/>
  873. </xs:sequence>
  874. <xs:sequence>
  875. <xs:element ref='identity' maxOccurs='unbounded'/>
  876. <xs:element ref='feature'/>
  877. </xs:sequence>
  878. </xs:choice>
  879. <xs:choice minOccurs='0' maxOccurs='unbounded'>
  880. <xs:element ref='identity'/>
  881. <xs:element ref='feature'/>
  882. </xs:choice>
  883. </xs:sequence>
  884. <xs:attribute name='node' type='xs:string' use='optional'/>
  885. </xs:complexType>
  886. </xs:element>
  887. <xs:element name='identity'>
  888. <xs:complexType>
  889. <xs:simpleContent>
  890. <xs:extension base='empty'>
  891. <xs:attribute name='category' type='nonEmptyString' use='required'/>
  892. <xs:attribute name='name' type='xs:string' use='optional'/>
  893. <xs:attribute name='type' type='nonEmptyString' use='required'/>
  894. </xs:extension>
  895. </xs:simpleContent>
  896. </xs:complexType>
  897. </xs:element>
  898. <xs:element name='feature'>
  899. <xs:complexType>
  900. <xs:simpleContent>
  901. <xs:extension base='empty'>
  902. <xs:attribute name='var' type='xs:string' use='required'/>
  903. </xs:extension>
  904. </xs:simpleContent>
  905. </xs:complexType>
  906. </xs:element>
  907. <xs:simpleType name='nonEmptyString'>
  908. <xs:restriction base='xs:string'>
  909. <xs:minLength value='1'/>
  910. </xs:restriction>
  911. </xs:simpleType>
  912. <xs:simpleType name='empty'>
  913. <xs:restriction base='xs:string'>
  914. <xs:enumeration value=''/>
  915. </xs:restriction>
  916. </xs:simpleType>
  917. </xs:schema>
  918. ]]></code>
  919. </section2>
  920. <section2 topic='disco#items' anchor='schemas-items'>
  921. <code><![CDATA[
  922. <?xml version='1.0' encoding='UTF-8' ?>
  923. <xs:schema
  924. xmlns:xs=''
  925. targetNamespace=''
  926. xmlns=''
  927. elementFormDefault='qualified'>
  928. <xs:annotation>
  929. <xs:documentation>
  930. The protocol documented by this schema is defined in
  931. XEP-0030:
  932. </xs:documentation>
  933. </xs:annotation>
  934. <xs:element name='query'>
  935. <xs:complexType>
  936. <xs:sequence minOccurs='0'>
  937. <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
  938. </xs:sequence>
  939. <xs:attribute name='node' type='xs:string' use='optional'/>
  940. </xs:complexType>
  941. </xs:element>
  942. <xs:element name='item'>
  943. <xs:complexType>
  944. <xs:simpleContent>
  945. <xs:extension base='empty'>
  946. <xs:attribute name='jid' type='fullJIDType' use='required'/>
  947. <xs:attribute name='name' type='xs:string' use='optional'/>
  948. <xs:attribute name='node' type='xs:string' use='optional'/>
  949. </xs:extension>
  950. </xs:simpleContent>
  951. </xs:complexType>
  952. </xs:element>
  953. <xs:simpleType name='fullJIDType'>
  954. <xs:restriction base='xs:string'>
  955. <xs:minLength value='8'/>
  956. <xs:maxLength value='3071'/>
  957. </xs:restriction>
  958. </xs:simpleType>
  959. <xs:simpleType name='empty'>
  960. <xs:restriction base='xs:string'>
  961. <xs:enumeration value=''/>
  962. </xs:restriction>
  963. </xs:simpleType>
  964. </xs:schema>
  965. ]]></code>
  966. </section2>
  967. </section1>
  968. <section1 topic='Author Note' anchor='authornote'>
  969. <p>Peter Millard, a co-author of this specification from version 0.1 through version 2.2, died on April 26, 2006.</p>
  970. </section1>
  971. </xep>