title: XMPP: How to query specific roster information by Jabber Id
body: <p>I'm beginner in XMPP. I'm using Strophe js library.</p>
  
  <p>Now I wondering to get a <strong>specific roster item by its jabber id</strong>.</p>
  
  <p>But I'm confused about what kind of stanza &amp; property that I need to send.</p>
  
  <p>I've got the way to retrieve my roster list by sending IQ stanza like this:</p>
  
  <pre><code>&lt;iq from='juliet@example.com/balcony'
         id='bv1bs71f'
         type='get'&gt;
      &lt;query xmlns='jabber:iq:roster'/&gt;
  &lt;/iq&gt;
  </code></pre>
  
  <p>But I got <strong>all</strong> contact list like this:</p>
  
  <pre><code>&lt;iq id='bv1bs71f'
         to='juliet@example.com/chamber'
         type='result'&gt;
      &lt;query xmlns='jabber:iq:roster' ver='ver7'&gt;
        &lt;item jid='nurse@example.com' name='Nurse'/&gt;
        &lt;item jid='romeo@example.net' name='Romeo'/&gt;
        &lt;item jid='abc@example.net' name='Abc'/&gt;
        ....
      &lt;/query&gt;
  &lt;/iq&gt;
  </code></pre>
  
  <p>My question is how to get the <strong>specific item</strong> (only one item result) by <strong>sending my contact JID</strong> as a parameter? </p>
  
  <p>If I could explain by SQL the statement is like this:</p>
  
  <pre><code>SELECT * FROM roster WHERE jabberID = ....
  </code></pre>
  
  <p>rather than this:</p>
  
  <pre><code>SELECT * FROM roster
  </code></pre>
  
  <p>I want to get my contact <strong>nickname</strong> by its JID. </p>
  
  <p>Thanks in advance :)</p>