title: how to get unique record count for each location_Name by Record_No when RECORD_TYPE='ERROR' with XSLT
body: <p>how to get unique record count for each location_Name by Record_No when RECORD_TYPE='ERROR'. 
  if there are multiple records with RECORD_TYPE='ERROR' for a RECORD_NO then only one record should be counted for a RECORD_NO 
  and finally all these records should be grouped by LOCATION_NAME
  below is the xml date</p>
  
  <pre><code>&lt;root&gt;
      &lt;SellOutErrorRecord&gt;
          &lt;RECORD_TYPE&gt;WARNING&lt;/RECORD_TYPE&gt;
          &lt;RECORD_NO&gt;1&lt;/RECORD_NO&gt;
              &lt;ERROR_DESC&gt;trx doc type is invalid&lt;/ERROR_DESC&gt;
          &lt;LOCATION_NAME&gt;Chen Ken&lt;/LOCATION_NAME&gt;
          &lt;PRODUCT_NUMBER&gt;336549R-001&lt;/PRODUCT_NUMBER&gt;
      &lt;/SellOutErrorRecord&gt;
      &lt;SellOutErrorRecord&gt;
          &lt;RECORD_TYPE&gt;ERROR&lt;/RECORD_TYPE&gt;
          &lt;RECORD_NO&gt;2&lt;/RECORD_NO&gt;
              &lt;ERROR_DESC&gt;invoice amount is zero&lt;/ERROR_DESC&gt;
          &lt;LOCATION_NAME&gt;Chen Ken&lt;/LOCATION_NAME&gt;
          &lt;PRODUCT_NUMBER&gt;3X-KN73C-DB&lt;/PRODUCT_NUMBER&gt;
      &lt;/SellOutErrorRecord&gt;
          &lt;SellOutErrorRecord&gt;
          &lt;RECORD_TYPE&gt;ERROR&lt;/RECORD_TYPE&gt;
              &lt;ERROR_DESC&gt;sales qty is zero&lt;/ERROR_DESC&gt;
          &lt;RECORD_NO&gt;2&lt;/RECORD_NO&gt;
          &lt;LOCATION_NAMEChen Ken&lt;/LOCATION_NAME&gt;
          &lt;PRODUCT_NUMBER&gt;3X-KN73C-DB&lt;/PRODUCT_NUMBER&gt;
      &lt;/SellOutErrorRecord&gt;
      &lt;SellOutErrorRecord&gt;
          &lt;RECORD_TYPE&gt;ERROR&lt;/RECORD_TYPE&gt;
          &lt;ERROR_DESC&gt;trx currency is invalid&lt;/ERROR_DESC&gt;
          &lt;RECORD_NO&gt;3&lt;/RECORD_NO&gt;
          &lt;LOCATION_NAME&gt;Chen Ken&lt;/LOCATION_NAME&gt;
          &lt;PRODUCT_NUMBER&gt;339112-B25&lt;/PRODUCT_NUMBER&gt;
      &lt;/SellOutErrorRecord&gt;
      &lt;SellOutErrorRecord&gt;
          &lt;RECORD_TYPE&gt;ERROR&lt;/RECORD_TYPE&gt;
          &lt;ERROR_DESC&gt;invoiced net amount is invalid&lt;/ERROR_DESC&gt;
          &lt;RECORD_NO&gt;3&lt;/RECORD_NO&gt;
          &lt;LOCATION_NAME&gt;Chen Ken&lt;/LOCATION_NAME&gt;
          &lt;PRODUCT_NUMBER&gt;445860-B21&lt;/PRODUCT_NUMBER&gt;
      &lt;/SellOutErrorRecord&gt;
      &lt;SellOutErrorRecord&gt;
          &lt;RECORD_TYPE&gt;ERROR&lt;/RECORD_TYPE&gt;
          &lt;ERROR_DESC&gt;invoiced net amount is invalid&lt;/ERROR_DESC&gt;
          &lt;RECORD_NO&gt;1&lt;/RECORD_NO&gt;
          &lt;LOCATION_NAME&gt;Chen Ken&lt;/LOCATION_NAME&gt;
          &lt;PRODUCT_NUMBER&gt;339112-B25&lt;/PRODUCT_NUMBER&gt;
      &lt;/SellOutErrorRecord&gt;
          &lt;SellOutErrorRecord&gt;
          &lt;RECORD_TYPE&gt;WARNING&lt;/RECORD_TYPE&gt;
          &lt;RECORD_NO&gt;1&lt;/RECORD_NO&gt;
              &lt;ERROR_DESC&gt;trx doc type is invalid&lt;/ERROR_DESC&gt;
          &lt;LOCATION_NAME&gt;Cheng Boon&lt;/LOCATION_NAME&gt;
          &lt;PRODUCT_NUMBER&gt;336549R-001&lt;/PRODUCT_NUMBER&gt;
      &lt;/SellOutErrorRecord&gt;
      &lt;SellOutErrorRecord&gt;
          &lt;RECORD_TYPE&gt;ERROR&lt;/RECORD_TYPE&gt;
          &lt;RECORD_NO&gt;2&lt;/RECORD_NO&gt;
              &lt;ERROR_DESC&gt;invoice amount is zero&lt;/ERROR_DESC&gt;
          &lt;LOCATION_NAME&gt;Cheng Boon&lt;/LOCATION_NAME&gt;
          &lt;PRODUCT_NUMBER&gt;3X-KN73C-DB&lt;/PRODUCT_NUMBER&gt;
      &lt;/SellOutErrorRecord&gt;
          &lt;SellOutErrorRecord&gt;*-
          &lt;RECORD_TYPE&gt;ERROR&lt;/RECORD_TYPE&gt;
              &lt;ERROR_DESC&gt;sales qty is zero&lt;/ERROR_DESC&gt;
          &lt;RECORD_NO&gt;2&lt;/RECORD_NO&gt;
          &lt;LOCATION_NAME&gt;Cheng Boon&lt;/LOCATION_NAME&gt;
          &lt;PRODUCT_NUMBER&gt;3X-KN73C-DB&lt;/PRODUCT_NUMBER&gt;
      &lt;/SellOutErrorRecord&gt;
      &lt;SellOutErrorRecord&gt;
          &lt;RECORD_TYPE&gt;ERROR&lt;/RECORD_TYPE&gt;
          &lt;ERROR_DESC&gt;trx currency is invalid&lt;/ERROR_DESC&gt;
          &lt;RECORD_NO&gt;3&lt;/RECORD_NO&gt;
          &lt;LOCATION_NAME&gt;Cheng Boon&lt;/LOCATION_NAME&gt;
          &lt;PRODUCT_NUMBER&gt;339112-B25&lt;/PRODUCT_NUMBER&gt;
      &lt;/SellOutErrorRecord&gt;
      &lt;SellOutErrorRecord&gt;
          &lt;RECORD_TYPE&gt;ERROR&lt;/RECORD_TYPE&gt;
          &lt;ERROR_DESC&gt;invoiced net amount is invalid&lt;/ERROR_DESC&gt;
          &lt;RECORD_NO&gt;3&lt;/RECORD_NO&gt;
          &lt;LOCATION_NAME&gt;Cheng Boon&lt;/LOCATION_NAME&gt;
          &lt;PRODUCT_NUMBER&gt;445860-B21&lt;/PRODUCT_NUMBER&gt;
      &lt;/SellOutErrorRecord&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>The expected output is: </p>
  
  <pre><code>LOCATION_NAME:Chen Ken COUNT:3
  LOCATION_NAME:Cheng Boon COUNT:2
  </code></pre>