<?xml-stylesheet href="microsummary.xsl" type="text/xsl"?>
<generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="Bugzilla Search Microsummary" sourceURI="http://dietrich.ganx4.com/mozilla/bugzilla-search-microsummary.xml" uri="urn:source:http://dietrich.ganx4.com/mozilla/bugzilla-search-microsummary.xml">
   <pages>
     <include>https://bugzilla.mozilla.org/.*</include>
   </pages>
   <template>
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="text"/>
    <xsl:template match="/">
      <xsl:value-of select="substring-after(/html/head/title, ': ')"/><xsl:text>: </xsl:text>
      <xsl:variable name="set" select="id('bugzilla-body')/child::text()[contains(., 'found')]"/>
      <xsl:for-each select="$set">
        <xsl:if test="position() = last()">
          <xsl:choose>
            <xsl:when test="contains(., ' bugs found.')">
              <xsl:value-of select="substring-before(normalize-space(.),' bugs found.')"/>
            </xsl:when>
            <xsl:when test="contains(., 'bug found.')">
              <xsl:text>1</xsl:text>
            </xsl:when>
            <xsl:when test="contains(., 'Zarro')">
              <xsl:text>0</xsl:text>
            </xsl:when>
            <xsl:otherwise>
              <xsl:text>UNSUPPORTED</xsl:text>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:if>
      </xsl:for-each>
    </xsl:template>
    </xsl:transform>
   </template>
 </generator>
