title: XML -> Smarty foreach and if condition
body: <p>I have some small problems with code of smarty template for results . The problem is next this code is <strong>working</strong> but doesn't give me 500 results for this if condition. The code is looking like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;source&gt;
  &lt;publisher&gt;CMS&lt;/publisher&gt;
  &lt;publisherurl&gt;&lt;![CDATA[{$GLOBALS.site_url}]]&gt;&lt;/publisherurl&gt;
  
      {foreach from=$listings item=listing}
  
          {if $listing.Country =='USA' || $listing.Country == 'UK' || $listing.Country == 'Russia'}
  
      &lt;job&gt;
          {$listings.foreach.Country.total} Total results
          &lt;title&gt;&lt;![CDATA[{$listing.Title}]]&gt;&lt;/title&gt;
  
          &lt;date&gt;&lt;![CDATA[{$listing.activation_date}]]&gt;&lt;/date&gt;
          &lt;referencenumber&gt;&lt;![CDATA[{$listing.id}]]&gt;&lt;/referencenumber&gt;
          &lt;url&gt;&lt;![CDATA[{$listing.listing_url}]]&gt;&lt;/url&gt;
          &lt;company&gt;&lt;![CDATA[{$listing.user.CompanyName}]]&gt;&lt;/company&gt;
          &lt;city&gt;&lt;![CDATA[{$listing.City}]]&gt;&lt;/city&gt;
  
          &lt;country&gt;&lt;![CDATA[{$listing.Country}]]&gt;&lt;/country&gt;
  
          &lt;description&gt;&lt;![CDATA[{$listing.JobDescription|strip_tags:false} {$listing.JobRequirements|strip_tags:false}]]&gt;&lt;/description&gt;
          &lt;salary&gt;&lt;![CDATA[{$listing.Salary.value} {foreach from=$listing.SalaryType item=list_value name="multifor"}{tr domain="Property_SalaryType"}{$list_value}{/tr}{if !$smarty.foreach.multifor.last}, {/if}{/foreach}]]&gt;&lt;/salary&gt;
  
          &lt;jobtype&gt;&lt;![CDATA[{foreach from=$listing.EmploymentType item=list_value name="multifor"}{tr domain="Property_EmploymentType"}{$list_value}{/tr}{if !$smarty.foreach.multifor.last}, {/if}{/foreach}]]&gt;&lt;/jobtype&gt;
  
  
      &lt;/job&gt;
  
          {/if}    
  
  
      {/foreach}    
  
  &lt;/source&gt;
  </code></pre>
  
  <p>If you see or know answer please post it below, thanks!</p>