title: XSLT concat string, remove last comma
body: <p>I need to build up a string using XSLT and separate each string with a comma but not include a comma after the last string. In my example below I will have a trailing comma if I have Distribution node and not a Note node for instance. I don't know of anyway to build up a string as a variable and then truncate the last character in XSLT. Also this is using the Microsoft XSLT engine.</p>
  
  <p>My String = </p>
  
  <pre><code>&lt;xsl:if test="Locality != ''"&gt;
    &lt;xsl:value-of select="Locality"/&gt;,
  &lt;/xsl:if&gt;
  &lt;xsl:if test="CollectorAndNumber != ''"&gt;
    &lt;xsl:value-of select="CollectorAndNumber"/&gt;,
  &lt;/xsl:if&gt;
  &lt;xsl:if test="Institution != ''"&gt;
    &lt;xsl:value-of select="Institution"/&gt;,
  &lt;/xsl:if&gt;
  &lt;xsl:if test="Distribution != ''"&gt;
    &lt;xsl:value-of select="Distribution"/&gt;,
  &lt;/xsl:if&gt;
  &lt;xsl:if test="Note != ''"&gt;
    &lt;xsl:value-of select="Note"/&gt;
  &lt;/xsl:if&gt;
  </code></pre>
  
  <p>[Man there's gotta be a better way to enter  into this question text box :( ]</p>