AxKit2
view release on metacpan or search on metacpan
demo/webmail/xmlmail-display.xsl view on Meta::CPAN
</div>
</xsl:template>
<xsl:template match="xmlmail/header/subject">
<div class="headerline">
<b>Subject:</b> 
<xsl:call-template name="truncate-string">
<xsl:with-param name="length" select="$max-header-length"/>
<xsl:with-param name="string" select="text()"/>
</xsl:call-template>
</div>
</xsl:template>
<xsl:template match="xmlmail/header/date">
<div class="headerline">
<b>Date:</b> 
<xsl:call-template name="truncate-string">
<xsl:with-param name="length" select="$max-header-length"/>
<xsl:with-param name="string" select="text()"/>
</xsl:call-template>
</div>
</xsl:template>
<xsl:template match="xmlmail/header/to">
<div class="headerline">
<b>To:</b> 
<xsl:call-template name="truncate-string">
<xsl:with-param name="length" select="$max-header-length"/>
<xsl:with-param name="string" select="text()"/>
</xsl:call-template>
</div>
</xsl:template>
<xsl:template match="xmlmail/header/cc">
<div class="headerline">
<b>Cc:</b> 
<xsl:call-template name="truncate-string">
<xsl:with-param name="length" select="$max-header-length"/>
<xsl:with-param name="string" select="text()"/>
</xsl:call-template>
</div>
</xsl:template>
<xsl:template match="xmlmail/header/x-header">
<div class="headerline">
<b><xsl:value-of select="name"/>:</b> 
<xsl:call-template name="truncate-string">
<xsl:with-param name="length" select="$max-header-length"/>
<xsl:with-param name="string" select="value/text()"/>
</xsl:call-template>
</div>
</xsl:template>
<xsl:template match="xmlmail/body">
<div class="emailbody">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="htmlpart[@pre='1']">
<!-- <div class="marker">HTML Part (decoded to text):</div> -->
<pre>
<xsl:apply-templates/>
</pre>
</xsl:template>
<xsl:template match="htmlpart">
<!-- <div class="marker">HTML Part (decoded to text):</div> -->
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="textpart">
<!-- <div class="marker">Plain Text Part:</div> -->
<pre>
<xsl:apply-templates/>
</pre>
</xsl:template>
<xsl:template match="*|@*">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template name="truncate-string">
<xsl:choose>
<xsl:when test="string-length($string) > $length">
<xsl:value-of select="concat(substring($string, 1, ($length - 3)), '...')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
( run in 1.482 second using v1.01-cache-2.11-cpan-39a47a84364 )