title: Using Ternary Operator in Spring-Integration xpath-expression
body: <p>I am using Spring Integration and have the following two kinds of xml inputs</p>
  
  <p>First XML:</p>
  
  <p><code>&lt;businessArea&gt;SomeValue&lt;/businessArea&gt;</code></p>
  
  <p>Second XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;businessArea&gt;
     &lt;Code&gt;SomeValue&lt;/Code&gt;
  &lt;/businessArea&gt;
  </code></pre>
  
  <p>Now, I want to store the value of business Area in the header based on the following conditions:</p>
  
  <p>1) If the businessArea has no child nodes such as <code>&lt;Code&gt;</code> in the second xml, then the node value of <code>businessArea</code> should be stored in the header.</p>
  
  <p>2) If the <code>businessArea</code> has any child node such as <code>&lt;Code&gt;</code> in the second xml, then null value should be stored in the header.</p>
  
  <p>I am currently using the following expression:</p>
  
  <pre><code>&lt;int-xml:header name="businessArea"  xpath-expression="//businessArea"  evaluation-type="STRING_RESULT"  overwrite="true" /&gt;
  </code></pre>
  
  <p>But, the above expression will not store the null value in the header if the xml is similar to the second xml that I have shown above. 
  I think I need to use ternary operator in the above expression. Can any one please suggest an expression which addresses my issue?</p>