ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Giroux" <>
Subject Invalid use of string utils in
Date Fri, 08 Dec 2006 17:41:35 GMT
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),"&#xA;",$br)'/>

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

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:when test="not(@message)">N/A</xsl:when>
            <xsl:value-of select="@message"/>
    <!-- display the stacktrace -->
*    <pre>*
        <xsl:value-of select="." />
*        <!--
        <xsl:call-template name="br-replace">
            <xsl:with-param name="word" select="."/>
*    </code>
*    </pre>*
    <!-- the later is better but might be problematic for non-21"
monitors... -->
    <!--pre><xsl:value-of select="."/></pre-->

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message