ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19301] - junitreport fails for long string literals
Date Sat, 24 Jan 2004 13:36:58 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19301>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19301

junitreport fails for long string literals





------- Additional Comments From sbailliez@apache.org  2004-01-24 13:36 -------
There is no XSLT-only fix to this as far as I can see. The main problem is 
that a function such as translate() only operates with single character rather 
than string so you are left with a recursive template.

An easy fix (and that should probably speed up things as well) is to use Xalan 
Java extension. I don't have time right now to fully test the solution but 
here is it:

edit <xsl:stylesheet> root element and add the attribute 
xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils"

Replace the JS-escape template with the following one:

<xsl:template name="JS-escape">
    <xsl:param name="string"/>
    <xsl:param name="tmp1" select="stringutils:replace(string
($string),'\','\\')"/>
    <xsl:param name="tmp2" select="stringutils:replace(string
($tmp1),&quot;'&quot;,&quot;\&apos;&quot;)"/>
    <xsl:value-of select="$tmp2"/>
</xsl:template>

Please give your feedback.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message