title: Tsung: Using iterator in loop
body: <p>I'm trying to create load testing scenario for <code>ejabberd</code> with <code>tsung</code>.</p>
  
  <p>I want simulate thousands of XMPP events from thousands clients. According tsung's <a href="http://tsung.erlang-projects.org/user_manual.html#htoc68" rel="nofollow">manual</a> I can create repeated actions using <code>for</code> loop:</p>
  
  <pre><code>&lt;for from="1" to="10" incr="1" var="counter"&gt;
    [...]
    &lt;request&gt; &lt;http url="/page?id=%%_counter%%"&gt;&lt;/http&gt; &lt;/request&gt;
    [...]
  &lt;/for&gt;
  </code></pre>
  
  <p>But this example don't working for me:</p>
  
  <pre><code>alex@alex:~/.tsung$ tsung -f jabber.xml start
  Starting Tsung
  "Log directory is: /home/alex/.tsung/log/20130417-1404"
  3306- fatal: {error,{validity_constraint_Name_Token,37}}
  Config Error, aborting ! {fatal,{{error,{validity_constraint_Name_Token,37}},
                                   {file,"jabber.xml"},
                                   {line,10},
                                   {col,29}}}
  </code></pre>
  
  <p>Full config file:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd"&gt;
  &lt;tsung loglevel="notice" version="1.5"&gt;
      &lt;clients&gt;
          &lt;client host="localhost" use_controller_vm="true"&gt;&lt;/client&gt;
      &lt;/clients&gt;
      &lt;!-- Server side setup --&gt;
      &lt;servers&gt;
          &lt;for from="1" to="1000" incr="1" var="counter"&gt;
              &lt;server host="t%%_counter%%.testserver.org" port="5222" type="tcp"&gt;&lt;/server&gt;
          &lt;/for&gt;
      &lt;/servers&gt;
      &lt;load&gt;
          &lt;arrivalphase phase="1" duration="1" unit="minute"&gt;
              &lt;users interarrival="2" unit="second"&gt;&lt;/users&gt;
          &lt;/arrivalphase&gt;
      &lt;/load&gt;
      &lt;!-- JABBER parameters --&gt;
      &lt;!-- to synchronise users,  use a global acknoledgement --&gt;
      &lt;options&gt;
          &lt;option type="ts_jabber" name="global_number" value="100"&gt;&lt;/option&gt;
          &lt;option type="ts_jabber" name="userid_max" value="10000"&gt;&lt;/option&gt;
          &lt;option type="ts_jabber" name="domain" value="mydomain.org"&gt;&lt;/option&gt;
          &lt;option type="ts_jabber" name="username" value="user"&gt;&lt;/option&gt;
          &lt;option type="ts_jabber" name="passwd" value="pass"&gt;&lt;/option&gt;
      &lt;/options&gt;
      &lt;sessions&gt;
          &lt;session probability="100" name="jabber-loadtest" type="ts_jabber"&gt;
              &lt;request&gt;&lt;jabber type="presence:broadcast" show="online" status="Status: online" ack="no_ack"/&gt;&lt;/request&gt;
              &lt;thinktime value="1"&gt;&lt;/thinktime&gt;
              &lt;request&gt;&lt;jabber type="presence:broadcast" show="offline" status="Status: offline" ack="no_ack"/&gt;&lt;/request&gt;
          &lt;/session&gt;
      &lt;/sessions&gt;
  &lt;/tsung&gt;
  </code></pre>
  
  <p>How can I use loops in <code>tsung</code> configuration file?</p>