title: XSL replace two types of characters in string values
body: <p>So let's say we have two scenarios where the XML may either contain birthdays with characters <code>/</code> or <code>-</code>. Example: <code>1966-02-02</code> or <code>1977/03/04</code>.</p>
  
  <p>I would like to remove those characters, so that the value becomes <code>19660202</code> and <code>19770304</code>, respectively</p>
  
  <p>Now, my current xsl looks like this:</p>
  
  <pre><code>&lt;xsl:if test="$person/birthDate != '' "&gt;
    &lt;xsl:attribute name="birthday"&gt;                                        
      &lt;xsl:variable name="dob" select="$person/birthDate"/&gt;
      &lt;xsl:choose&gt;
        &lt;xsl:when test="string-length($dob)&gt;10"&gt;
          &lt;xsl:value-of select="substring($dob,1,10)"/&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:otherwise&gt;
          &lt;xsl:value-of select="$dob"/&gt;
        &lt;/xsl:otherwise&gt;   
      &lt;/xsl:choose&gt;
    &lt;/xsl:attribute&gt;
  &lt;/xsl:if&gt;
  </code></pre>
  
  <p>How do I go about removing those characters in those two scenarios?</p>