<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep xmlns="">
<header>
  <title>Hats</title>
  <abstract>This specification defines a more extensible model for roles and affiliations in Multi-User Chat rooms.</abstract>
  
<legal>
<copyright>This XMPP Extension Protocol is copyright © 1999 – 2024 by the <link url="https://xmpp.org/">XMPP Standards Foundation</link> (XSF).</copyright>
<permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.</permissions>
<warranty>## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##</warranty>
<liability>In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.</liability>
<conformance>This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at &lt;<link url="https://xmpp.org/about/xsf/ipr-policy">https://xmpp.org/about/xsf/ipr-policy</link>&gt; or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).</conformance>
</legal>
  <number>0317</number>
  <status>Experimental</status>
  <type>Standards Track</type>
  <sig>Standards</sig>
  <approver>Council</approver>
  <dependencies>
    <spec>XMPP Core</spec>
    <spec>XEP-0045</spec>
    <spec>XEP-0068</spec>
    <spec>XEP-0050</spec>
  </dependencies>
  <supersedes/>
  <supersededby/>
  <shortname>NOT_YET_ASSIGNED</shortname>
  
  <author>
    <firstname>Peter</firstname>
    <surname>Saint-Andre</surname>
    <email>stpeter@stpeter.im</email>
    <jid>stpeter@jabber.org</jid>
    <uri>https://stpeter.im/</uri>
  </author>

  
  <author>
    <firstname>Matthew</firstname>
    <surname>Wild</surname>
    <email>mwild1@gmail.com</email>
    <jid>me@matthewwild.co.uk</jid>
  </author>

  
  <author>
    <firstname>Timothée</firstname>
    <surname>Jaussoin</surname>
    <email>edhelas@movim.eu</email>
    <jid>edhelas@movim.eu</jid>
    <uri>https://edhelas.movim.eu</uri>
  </author>

  <revision>
    <version>0.3.1</version>
    <date>2025-08-18</date>
    <initials>tj</initials>
    <remark><p>Typos, completed some examples and paragraph clarifications thanks to badlop feedback.</p></remark>
  </revision>
  <revision>
    <version>0.3.0</version>
    <date>2025-04-30</date>
    <initials>tj</initials>
    <remark><p>Add hat creation and detruction flows; add hue optional parameter; add chatroom presence hats broadcast; complete disco#info; clarify how the service should broadcast updated hats; typos; standardize the form fields;</p></remark>
  </revision>
  <revision>
    <version>0.2.0</version>
    <date>2023-06-28</date>
    <initials>mw</initials>
    <remark><p>Select a syntax for hats.</p></remark>
  </revision>
  <revision>
    <version>0.1</version>
    <date>2013-01-03</date>
    <initials>psa</initials>
    <remark><p>Initial published version approved for publication by the XMPP Council; clarified ad-hoc commands logic and syntax.</p></remark>
  </revision>
  <revision>
    <version>0.0.2</version>
    <date>2012-12-09</date>
    <initials>psa</initials>
    <remark><p>Described use of ad-hoc commands for adding and removing hats.</p></remark>
  </revision>
  <revision>
    <version>0.0.1</version>
    <date>2012-12-06</date>
    <initials>psa</initials>
    <remark><p>First draft.</p></remark>
  </revision>
</header>

<section1 topic="Introduction" anchor="intro">
  <p><span class="ref"><link url="https://xmpp.org/extensions/xep-0045.html">Multi-User Chat (XEP-0045)</link></span> <note>XEP-0045: Multi-User Chat &lt;<link url="https://xmpp.org/extensions/xep-0045.html">https://xmpp.org/extensions/xep-0045.html</link>&gt;.</note> defines a widely-implemented XMPP extension for chatrooms, including basic roles and affiliations such as owner, administrator, and moderator. However, in many scenarios it is desirable to define different roles that are appropriate for the relevant application. Examples might include a "presenter" or a "scribe" in an online meeting system, a "representative" or a "manager" in a customer service application, a "comms officer" in a military chat system, an "incident manager" in a first responder system, a "teacher" or a "teacher's assistant" in an online classroom, specialized roles in online games, etc. To prevent confusion with standard MUC roles, these extended roles are call "hats", since a participant can "wear many hats" in a room.</p>
</section1>

