title: Parsing XML and checking for Null value in XSL document
body: <p>I am parsing some XML in the following format:</p>
  
  <pre><code>&lt;J_TITLE&gt;
  &lt;DATA pid="1"&gt;&lt;xsl:value-of select = "//TITLE"/&gt;&lt;/DATA&gt;
  &lt;DATA pid="3"&gt;&lt;xsl:value-of select = "//TITLE_FOR_3"/&gt;&lt;/DATA&gt;
  &lt;/J_TITLE&gt;
  </code></pre>
  
  <p>What I would like to do is check if TITLE_FOR_3 is null. If it is change the value to something else for DATA pid = 3. </p>
  
  <p>I have tried to complete the following but this is not working:</p>
  
  <pre><code>&lt;JPM_TITLE&gt;
      &lt;DATA pid="1"&gt;&lt;xsl:value-of select = "//TITLE"/&gt;&lt;/DATA&gt;
  
      &lt;xsl:value-of select = "//TITLE_FOR_3"/&gt;
      &lt;xsl:choose&gt;
          &lt;xsl:when test="string-length($NorTitle)!=0"&gt;
            &lt;DATA pid="3"&gt;&lt;xsl:value-of select = "//TITLE"/&gt;&lt;/DATA&gt;
          &lt;/xsl:when&gt;
          &lt;xsl:otherwise&gt;
            &lt;DATA pid="3"&gt;&lt;xsl:value-of select = "//TITLE_FOR_3"/&gt;&lt;/DATA&gt;
          &lt;/xsl:otherwise&gt;
      &lt;/xsl:choose&gt;
  &lt;/JPM_TITLE&gt;
  </code></pre>
  
  <p>The above has changed slightly from my original test. How do I name the value-of- select part so that I can do the string length check?  Or how can I pass the value of this into the string length check?</p>