jmartin 01/02/10 04:15:42
Modified: src/xsl clog.xsl
Log:
Added template to convert carriage returns in commit message to <br> tags
Revision Changes Path
1.3 +22 -4 jakarta-alexandria/src/xsl/clog.xsl
Index: clog.xsl
===================================================================
RCS file: /home/cvs/jakarta-alexandria/src/xsl/clog.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- clog.xsl 2000/10/03 12:32:07 1.2
+++ clog.xsl 2001/02/10 12:15:42 1.3
@@ -27,7 +27,9 @@
<xsl:template match="entry">
<h2>
- <xsl:apply-templates select="msg"/>
+ <xsl:call-template name="escape-return">
+ <xsl:with-param name="string"><xsl:value-of
select="msg"/></xsl:with-param>
+ </xsl:call-template>
</h2>
<p>
<b>
@@ -68,10 +70,26 @@
</a>
</xsl:template>
- <xsl:template match="msg">
- <xsl:apply-templates/>
+ <xsl:template name="escape-return">
+ <xsl:param name="string"/>
+ <!-- must be a better way to define a carrige return -->
+ <xsl:variable name="return"><xsl:text>
+</xsl:text>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($string, $return)">
+ <xsl:value-of select="substring-before($string, $return)"/><br/>
+ <xsl:call-template name="escape-return">
+ <xsl:with-param name="string">
+ <xsl:value-of select="substring-after($string, $return)"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]