title: How to use an if-else condition in a SAPUI5 XML-View?
body: <p>How can I implement an if-else condition in a XML-View in SAPUI5 that uses a flag (condition) from a <code>JSONModel</code>?</p>
  
  <p>So far I have a <strong>Controller</strong>:</p>
  
  <pre class="lang-js prettyprint-override"><code>sap.ui.define([
      "sap/ui/core/mvc/Controller",
      "sap/ui/model/json/JSONModel"
  ], function (Controller, JSONModel) {
      "use strict";
  
      return Controller.extend("sap.ui.demo.myApp.myController", {
          onInit: function () {
              //// set data model on view
              var oData = {
                  title: "A cool title",
                  values: [{name: "Text 1", marketed: true}, {name: "Text 2", marketed: false}, {name: "Text 3", , marketed: true}]
              };
  
              var oModel = new JSONModel(oData);
              this.getView().setModel(oModel);
          }
      });
  });
  </code></pre>
  
  <p>and a <strong>View</strong>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;mvc:View
      controllerName="sap.ui.demo.myApp.myController"
      xmlns="sap.m"&gt;
  
      &lt;!-- using aggregation binding --&gt;
      &lt;Panel expandable="true" expanded="true" headerText="{/title}" width="100%" content="{/values}"&gt;
          &lt;content&gt;
              &lt;Label text="{name}"/&gt;
              &lt;!-- if {marketed} 
                      &lt;Label text="product is marketed"/&gt; 
                   else 
                      add nothing
              --&gt;
          &lt;/content&gt;
      &lt;/Panel&gt;
  
  &lt;/mvc:View&gt;
  </code></pre>
  
  <p><strong>Edit</strong>:</p>
  
  <p>Is there a better way to do it than by implementing an overkill-feeling XML-Preprocessor?</p>