<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:x="http://www.w3.org/1999/xhtml"
version="1.0"
exclude-result-prefixes="x">

<xsl:template match="x:style">
   <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    dt { font-size: smaller }
   </xsl:copy>
</xsl:template>

<xsl:template match="x:dt">
<xsl:variable name="dd" select="following-sibling::x:dd[1]/node()"/>
<xsl:variable name="dt" select="."/>
<xsl:if test="not(contains($dd,'has joined') or
                      contains($dd,'has left') or
                      starts-with($dd,'q?') or 
                      starts-with($dd,'Q?') or 
                      starts-with($dd,'q+') or 
                      starts-with($dd,'Q+') or 
                      starts-with($dd,'q-') or
                      starts-with($dd,'Q-') or
                      starts-with($dd,'q=') or
                      starts-with($dd,'Q=') or
                      starts-with($dd,'+q') or
                      starts-with($dd,'+Q') or
                      starts-with($dd,'-q') or
                      starts-with($dd,'-Q') or
                      starts-with($dd,'Zakim, ??') or

                      (contains($dt,'Zakim') and (
                        starts-with($dd,'-') or
                        starts-with($dd,'+'))) or

                      starts-with($dd,'ack '))">

<!-- copy text of dt, remove timestamp -->
<dt><xsl:value-of select="substring-after(.,' ')"/></dt>

<!-- fetch the dd next to us and work on it -->
<dd><xsl:apply-templates select="$dd"/></dd> </xsl:if>

</xsl:template>

<!-- do nothing with dd since they're already dealt with above -->
<xsl:template match="x:dd"/>

<!-- by default copy everything varbatim -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

