Ant's Bugzilla issue 39492 applies to AntUnit as well. Properly escape XML in stacktraces

git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/antunit/trunk@796145 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Bodewig 2009-07-21 05:03:02 +00:00
parent 3176f752cb
commit fa15dbd298
3 changed files with 28 additions and 2 deletions

View File

@ -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">

View File

@ -873,7 +873,18 @@ h6 {
-->
<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">

View File

@ -468,7 +468,18 @@ under the License.
-->
<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">