<section1 topic="Discovery" anchor="disco">
  <p>A room in a MUC service that supports hats MUST advertise a <span class="ref"><link url="https://xmpp.org/extensions/xep-0030.html">Service Discovery (XEP-0030)</link></span> <note>XEP-0030: Service Discovery &lt;<link url="https://xmpp.org/extensions/xep-0030.html">https://xmpp.org/extensions/xep-0030.html</link>&gt;.</note> feature of "urn:xmpp:hats:0" to the requesting entity.</p>

  <p>The "hat list" and all associated commands are OPTIONAL. Some of the commands might be restricted by some business logic or internal rules (such as a LDAP configuration where the hats are already preconfigured).</p>

  <p>If the room has a list of hats configured, it should advertise it in its 'muc#roominfo' extension form by computing a unique hash based on the list of hats URIs provided. The way the hash is computed is left to the implementer.</p>

  <example caption="User’s client discovers the hat features of a MUC room"><![CDATA[
<iq from='professor@example.edu/office'
    id='p87Ne'
    to='physicsforpoets@courses.example.edu'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>]]></example>
    <example caption="Room advertises hats support"><![CDATA[
<iq from='physicsforpoets@courses.example.edu'
    id='p87Ne'
    to='professor@example.edu/office'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <identity
        category='conference'
        type='text'
        name='Shakespearean Chat Service'/>
    <feature var='urn:xmpp:hats:0'/>
    <x xmlns='jabber:x:data' type='result'>
      <field var='FORM_TYPE' type='hidden'>
        <value>http://jabber.org/protocol/muc#roominfo</value>
      </field>
      ...
      <field var='hats#hash'
             type='text-single'
             label='Hats hash'>
        <value>d0f8d96ef806c440d4d2bce0bb56244540fd292f</value>
      </field>
      ...
    </x>
    ...
  </query>
</iq>]]></example>

<p>If the requesting entity detects that, based on a mismatching hash, the localy stored hats list is considered outdated.</p>

</section1>

