title: Add two values in xslt that sometimes can be null
body: <p>I would like to add to values from a xml to another one using xslt. I am using xml version 1.</p>
  
  <pre><code>&lt;xsl:value-of select="number(/fields/field[@name='value1'])+number(/fields/field[@name='value2'])"/&gt;
  </code></pre>
  
  <p>How could I do this if value1 or value2 sometimes would be empty and produce and NaN?</p>
  
  <p>I know that I can use if and when to see if value1 or value2 is not empty but let's say I can't check that. How could I solve this?</p>
  
  <p>What I would like to do is if "number(/fields/field[@name='value2'])" would produce a NaN it should be the number 0 then it would work.</p>
  
  <p>Best regards
  Joe</p>