ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r796144 - in /ant/core/trunk: WHATSNEW src/etc/junit-frames.xsl src/etc/junit-noframes.xsl
Date Tue, 21 Jul 2009 05:00:59 GMT
Author: bodewig
Date: Tue Jul 21 05:00:59 2009
New Revision: 796144

URL: http://svn.apache.org/viewvc?rev=796144&view=rev
Log:
keep escaping XML in stacktraces.  PR 39492

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/etc/junit-frames.xsl
    ant/core/trunk/src/etc/junit-noframes.xsl

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=796144&r1=796143&r2=796144&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Jul 21 05:00:59 2009
@@ -408,6 +408,10 @@
    update attribute has been set to true.
    Bugzilla Report 30751.
 
+ * The default stylesheets for <junitreport> failed to properly escape
+   XML content in exception stack traces.
+   Bugzilla Report 39492
+
 Other changes:
 --------------
  * The get task now also follows redirects from http to https

Modified: ant/core/trunk/src/etc/junit-frames.xsl
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/junit-frames.xsl?rev=796144&r1=796143&r2=796144&view=diff
==============================================================================
--- ant/core/trunk/src/etc/junit-frames.xsl (original)
+++ ant/core/trunk/src/etc/junit-frames.xsl Tue Jul 21 05:00:59 2009
@@ -862,7 +862,18 @@
 -->
 <xsl:template name="br-replace">
     <xsl:param name="word"/>
-    <xsl:value-of disable-output-escaping="yes" select='stringutils:replace(string($word),"&#xA;","&lt;br/>")'/>
+    <xsl:choose>
+      <xsl:when test="contains($word, '&#xa;')">
+        <xsl:value-of select="substring-before($word, '&#xa;')"/>
+        <br/>
+        <xsl:call-template name="br-replace">
+          <xsl:with-param name="word" select="substring-after($word, '&#xa;')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:value-of select="$word"/>
+      </xsl:otherwise>
+    </xsl:choose>
 </xsl:template>
 
 <xsl:template name="display-time">

Modified: ant/core/trunk/src/etc/junit-noframes.xsl
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/junit-noframes.xsl?rev=796144&r1=796143&r2=796144&view=diff
==============================================================================
--- ant/core/trunk/src/etc/junit-noframes.xsl (original)
+++ ant/core/trunk/src/etc/junit-noframes.xsl Tue Jul 21 05:00:59 2009
@@ -451,7 +451,18 @@
 -->
 <xsl:template name="br-replace">
     <xsl:param name="word"/>
-    <xsl:value-of disable-output-escaping="yes" select='stringutils:replace(string($word),"&#xA;","&lt;br/>")'/>
+    <xsl:choose>
+      <xsl:when test="contains($word, '&#xa;')">
+        <xsl:value-of select="substring-before($word, '&#xa;')"/>
+        <br/>
+        <xsl:call-template name="br-replace">
+          <xsl:with-param name="word" select="substring-after($word, '&#xa;')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+	<xsl:value-of select="$word"/>
+      </xsl:otherwise>
+    </xsl:choose>
 </xsl:template>
 
 <xsl:template name="display-time">



Mime
View raw message