title: How to count output lines with xslt?
body: <p>I'm outputting text with XSLT. I need to count the number of lines of each section and write it out to my output file. How this could be done?</p>
  
  <p>My output is like this:</p>
  
  <pre>
  HDR+aaa:bbb'
  AAA+78901234567890+String1:String2'
  BBB+123+String'
  CCC+321:1212'
  DDD+112211'
  DDD+121122'
  XXX+number_of_records+78901234567890'
  AAA+1234567890+String1:String2'
  BBB+123+String'
  CCC+321:1212'
  DDD+1212:2121'
  BBB+123+String'
  BBB+122+String'
  CCC+String'
  XXX+number_of_records+1234567890'
  </pre>
  
  <p>The number_of_records should contain number of lines from AAA to XXX including both lines. In the first section the number of lines should be 6 and in the second message it should be 8. The first and the last line of each section will share the same unique ID-number.</p>
  
  <p>The number of lines cannot be counted from source since there is so much processing inside XSLT. </p>