Following is an excerpt from $ANT_HOME/etc/junit-noframes.xsl.
<!-- template that will convert a carriage return into a br tag @param word the text from which to convert CR to BR tag --> <xsl:template name="br-replace"> <xsl:param name="word"/> <xsl:param name="br"><br/></xsl:param> <xsl:value-of select='stringutils:replace(string($word),"
",$br)'/> </xsl:template> The purpose of the template is to convert new-lines to <br/> tags in text such as stack traces. This template does not insert the desired <br/> tags and only deletes the new-lines that are found. I chased this for a week in the XALAN mailing list to learn that this is not valid. I was able to accomplish the desired effect (preserving formatting of the stack trace) by adding <pre> ... </pre> tags to the generated HTML and removing the call to the br-replace template. My solution is shown below. Perhaps someone on the dev team could consider this for ANT 1.7? Michael Giroux <!-- Style for the error and failure in the tescase template --> <xsl:template name="display-failures"> <xsl:choose> <xsl:when test="not(@message)">N/A</xsl:when> <xsl:otherwise> <xsl:value-of select="@message"/> </xsl:otherwise> </xsl:choose> <!-- display the stacktrace --> * <pre>* <code> <br/> <xsl:value-of select="." /> * <!-- <xsl:call-template name="br-replace"> <xsl:with-param name="word" select="."/> </xsl:call-template> --> * </code> * </pre>* <!-- the later is better but might be problematic for non-21" monitors... --> <!--pre><xsl:value-of select="."/></pre--> </xsl:template>