ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r796145 - in /ant/antlibs/antunit/trunk: changes.xml src/etc/junit-frames.xsl src/etc/junit-noframes.xsl
Date Tue, 21 Jul 2009 05:03:03 GMT
Author: bodewig
Date: Tue Jul 21 05:03:02 2009
New Revision: 796145

URL: http://svn.apache.org/viewvc?rev=796145&view=rev
Log:
Ant's Bugzilla issue 39492 applies to AntUnit as well.  Properly escape XML in stacktraces

Modified:
    ant/antlibs/antunit/trunk/changes.xml
    ant/antlibs/antunit/trunk/src/etc/junit-frames.xsl
    ant/antlibs/antunit/trunk/src/etc/junit-noframes.xsl

Modified: ant/antlibs/antunit/trunk/changes.xml
URL: http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/changes.xml?rev=796145&r1=796144&r2=796145&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/changes.xml (original)
+++ ant/antlibs/antunit/trunk/changes.xml Tue Jul 21 05:03:02 2009
@@ -44,6 +44,10 @@
     <action type="update">
       expectfailure report the original build exception chained when failing
     </action>
+    <action type="fix">
+      Default XSLT stylesheets now properly escape XML in exception
+      stack traces.
+    </action>
   </release>
   
   <release version="1.1" date="2008-09-26">

Modified: ant/antlibs/antunit/trunk/src/etc/junit-frames.xsl
URL: http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/etc/junit-frames.xsl?rev=796145&r1=796144&r2=796145&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/src/etc/junit-frames.xsl (original)
+++ ant/antlibs/antunit/trunk/src/etc/junit-frames.xsl Tue Jul 21 05:03:02 2009
@@ -873,7 +873,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/antlibs/antunit/trunk/src/etc/junit-noframes.xsl
URL: http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/etc/junit-noframes.xsl?rev=796145&r1=796144&r2=796145&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/src/etc/junit-noframes.xsl (original)
+++ ant/antlibs/antunit/trunk/src/etc/junit-noframes.xsl Tue Jul 21 05:03:02 2009
@@ -468,7 +468,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