title: XSLT Ternary "If" Operator?
body: <p>I am making use of XSLT and XML to produce an output document.</p>
  
  <p>What I have in the data (in XML form over which I have no control) is the following:</p>
  
  <pre><code>&lt;ea type="null"/&gt;
  &lt;pa type="null"/&gt;
  &lt;perf&gt;4&lt;/perf&gt;
  </code></pre>
  
  <p>I need to use these in calculations. I see that providing a default value for these requires performing a transformation on the document to provide a default value which is a bit long winded.</p>
  
  <p>So I thought, does there exist a ternary operation in XPath/XSLT, along the lines of PHP:</p>
  
  <pre><code>$result = ($var == null ? true:false)
  </code></pre>
  
  <p>So that the following provides a result (even if it is zero)</p>
  
  <pre><code>&lt;xsl:value-of select="ea + pa + perf" /&gt;
  </code></pre>