«« Welcome Back, Durham Content Type Support Saves Me Time »»
blog header image
Unrecognized XSLTC extension Redirect:write

I'm moving the Durham project to Java 5.0 and not unexpectedly I've run into a few issues.

One of the issues was an error related to the junitreport Ant task. The task produces a nice HTML JUnit report from Ant's junit task output. Here's the error from the Ant log:

[junitreport] ERROR: 'Unrecognized XSLTC extension 'org.apache.xalan.xslt.extensions.Redirect:write''

I Googled the error and found a solution. It says to change any instances of
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect
to
xmlns:redirect="http://xml.apache.org/xalan/redirect" in XSL transforms that are being used.

Well, that's almost a solution. A developer is left to figure out which XSL file to edit in the case of junitreport. Here's what I found out.

The junitreport task uses a default XSL transform file to make the JUnit report but the transform can be overridden. The default transform file is located in [ant directory]\etc\junit-frames.xsl.

I wanted to change the default transform behaviour so that all of the Ant properties wouldn't be in the report. I was publishing these reports on the Internet and I didn't want sensitive information like passwords and machine specs in them.

I copied this file to my project and then specified its location when I called the junitreport Ant task:

<junitreport todir="${junit-data.dir}">
   <fileset dir="${junit-data.dir}">
      <include name="TEST-*.xml"/>
   </fileset>
   <report format="frames" styledir="${build.project.dir}" todir="${junit-reports.dir}"/>
</junitreport>

You use the styledir attribute to specify the directory of the custom junit-frames.xsl file.

The problem seems to be my custom XSL transform file; it's from an older version of Ant and doesn't have the xmlns:redirect correction explained above.

My solution was to recopy the junit-frames.xsl from the latest version of Ant (now 1.6.5) which has the xmlns:redirect correction and redo my custom changes in that file.

Incidentally, if you want to see how I removed properties from the JUnit report you can look at my custom junit-frames.xsl file by web browsing Durham's CVS repository on SourceForge.

Posted at July 09, 2005 at 12:53 AM EST
Last updated July 09, 2005 at 12:53 AM EST
Comments

I get a 404 for your link called "web browsing Durham's CVS repository"... ;-)

» Posted by: Jim at July 10, 2005 10:25 AM

Thanks Jim, I fixed the link.

» Posted by: Ryan at July 10, 2005 10:28 AM
Google
 
Search scope: Web ryanlowe.ca