title: How do you test for zero records when using <xsl:for-each>?
body: <p>My code generates the following XML:</p>
  
  <pre><code>&lt;person_app&gt;
    &lt;person_data&gt;
      &lt;person&gt;
           ...person details here...
      &lt;/person&gt;
    &lt;/person_data&gt;
  &lt;/person_app&gt;
  </code></pre>
  
  <p>Using XSLT, I parse the person records as follows:</p>
  
  <pre><code>&lt;xsl:template match="/person_app/person_data"&gt;
    &lt;xsl:for-each select="person"&gt;
        ...generate person HTML...
    &lt;/xsl:for-each&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>However, in cases when I receive zero people, I'd like to display "No records found" (or something similar).  When the app returns zero records, the XML resembles the following:</p>
  
  <pre><code>&lt;person_app/&gt;
  </code></pre>
  
  <p>Long story short, how can I test for an empty result set when I use &lt;xsl:for-each/&gt; to parse my Person records?  I've tried the following with no success:</p>
  
  <pre><code>&lt;xsl:if test="not(person)"&gt;
    &lt;div style="font-size:18pt"&gt;&lt;xsl:text&gt;No records found&lt;/xsl:text&gt;&lt;/div&gt;
  &lt;/xsl:if&gt;
  </code></pre>