<section1 topic="Protocol" anchor="protocol">
  <section2 topic="Hats in Presence" anchor="presence">
    <p>MUC already includes a way for the room to signal the roles and affiliations of room occupants. Hats are signalled in a similar way. A participant can wear many hats. The following example shows a participant who is a MUC room owner and both a "host" and a "presenter" in an online meeting system. This system also demonstrates how hats can be annotated with custom information (here, the example &lt;badge/&gt; element).</p>
    <example caption="Presence With Multiple Hats"><![CDATA[
<presence
    from='meeting123@meetings.example.com/Harry'
    id='D568A74F-E062-407C-83E9-531E91526516'
    to='someone@example.com/foo'>
  <x xmlns='http://jabber.org/protocol/muc#user'>
    <item affiliation='owner' role='moderator'/>
  </x>
  <hats xmlns='urn:xmpp:hats:0'>
    <hat title='Host' uri='http://schemas.example.com/hats#host' hue='327.255249' xml:lang='en-us'>
      <badge xmlns="urn:example:badges" level="3"/>
    </hat>
    <hat title='Presenter' uri='http://schemas.example.com/hats#presenter' hue='171.430664' xml:lang='en-us'>
      <badge xmlns="urn:example:badges" level="5"/>
    </hat>
  </hats>
</presence>
]]></example>
    <p>Every hat is uniquely identified by its URI. Hats also carry a human-readable title for display purposes. Within XMPP, a hat is contained within a &lt;hat/&gt; element in the 'urn:xmpp:hats:0' namespace. This element MUST possess a 'uri' attribute (containing the hat's URI), a 'title' attribute containing the name of the hat for display purposes, MAY contain an 'xml:lang' attribute that identifies the language used in the 'title' attribute and MAY contain a Hue Angle color that define the hat color to apply. The &lt;hat/&gt; element MAY contain additional custom payloads defined by other XEPs, or payloads specific to an implementation or deployment.</p>
    <p>Entities may have multiple hats. The &lt;hats/&gt; element is defined as a container of zero or more &lt;hat/&gt; elements.</p>

  </section2>
  <section2 topic="Creating and Updating a Hat" anchor="create">
    <p>Hats are created and destroyed using <span class="ref"><link url="https://xmpp.org/extensions/xep-0050.html">Ad-Hoc Commands (XEP-0050)</link></span> <note>XEP-0050: Ad-Hoc Commands &lt;<link url="https://xmpp.org/extensions/xep-0050.html">https://xmpp.org/extensions/xep-0050.html</link>&gt;.</note>.</p>
    <p>The following flow shows how to create a hat.</p>
    <p>Updating a hat follows the same flow but set an existing "hats#uri". If a hat is updated the room SHOULD broadcast the related JID presences with the refreshed hat list.</p>
    <example caption="Admin Requests to Create a Hat"><![CDATA[
<iq from='professor@example.edu/office'
    id='gd53a2b6'
    to='physicsforpoets@courses.example.edu'
    type='set'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
            action='execute'
            node='urn:xmpp:hats:commands:create'/>
</iq>
]]></example>

    <example caption="Room Returns Form to Admin"><![CDATA[
<iq from='physicsforpoets@courses.example.edu'
    id='gd53a2b6'
    to='professor@example.edu/office'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
            node='urn:xmpp:hats:commands:create'
            sessionid='A971D19A-2226-4DAD-B261-9D0886B9A026'
            status='executing'>
    <x xmlns='jabber:x:data' type='form'>
      <title>Creating a Hat</title>
      <instructions>Fill out this form to create a hat.</instructions>
      <field type='hidden' var='FORM_TYPE'>
        <value>urn:xmpp:hats:commands</value>
      </field>
      <field var='hats#title'
            type='text-single'
            label='Hat Title'>
        <required/>
      </field>
      <field var='hats#uri'
            type='text-single'
            label='Hat URI'>
        <required/>
      </field>
      <field var='hats#hue'
            type='text-single'
            label='Hat Hue'/>
    </x>
  </command>
</iq>
]]></example>
    <example caption="Admin Submits Form"><![CDATA[
<iq from='professor@example.edu/office'
    id='9fets723'
    to='physicsforpoets@courses.example.edu'
    type='set'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
            node='urn:xmpp:hats:commands:create'
            sessionid='A971D19A-2226-4DAD-B261-9D0886B9A026'>
    <x xmlns='jabber:x:data' type='submit'>
      <field type='hidden' var='FORM_TYPE'>
        <value>urn:xmpp:hats:commands</value>
      </field>
      <field var='hats#title'>
        <value>Assistant</value>
      </field>
      <field var='hats#uri'>
        <value>http://tech.example.edu/hats#TeacherAssistant</value>
      </field>
      <field var='hats#hue'>
        <value>327.255249</value>
      </field>
    </x>
  </command>
</iq>
]]></example>
    <example caption="Room Informs Admin of Completion"><![CDATA[
<iq from='physicsforpoets@courses.example.edu'
    id='9fets723'
    to='professor@example.edu/office'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
            node='urn:xmpp:hats:commands:assign'
            sessionid='A971D19A-2226-4DAD-B261-9D0886B9A026'
            status='completed'/>
</iq>
]]></example>
  <p>When any change is applied to the hats list the room SHOULD broadcast a notification that the configuration changed to all users present.</p>
  <example caption="Room broadcasts a configuration change"><![CDATA[
<message type='groupchat'
      to='professor@example.edu/office'
      from='physicsforpoets@courses.example.edu'>
  <x xmlns='http://jabber.org/protocol/muc#user'>
    <status code='104'/>
  </x>
</message>

<message type='groupchat'
      to='student@example.edu/bedroom'
      from='physicsforpoets@courses.example.edu'>
  <x xmlns='http://jabber.org/protocol/muc#user'>
    <status code='104'/>
  </x>
</message>]]></example>

  </section2>
  <section2 topic="Destroying a Hat" anchor="destroy">
    <p>The following flow shows how to destroy a hat and remove it from the list of available hats.</p>
    <p>It first asks the formulary, which returns a list of all the available hats, and then actually requests to destroy one of them. Notice that alternatively, the client may send directly the query to destroy a hat without first requesting the formulary, as it already knows many hats that were received in presence stanzas.</p>
    <p>When a hat is destroyed, it is automatically removed from all the JIDs where it was assigned.</p>
    <p>The room SHOULD broadcast the related JID presences with the refreshed hats list.</p>
    <example caption="Admin Requests Form to Destroy a Hat"><![CDATA[
<iq from='professor@example.edu/office'
    id='gd53a2b6'
    to='physicsforpoets@courses.example.edu'
    type='set'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
           action='execute'
           node='urn:xmpp:hats:commands:destroy'>
  </command>
</iq>
]]></example>
    <example caption="Room Provides Form to Destroy a Hat"><![CDATA[
<iq from='physicsforpoets@courses.example.edu'
    id='gd53a2b6'
    to='professor@example.edu/office'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
            node='urn:xmpp:hats:commands:destroy'
            sessionid='A971D19A-2226-4DAD-B261-9D0886B9A026'
            status='executing'>
    <x xmlns='jabber:x:data' type='form'>
      <title>Destroying a Hat</title>
      <instructions>Fill out this form to destroy a hat.</instructions>
      <field type='hidden' var='FORM_TYPE'>
        <value>urn:xmpp:hats:commands</value>
      </field>
      <field label='The role'
             type='list-single'
             var='hat'>
        <option label='Teacher'><value>http://tech.example.edu/hats#Teacher</value></option>
        <option label='Teacher&apos;s Assistant'><value>http://tech.example.edu/hats#TeacherAssistant</value></option>
        <option label='Test Proctor'><value>http://tech.example.edu/hats#Proctor</value></option>
      </field>
    </x>
  </command>
</iq>
]]></example>
    <example caption="Admin Requests to Destroy a Hat"><![CDATA[
<iq from='professor@example.edu/office'
    id='rei4n2b0'
    to='physicsforpoets@courses.example.edu'
    type='set'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
           action='execute'
           node='urn:xmpp:hats:commands:destroy'>
    <x xmlns='jabber:x:data' type='submit'>
      <field type='hidden' var='FORM_TYPE'>
        <value>urn:xmpp:hats:commands</value>
      </field>
      <field var='hats#uri'>
        <value>http://tech.example.edu/hats#TeacherAssistant</value>
      </field>
    </x>
  </command>
</iq>
]]></example>
    <example caption="Room Informs Admin of Completion"><![CDATA[
<iq from='physicsforpoets@courses.example.edu'
    id='rei4n2b0'
    to='professor@example.edu/office'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='urn:xmpp:hats:commands:destroy'
           sessionid='A971D19A-2226-4DAD-B261-7D0886B9A123'
           status='completed'/>
</iq>
]]></example>
  </section2>
  <section2 topic="Listing Hats">
    <p>An entity might be interested to get all the existing hats available in a chatroom.</p>
    <example caption="User’s client request the hats list configured on a MUC room"><![CDATA[
<iq from='professor@example.edu/office'
  id='fdi3n2b6'
  to='physicsforpoets@courses.example.edu'
  type='set'
  xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
          action='execute'
          node='urn:xmpp:hats:commands:list'/>
</iq>]]></example>
    <example caption="Room Returns the List of Configured Hats"><![CDATA[
<iq from='physicsforpoets@courses.example.edu'
    id='fdi3n2b6'
    to='professor@example.edu/office'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='urn:xmpp:hats:commands:list'
           status='completed'
           sessionid='A971D19A-2226-4DAD-B261-9D0886B9A026'>
    <x xmlns='jabber:x:data' type='result'>
      <title>Hats List</title>
      <reported>
        <field var='hats#title'/>
        <field var='hats#uri'/>
        <field var='hats#hue'/>
      </reported>
      <item>
        <field var='hats#title'>
            <value>Host</value>
        </field>
        <field var='hats#uri'>
            <value>http://schemas.example.com/hats#host</value>
        </field>
        <field var='hats#hue'>
            <value>327.255249</value>
        </field>
      </item>
      <item>
        <field var='hats#title'>
            <value>Presenter</value>
        </field>
        <field var='hats#uri'>
            <value>http://schemas.example.com/hats#presenter</value>
        </field>
        <field var='hats#hue'>
            <value>171.430664</value>
        </field>
      </item>
      …
    </x>
  </command>
</iq>
]]></example>
  </section2>
  <section2 topic="Assigning a Hat" anchor="add">
    <p>Hats are assigned and removed using <span class="ref"><link url="https://xmpp.org/extensions/xep-0050.html">Ad-Hoc Commands (XEP-0050)</link></span> <note>XEP-0050: Ad-Hoc Commands &lt;<link url="https://xmpp.org/extensions/xep-0050.html">https://xmpp.org/extensions/xep-0050.html</link>&gt;.</note>.</p>
    <p>The following flow shows how to assign a hat.</p>
    <example caption="Admin Requests to Assign a Hat"><![CDATA[
<iq from='professor@example.edu/office'
    id='fdi3n2b6'
    to='physicsforpoets@courses.example.edu'
    type='set'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
           action='execute'
           node='urn:xmpp:hats:commands:assign'/>
</iq>
]]></example>
    <p>Unless an error occurs, the room returns the appropriate form.</p>
    <example caption="Room Returns Form to Admin"><![CDATA[
<iq from='physicsforpoets@courses.example.edu'
    id='fdi3n2b6'
    to='professor@example.edu/office'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='urn:xmpp:hats:commands:assign'
           sessionid='A971D19A-2226-4DAD-B261-8D0886B9A026'
           status='executing'>
    <x xmlns='jabber:x:data' type='form'>
      <title>Assigning a Hat</title>
      <instructions>Fill out this form to assign a hat.</instructions>
      <field type='hidden' var='FORM_TYPE'>
        <value>urn:xmpp:hats:commands</value>
      </field>
      <field label='User Address'
             type='jid-single'
             var='hats#jid'>
        <required/>
      </field>
      <field label='The role'
             type='list-single'
             var='hats#uri'>
        <option label='Teacher'><value>http://tech.example.edu/hats#Teacher</value></option>
        <option label='Teacher&apos;s Assistant'><value>http://tech.example.edu/hats#TeacherAssistant</value></option>
        <option label='Test Proctor'><value>http://tech.example.edu/hats#Proctor</value></option>
      </field>
    </x>
  </command>
</iq>
]]></example>
    <example caption="Admin Submits Form"><![CDATA[
<iq from='professor@example.edu/office'
    id='9fens61z'
    to='physicsforpoets@courses.example.edu'
    type='set'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='urn:xmpp:hats:commands:assign'
           sessionid='A971D19A-2226-4DAD-B261-8D0886B9A026'>
    <x xmlns='jabber:x:data' type='submit'>
      <field type='hidden' var='FORM_TYPE'>
        <value>urn:xmpp:hats:commands</value>
      </field>
      <field var='hats#jid'>
        <value>terry.anderson@example.edu</value>
      </field>
      <field var='hats#uri'>
        <value>http://tech.example.edu/hats#TeacherAssistant</value>
      </field>
    </x>
  </command>
</iq>
]]></example>
    <example caption="Room Informs Admin of Completion"><![CDATA[
<iq from='physicsforpoets@courses.example.edu'
    id='9fens61z'
    to='professor@example.edu/office'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='urn:xmpp:hats:commands:assign'
           sessionid='A971D19A-2226-4DAD-B261-8D0886B9A026'
           status='completed'/>
</iq>
]]></example>
    <p>Note: only one hat is added at a time, and the form uses a field of type "list-single" to enforce that logic.</p>
  </section2>
  <section2 topic="Removing a Hat" anchor="remove">
    <p>The following flow shows how to remove a hat.</p>
    <p>When the hat is removed, the room SHOULD broadcast the related JID presence with the refreshed hat list.</p>
    <example caption="Admin Requests to Remove a Hat"><![CDATA[
<iq from='professor@example.edu/office'
    id='fdi3n2b6'
    to='physicsforpoets@courses.example.edu'
    type='set'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
           action='execute'
           node='urn:xmpp:hats:commands:unassign'>
    <x xmlns='jabber:x:data' type='submit'>
      <field type='hidden' var='FORM_TYPE'>
        <value>urn:xmpp:hats:commands</value>
      </field>
      <field var='hats#jid'>
        <value>terry.anderson@example.edu</value>
      </field>
      <field var='hats#uri'>
        <value>http://tech.example.edu/hats#TeacherAssistant</value>
      </field>
    </x>
  </command>
</iq>
]]></example>
    <example caption="Room Informs Admin of Completion"><![CDATA[
<iq from='physicsforpoets@courses.example.edu'
    id='fdi3n2b6'
    to='professor@example.edu/office'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='urn:xmpp:hats:commands:unassign'
           sessionid='A971D19A-2226-4DAD-B261-8D0886B9A026'
           status='completed'/>
</iq>
]]></example>
  </section2>

  <section2 topic="Listing Assigned Hats">
    <p>An entity might be interested to get all the hats assigned to users in a chatroom.</p>

    <example caption="User’s client request the hats list assigned on a MUC room"><![CDATA[
<iq from='professor@example.edu/office'
  id='fdi3n2b6'
  to='physicsforpoets@courses.example.edu'
  type='set'
  xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
          action='execute'
          node='urn:xmpp:hats:commands:list-assigned'/>
</iq>]]></example>
    <example caption="Room Returns the List of Assigned Hats"><![CDATA[
<iq from='physicsforpoets@courses.example.edu'
    id='fdi3n2b6'
    to='professor@example.edu/office'
    type='result'
    xml:lang='en'>
  <command xmlns='http://jabber.org/protocol/commands'
           node='urn:xmpp:hats:commands:list-assigned'
           status='completed'
           sessionid='A971D19A-2226-4DAD-B261-9D0886B9A026'>
    <x xmlns='jabber:x:data' type='result'>
      <title>Assigned Hats List</title>
      <reported>
        <field var='hats#jid'/>
        <field var='hats#uri'/>
        <field var='hats#title'/>
        <field var='hats#hue'/>
      </reported>
      <item>
        <field var='hats#jid'>
            <value>terry.anderson@example.edu</value>
        </field>
        <field var='hats#uri'>
            <value>http://tech.example.edu/hats#TeacherAssistant</value>
        </field>
        <field var='hats#title'>
            <value>Assistant</value>
        </field>
        <field var='hats#hue'>
            <value>327.255249</value>
        </field>
      </item>
      …
    </x>
  </command>
</iq>
]]></example>
  </section2>

  <section2 topic="Field Standardization" anchor="registrar-formtype">
    <p><span class="ref"><link url="https://xmpp.org/extensions/xep-0068.html">Field Standardization for Data Forms (XEP-0068)</link></span> <note>XEP-0068: Field Data Standardization for Data Forms &lt;<link url="https://xmpp.org/extensions/xep-0068.html">https://xmpp.org/extensions/xep-0068.html</link>&gt;.</note> defines a process for standardizing the fields used within Data Forms qualified by a particular FORM_TYPE. Within Hats, all the interactions revolves around one unique FORM_TYPE, urn:xmpp:hats:commands. The reserved fields are defined below.</p>

    <code caption="Registry Submission"><![CDATA[
<form_type>
  <name>urn:xmpp:hats:commands</name>
  <doc>XEP-0317</doc>
  <desc>
    Forms enabling the creation, destruction, assignal and removal of hats.
  </desc>
  <field
      var='hats#jid'
      type='text-single'
      label='JID to which a hat is assigned'/>
  <field
      var='hats#title'
      type='text-single'
      label='Title'/>
  <field
      var='hats#uri'
      type='text-single'
      label='Unique URI'/>
  <field
      var='hats#hue'
      type='text-single'
      label='Custom color'/>
  <field
      var='hats#hash'
      type='text-single'
      label='Hash computed from the list of hats available in a room'/>
</form_type>
]]></code>
  </section2>
</section1>

<section1 topic="Security Considerations" anchor="security">
  <p>To follow.</p>
</section1>

<section1 topic="IANA Considerations" anchor="iana">
  <p>This document requires no interaction with the <span class="ref"><link url="http://www.iana.org/">Internet Assigned Numbers Authority (IANA)</link></span> <note>The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see &lt;<link url="http://www.iana.org/">http://www.iana.org/</link>&gt;.</note>.</p>
</section1>

<section1 topic="XMPP Registrar Considerations" anchor="registrar">

  <section2 topic="Protocol Namespaces" anchor="registrar-protocol">
    <p>The XMPP Registrar shall add "urn:xmpp:hats:0" to its registry of protocol namespaces.</p>
  </section2>

</section1>

<section1 topic="XML Schema" anchor="schema">
  <p>To follow.</p>
</section1>

<section1 topic="Acknowledgements" anchor="acks">
  <p>The concepts underlying this specification were first discussed several years ago at an XMPP Summit in Brussels, Belgium. Special thanks to Joe Hildebrand and Ralph Meijer for their contributions to those discussions. Thanks also to Matt Miller, Kevin Smith, Matthew Wild and badlop for their feedback on the written specification.</p>
</section1>

</xep>
